Source Code Cross Referenced for CustomerContactRelPO.java in  » Database-ORM » ODAL » com » completex » objective » persistency » examples » ex003 » pos » 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 » ODAL » com.completex.objective.persistency.examples.ex003.pos 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * GENERATED CODE: DO NOT MODIFY IT UNDER ANY CIRCUMSTANCES!!!
003:         */package com.completex.objective.persistency.examples.ex003.pos;
004:
005:        import com.completex.objective.components.persistency.key.impl.DefaultNaturalKeyFactory;
006:        import java.util.Date;
007:        import java.util.HashMap;
008:        import java.util.Map;
009:        import java.io.InputStream;
010:        import java.math.BigDecimal;
011:        import java.math.BigInteger;
012:        import java.sql.Clob;
013:        import java.sql.Blob;
014:        import com.completex.objective.components.persistency.*;
015:        import com.completex.objective.components.persistency.key.impl.DefaultNaturalKeyFactory;
016:
017:        public class CustomerContactRelPO extends PersistentObject implements 
018:                java.io.Externalizable {
019:            //
020:            // Complex object related:
021:            //
022:
023:            //
024:            private static Map registeredMasters;
025:            private static Object lock = new Object();
026:
027:            protected Object classLock() {
028:                return lock;
029:            }
030:
031:            protected void instantiateRegisteredMasters() {
032:                if (registeredMasters == null) {
033:                    synchronized (lock) {
034:                        if (registeredMasters == null) {
035:                            registeredMasters = new HashMap();
036:                        }
037:                    }
038:                }
039:            }
040:
041:            protected Map registeredMasters() {
042:                return registeredMasters;
043:            }
044:
045:            //
046:            //
047:            //
048:
049:            public static final String TABLE_CUSTOMER_CONTACT_REL = "CUSTOMER_CONTACT_REL";
050:
051:            public CustomerContactRelPO() {
052:                super (new Record(table));
053:            }
054:
055:            public CustomerContactRelPO(Long contactId, String contactType,
056:                    Long customerId) {
057:                this ();
058:                setContactId(contactId);
059:                setContactType(contactType);
060:                setCustomerId(customerId);
061:            }
062:
063:            public static final String COL_CUSTOMER_ID = "CUSTOMER_ID";
064:            public static final String TCOL_CUSTOMER_ID = "CUSTOMER_CONTACT_REL.CUSTOMER_ID";
065:            public static final int ICOL_CUSTOMER_ID = 0;
066:            public static final int JDBC_TYPE_CUSTOMER_ID = -5;
067:
068:            public static final String COL_CONTACT_ID = "CONTACT_ID";
069:            public static final String TCOL_CONTACT_ID = "CUSTOMER_CONTACT_REL.CONTACT_ID";
070:            public static final int ICOL_CONTACT_ID = 1;
071:            public static final int JDBC_TYPE_CONTACT_ID = -5;
072:
073:            public static final String COL_CONTACT_TYPE = "CONTACT_TYPE";
074:            public static final String TCOL_CONTACT_TYPE = "CUSTOMER_CONTACT_REL.CONTACT_TYPE";
075:            public static final int ICOL_CONTACT_TYPE = 2;
076:            public static final int JDBC_TYPE_CONTACT_TYPE = 12;
077:
078:            private static final MetaTable table = new MetaTable(
079:                    "CUSTOMER_CONTACT_REL", "CUSTOMER_CONTACT_REL", 3, 3);
080:
081:            static {
082:                table.setStaticFinal(true);
083:                //
084:                // Meta Foreign Keys:
085:                //
086:                table.addToForeignKey("CONTACT", new ForeignKeyEntry(
087:                        "CONTACT_ID", "CONTACT_ID"));
088:                table.addToForeignKey("CUSTOMER", new ForeignKeyEntry(
089:                        "CUSTOMER_ID", "CUSTOMER_ID"));
090:                //
091:                // Meta Natural Key:
092:                //
093:                // naturalKey has no context 
094:
095:                //
096:                // Meta Columns:
097:                //
098:
099:                final MetaColumn metaCustomerId = new MetaColumn(
100:                        ICOL_CUSTOMER_ID, "CUSTOMER_ID", "CUSTOMER_ID", table);
101:                metaCustomerId.setPrimaryKey(true);
102:                metaCustomerId.setRequired(true);
103:                metaCustomerId.setOptimisticLock(false);
104:                metaCustomerId.setType(ColumnType.LONG);
105:                metaCustomerId.setColumnSize(0);
106:                metaCustomerId.setRemarks("");
107:                metaCustomerId.setDecimalDigits(0);
108:                metaCustomerId.setAutoGenerated(false);
109:                metaCustomerId.setAutoIncrement(false);
110:                metaCustomerId.setJdbcType(-5);
111:                table.addToPrimaryKey(new Integer(ICOL_CUSTOMER_ID));
112:                table.addColumn(metaCustomerId);
113:
114:                final MetaColumn metaContactId = new MetaColumn(
115:                        ICOL_CONTACT_ID, "CONTACT_ID", "CONTACT_ID", table);
116:                metaContactId.setPrimaryKey(true);
117:                metaContactId.setRequired(true);
118:                metaContactId.setOptimisticLock(false);
119:                metaContactId.setType(ColumnType.LONG);
120:                metaContactId.setColumnSize(0);
121:                metaContactId.setRemarks("");
122:                metaContactId.setDecimalDigits(0);
123:                metaContactId.setAutoGenerated(false);
124:                metaContactId.setAutoIncrement(false);
125:                metaContactId.setJdbcType(-5);
126:                table.addToPrimaryKey(new Integer(ICOL_CONTACT_ID));
127:                table.addColumn(metaContactId);
128:
129:                final MetaColumn metaContactType = new MetaColumn(
130:                        ICOL_CONTACT_TYPE, "CONTACT_TYPE", "CONTACT_TYPE",
131:                        table);
132:                metaContactType.setPrimaryKey(true);
133:                metaContactType.setRequired(true);
134:                metaContactType.setOptimisticLock(false);
135:                metaContactType.setType(ColumnType.STRING);
136:                metaContactType.setColumnSize(40);
137:                metaContactType.setRemarks("");
138:                metaContactType.setDecimalDigits(0);
139:                metaContactType.setAutoGenerated(false);
140:                metaContactType.setAutoIncrement(false);
141:                metaContactType.setJdbcType(12);
142:                table.addToPrimaryKey(new Integer(ICOL_CONTACT_TYPE));
143:                table.addColumn(metaContactType);
144:
145:            }
146:
147:            private Long customerId;
148:            private Long contactId;
149:            private String contactType;
150:
151:            //
152:            // customerId:
153:            //
154:            public Long getCustomerId() {
155:                return this .customerId;
156:            }
157:
158:            public void setCustomerId(Long customerId) {
159:                if (record2().setObject(ICOL_CUSTOMER_ID, customerId)) {
160:                    this .customerId = customerId;
161:                }
162:            }
163:
164:            public boolean izNullCustomerId() {
165:                return record2().getObject(ICOL_CUSTOMER_ID) == null;
166:            }
167:
168:            public void setNullCustomerId() {
169:                if (record2().setObject(ICOL_CUSTOMER_ID, null)) {
170:                    this .customerId = null;
171:                }
172:            }
173:
174:            //
175:            // contactId:
176:            //
177:            public Long getContactId() {
178:                return this .contactId;
179:            }
180:
181:            public void setContactId(Long contactId) {
182:                if (record2().setObject(ICOL_CONTACT_ID, contactId)) {
183:                    this .contactId = contactId;
184:                }
185:            }
186:
187:            public boolean izNullContactId() {
188:                return record2().getObject(ICOL_CONTACT_ID) == null;
189:            }
190:
191:            public void setNullContactId() {
192:                if (record2().setObject(ICOL_CONTACT_ID, null)) {
193:                    this .contactId = null;
194:                }
195:            }
196:
197:            //
198:            // contactType:
199:            //
200:            public String getContactType() {
201:                return this .contactType;
202:            }
203:
204:            public void setContactType(String contactType) {
205:                if (record2().setObject(ICOL_CONTACT_TYPE, contactType)) {
206:                    this .contactType = contactType;
207:                }
208:            }
209:
210:            public boolean izNullContactType() {
211:                return record2().getObject(ICOL_CONTACT_TYPE) == null;
212:            }
213:
214:            public void setNullContactType() {
215:                if (record2().setObject(ICOL_CONTACT_TYPE, null)) {
216:                    this .contactType = null;
217:                }
218:            }
219:
220:            public void toBeanFields() {
221:                toBeanFields(this );
222:            }
223:
224:            public void toBeanFields(PersistentObject from) {
225:                customerId = (Long) from.record2().getObject(ICOL_CUSTOMER_ID);
226:                contactId = (Long) from.record2().getObject(ICOL_CONTACT_ID);
227:                contactType = (String) from.record2().getObject(
228:                        ICOL_CONTACT_TYPE);
229:                super .toBeanFields(from);
230:            }
231:
232:            public void fromBeanFields(PersistentObject persistentObject) {
233:                CustomerContactRelPO from = (CustomerContactRelPO) persistentObject;
234:                record2().getEntry(ICOL_CUSTOMER_ID).setUnmarkedValue(
235:                        from.customerId, from.customerId);
236:                record2().getEntry(ICOL_CONTACT_ID).setUnmarkedValue(
237:                        from.contactId, from.contactId);
238:                record2().getEntry(ICOL_CONTACT_TYPE).setUnmarkedValue(
239:                        from.contactType, from.contactType);
240:                super .fromBeanFieldsDataSaved(persistentObject);
241:            }
242:
243:            public String toString() {
244:
245:                StringBuffer buffer = new StringBuffer();
246:                buffer.append("{ " + "class = ").append(
247:                        this .getClass().getName()).append(" " + "table = ")
248:                        .append(TABLE_CUSTOMER_CONTACT_REL).append(
249:                                " columns = {");
250:
251:                if (record() != null) {
252:                    buffer.append(COL_CUSTOMER_ID).append(" = ").append(
253:                            record().getObject(ICOL_CUSTOMER_ID)).append(" ");
254:                    buffer.append(COL_CONTACT_ID).append(" = ").append(
255:                            record().getObject(ICOL_CONTACT_ID)).append(" ");
256:                    buffer.append(COL_CONTACT_TYPE).append(" = ").append(
257:                            record().getObject(ICOL_CONTACT_TYPE)).append(" ");
258:                } else {
259:                    buffer.append(COL_CUSTOMER_ID).append(" = ").append(
260:                            customerId).append(" ");
261:                    buffer.append(COL_CONTACT_ID).append(" = ").append(
262:                            contactId).append(" ");
263:                    buffer.append(COL_CONTACT_TYPE).append(" = ").append(
264:                            contactType).append(" ");
265:                }
266:                buffer.append("}}");
267:                return buffer.toString();
268:            }
269:
270:            // naturalKey has no context 
271:
272:            /**
273:             * Equals by Basic Peristent object fields (without children objects)
274:             */
275:            public boolean equalsBasic(Object value) {
276:                if (this  == value)
277:                    return true;
278:                if (value == null || getClass() != value.getClass())
279:                    return false;
280:
281:                CustomerContactRelPO that = (CustomerContactRelPO) value;
282:
283:                if (customerId != null ? !customerId.equals(that.customerId)
284:                        : that.customerId != null)
285:                    return false;
286:                if (contactId != null ? !contactId.equals(that.contactId)
287:                        : that.contactId != null)
288:                    return false;
289:                if (contactType != null ? !contactType.equals(that.contactType)
290:                        : that.contactType != null)
291:                    return false;
292:                return true;
293:            }
294:
295:            /**
296:             * hashCode by Basic Peristent object fields (without children objects)
297:             */
298:            public int hashCodeBasic() {
299:                int result;
300:                long temp;
301:                result = (customerId != null ? customerId.hashCode() : 0);
302:                result = 29 * result
303:                        + (contactId != null ? contactId.hashCode() : 0);
304:                result = 29 * result
305:                        + (contactType != null ? contactType.hashCode() : 0);
306:
307:                return result;
308:            }
309:        }
w_w__w_.__j_a__v___a2__s_._co__m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.