001: /**
002: * GENERATED CODE: DO NOT MODIFY IT UNDER ANY CIRCUMSTANCES!!!
003: */package com.completex.objective.persistency.examples.ex004.cpxpos;
004:
005: import com.completex.objective.components.persistency.*;
006: import java.sql.SQLException;
007:
008: public class CpxCustomerPO
009: extends
010: com.completex.objective.persistency.examples.ex004.domain.Customer
011: implements java.io.Externalizable {
012:
013: public CpxCustomerPO() {
014: }
015:
016: public CpxCustomerPO(Long customerId) {
017: super (customerId);
018: }
019:
020: //
021: // Complex object part:
022: //
023: public static final String CPX_CHILD_CONTACT = "contact";
024: private com.completex.objective.persistency.examples.ex004.domain.Contact contact;
025:
026: protected static final int CPX_INDEX_CONTACT = 0;
027:
028: public boolean complex() {
029: return true;
030: }
031:
032: protected Link[] links(QueryFactory queryFactory) {
033: try {
034: Link[] links = new Link[1];
035: Query query;
036: Link link;
037: query = queryFactory
038: .newQuery((PersistentObject) cpxFactoryContact());
039: link = new ChainedLink(
040: query,
041: new int[] { CpxCustomerPO.ICOL_CONTACT_ID, },
042: new int[] { com.completex.objective.persistency.examples.ex004.domain.Contact.ICOL_CONTACT_ID, },
043: CPX_CHILD_CONTACT);
044: link.setLazyRetrieval(true);
045: link.setCascadeInsert(true);
046: link.setCascadeUpdate(true);
047: link.setCascadeDelete(true);
048: link.setInsertBeforeParent(true);
049: links[CPX_INDEX_CONTACT] = link;
050: return links;
051: } catch (Exception e) {
052: throw new OdalRuntimePersistencyException(e);
053: }
054: }
055:
056: /**
057: *
058: * @return Child factory
059: */
060: protected com.completex.objective.persistency.examples.ex004.domain.Contact cpxFactoryContact() {
061: return new com.completex.objective.persistency.examples.ex004.domain.Contact();
062: }
063:
064: public com.completex.objective.persistency.examples.ex004.domain.Contact getContact() {
065: return (this .contact = (com.completex.objective.persistency.examples.ex004.domain.Contact) getFirstChildObject(
066: CPX_CHILD_CONTACT, this .contact));
067: }
068:
069: public com.completex.objective.persistency.examples.ex004.domain.Contact _getContact() {
070: return (this .contact = (com.completex.objective.persistency.examples.ex004.domain.Contact) getFirstChildObjectStraight(
071: CPX_CHILD_CONTACT, this .contact));
072: }
073:
074: public void setContact(
075: com.completex.objective.persistency.examples.ex004.domain.Contact contact) {
076: this .contact = (com.completex.objective.persistency.examples.ex004.domain.Contact) setChildObjectSafe(
077: CPX_CHILD_CONTACT, contact);
078: }
079:
080: protected void doUnflatten() {
081: unflatten(toLink(), CPX_CHILD_CONTACT,
082: (PersistentObject) contact);
083: }
084:
085: protected void doFlatten() {
086: flatten((PersistentObject) contact);
087: }
088:
089: protected void doPreFlatten() {
090: _getContact();
091: }
092:
093: //
094: // Compound object part:
095: //
096:
097: public boolean compound() {
098: return false;
099: }
100:
101: }
|