Source Code Cross Referenced for Product.java in  » Database-ORM » castor » oes » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » castor » oes 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package oes;
002:
003:        import org.exolab.castor.jdo.Database;
004:        import org.exolab.castor.jdo.Persistent;
005:        import org.exolab.castor.jdo.PersistenceException;
006:        import org.exolab.castor.mapping.AccessMode;
007:
008:        public class Product implements  Persistent {
009:
010:            private Database _db;
011:
012:            private String _sku;
013:
014:            private String _shortName;
015:
016:            private String _description;
017:
018:            private int _categoryId;
019:
020:            private Category _category;
021:
022:            private int _priceId;
023:
024:            private Price _price;
025:
026:            public String getSku() {
027:                return _sku;
028:            }
029:
030:            public void setSku(String sku) {
031:                if (sku.length() != 14)
032:                    throw new IllegalArgumentException(
033:                            "Argument 'sku' must be 14 characters");
034:                _sku = sku;
035:            }
036:
037:            public String getShortName() {
038:                return _shortName;
039:            }
040:
041:            public void setShortName(String shortName) {
042:                shortName = shortName.trim();
043:                if (shortName.length() == 0)
044:                    throw new IllegalArgumentException(
045:                            "Argument 'shortName' is an empty string");
046:                _shortName = shortName;
047:            }
048:
049:            public String getDescription() {
050:                return _description;
051:            }
052:
053:            public void setDescription(String description) {
054:                description = description.trim();
055:                if (description.length() == 0)
056:                    throw new IllegalArgumentException(
057:                            "Argument 'description' is an empty string");
058:                _description = description;
059:            }
060:
061:            public int getCategoryId() {
062:                if (_category != null)
063:                    return _category.getCategoryId();
064:                return _categoryId;
065:            }
066:
067:            public void setCategoryId(int id) {
068:                _categoryId = id;
069:                _category = null;
070:            }
071:
072:            public Category getCategory() throws PersistenceException {
073:                if (_category != null)
074:                    return _category;
075:                _category = (Category) _db.load(Category.class, new Integer(
076:                        _categoryId));
077:                return _category;
078:            }
079:
080:            public void setCategory(Category category) {
081:                _category = category;
082:                _categoryId = category.getCategoryId();
083:            }
084:
085:            public int getPriceId() {
086:                if (_price != null)
087:                    return _price.getPriceId();
088:                return _priceId;
089:            }
090:
091:            public void setPriceId(int id) {
092:                _priceId = id;
093:                _price = null;
094:            }
095:
096:            public Price getPrice() throws PersistenceException {
097:                if (_price != null)
098:                    return _price;
099:                _price = (Price) _db.load(Price.class, new Integer(_priceId));
100:                return _price;
101:            }
102:
103:            public void setPrice(Price price) {
104:                _price = price;
105:                _priceId = price.getPriceId();
106:            }
107:
108:            public void jdoPersistent(Database db) {
109:                _db = db;
110:            }
111:
112:            public void jdoTransient() {
113:                _db = null;
114:                _price = null;
115:                _category = null;
116:            }
117:
118:            public Class jdoLoad(AccessMode accessMode) {
119:                return null;
120:            }
121:
122:            public void jdoBeforeCreate(Database db) {
123:            }
124:
125:            public void jdoAfterCreate() {
126:            }
127:
128:            public void jdoStore(boolean modified) {
129:            }
130:
131:            public void jdoBeforeRemove() {
132:            }
133:
134:            public void jdoAfterRemove() {
135:            }
136:
137:            public void jdoUpdate() {
138:            }
139:
140:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.