0001: package org.tigris.scarab.om;
0002:
0003: import java.math.BigDecimal;
0004: import java.sql.Connection;
0005: import java.util.ArrayList;
0006: import java.util.Collections;
0007: import java.util.Date;
0008: import java.util.List;
0009:
0010: import org.apache.commons.lang.ObjectUtils;
0011: import org.apache.fulcrum.intake.Retrievable;
0012: import org.apache.torque.TorqueException;
0013: import org.apache.torque.om.BaseObject;
0014: import org.apache.torque.om.ComboKey;
0015: import org.apache.torque.om.DateKey;
0016: import org.apache.torque.om.NumberKey;
0017: import org.apache.torque.om.ObjectKey;
0018: import org.apache.torque.om.SimpleKey;
0019: import org.apache.torque.om.StringKey;
0020: import org.apache.torque.om.Persistent;
0021: import org.apache.torque.util.Criteria;
0022: import org.apache.torque.util.Transaction;
0023:
0024: /**
0025: * You should not use this class directly. It should not even be
0026: * extended all references should be to AttributeOption
0027: */
0028: public abstract class BaseAttributeOption extends BaseObject implements
0029: org.apache.fulcrum.intake.Retrievable {
0030: /** The Peer class */
0031: private static final AttributeOptionPeer peer = new AttributeOptionPeer();
0032:
0033: /** The value for the optionId field */
0034: private Integer optionId;
0035:
0036: /** The value for the attributeId field */
0037: private Integer attributeId;
0038:
0039: /** The value for the name field */
0040: private String name;
0041:
0042: /** The value for the deleted field */
0043: private boolean deleted = false;
0044:
0045: /**
0046: * Get the OptionId
0047: *
0048: * @return Integer
0049: */
0050: public Integer getOptionId() {
0051: return optionId;
0052: }
0053:
0054: /**
0055: * Set the value of OptionId
0056: *
0057: * @param v new value
0058: */
0059: public void setOptionId(Integer v) throws TorqueException {
0060:
0061: if (!ObjectUtils.equals(this .optionId, v)) {
0062: this .optionId = v;
0063: setModified(true);
0064: }
0065:
0066: // update associated Activity
0067: if (collActivitysRelatedByOldOptionId != null) {
0068: for (int i = 0; i < collActivitysRelatedByOldOptionId
0069: .size(); i++) {
0070: ((Activity) collActivitysRelatedByOldOptionId.get(i))
0071: .setOldOptionId(v);
0072: }
0073: }
0074:
0075: // update associated Activity
0076: if (collActivitysRelatedByNewOptionId != null) {
0077: for (int i = 0; i < collActivitysRelatedByNewOptionId
0078: .size(); i++) {
0079: ((Activity) collActivitysRelatedByNewOptionId.get(i))
0080: .setNewOptionId(v);
0081: }
0082: }
0083:
0084: // update associated Attribute
0085: if (collAttributes != null) {
0086: for (int i = 0; i < collAttributes.size(); i++) {
0087: ((Attribute) collAttributes.get(i))
0088: .setRequiredOptionId(v);
0089: }
0090: }
0091:
0092: // update associated Condition
0093: if (collConditions != null) {
0094: for (int i = 0; i < collConditions.size(); i++) {
0095: ((Condition) collConditions.get(i)).setOptionId(v);
0096: }
0097: }
0098:
0099: // update associated AttributeValue
0100: if (collAttributeValues != null) {
0101: for (int i = 0; i < collAttributeValues.size(); i++) {
0102: ((AttributeValue) collAttributeValues.get(i))
0103: .setOptionId(v);
0104: }
0105: }
0106:
0107: // update associated RModuleOption
0108: if (collRModuleOptions != null) {
0109: for (int i = 0; i < collRModuleOptions.size(); i++) {
0110: ((RModuleOption) collRModuleOptions.get(i))
0111: .setOptionId(v);
0112: }
0113: }
0114:
0115: // update associated RIssueTypeOption
0116: if (collRIssueTypeOptions != null) {
0117: for (int i = 0; i < collRIssueTypeOptions.size(); i++) {
0118: ((RIssueTypeOption) collRIssueTypeOptions.get(i))
0119: .setOptionId(v);
0120: }
0121: }
0122:
0123: // update associated ROptionOption
0124: if (collROptionOptionsRelatedByOption1Id != null) {
0125: for (int i = 0; i < collROptionOptionsRelatedByOption1Id
0126: .size(); i++) {
0127: ((ROptionOption) collROptionOptionsRelatedByOption1Id
0128: .get(i)).setOption1Id(v);
0129: }
0130: }
0131:
0132: // update associated ROptionOption
0133: if (collROptionOptionsRelatedByOption2Id != null) {
0134: for (int i = 0; i < collROptionOptionsRelatedByOption2Id
0135: .size(); i++) {
0136: ((ROptionOption) collROptionOptionsRelatedByOption2Id
0137: .get(i)).setOption2Id(v);
0138: }
0139: }
0140:
0141: // update associated Transition
0142: if (collTransitionsRelatedByFromOptionId != null) {
0143: for (int i = 0; i < collTransitionsRelatedByFromOptionId
0144: .size(); i++) {
0145: ((Transition) collTransitionsRelatedByFromOptionId
0146: .get(i)).setFromOptionId(v);
0147: }
0148: }
0149:
0150: // update associated Transition
0151: if (collTransitionsRelatedByToOptionId != null) {
0152: for (int i = 0; i < collTransitionsRelatedByToOptionId
0153: .size(); i++) {
0154: ((Transition) collTransitionsRelatedByToOptionId.get(i))
0155: .setToOptionId(v);
0156: }
0157: }
0158: }
0159:
0160: /**
0161: * Get the AttributeId
0162: *
0163: * @return Integer
0164: */
0165: public Integer getAttributeId() {
0166: return attributeId;
0167: }
0168:
0169: /**
0170: * Set the value of AttributeId
0171: *
0172: * @param v new value
0173: */
0174: public void setAttributeId(Integer v) throws TorqueException {
0175:
0176: if (!ObjectUtils.equals(this .attributeId, v)) {
0177: this .attributeId = v;
0178: setModified(true);
0179: }
0180:
0181: if (aAttribute != null
0182: && !ObjectUtils.equals(aAttribute.getAttributeId(), v)) {
0183: aAttribute = null;
0184: }
0185:
0186: }
0187:
0188: /**
0189: * Get the Name
0190: *
0191: * @return String
0192: */
0193: public String getName() {
0194: return name;
0195: }
0196:
0197: /**
0198: * Set the value of Name
0199: *
0200: * @param v new value
0201: */
0202: public void setName(String v) {
0203:
0204: if (!ObjectUtils.equals(this .name, v)) {
0205: this .name = v;
0206: setModified(true);
0207: }
0208:
0209: }
0210:
0211: /**
0212: * Get the Deleted
0213: *
0214: * @return boolean
0215: */
0216: public boolean getDeleted() {
0217: return deleted;
0218: }
0219:
0220: /**
0221: * Set the value of Deleted
0222: *
0223: * @param v new value
0224: */
0225: public void setDeleted(boolean v) {
0226:
0227: if (this .deleted != v) {
0228: this .deleted = v;
0229: setModified(true);
0230: }
0231:
0232: }
0233:
0234: private Attribute aAttribute;
0235:
0236: /**
0237: * Declares an association between this object and a Attribute object
0238: *
0239: * @param v Attribute
0240: * @throws TorqueException
0241: */
0242: public void setAttribute(Attribute v) throws TorqueException {
0243: if (v == null) {
0244: setAttributeId((Integer) null);
0245: } else {
0246: setAttributeId(v.getAttributeId());
0247: }
0248: aAttribute = v;
0249: }
0250:
0251: /**
0252: * Returns the associated Attribute object.
0253: * If it was not retrieved before, the object is retrieved from
0254: * the database
0255: *
0256: * @return the associated Attribute object
0257: * @throws TorqueException
0258: */
0259: public Attribute getAttribute() throws TorqueException {
0260: if (aAttribute == null
0261: && (!ObjectUtils.equals(this .attributeId, null))) {
0262: aAttribute = AttributeManager.getInstance(SimpleKey
0263: .keyFor(this .attributeId));
0264: }
0265: return aAttribute;
0266: }
0267:
0268: /**
0269: * Return the associated Attribute object
0270: * If it was not retrieved before, the object is retrieved from
0271: * the database using the passed connection
0272: *
0273: * @param connection the connection used to retrieve the associated object
0274: * from the database, if it was not retrieved before
0275: * @return the associated Attribute object
0276: * @throws TorqueException
0277: */
0278: public Attribute getAttribute(Connection connection)
0279: throws TorqueException {
0280: if (aAttribute == null
0281: && (!ObjectUtils.equals(this .attributeId, null))) {
0282: aAttribute = AttributeManager.getCachedInstance(SimpleKey
0283: .keyFor(this .attributeId));
0284: if (aAttribute == null) {
0285: aAttribute = AttributePeer.retrieveByPK(SimpleKey
0286: .keyFor(this .attributeId), connection);
0287: AttributeManager.putInstance(aAttribute);
0288: }
0289: }
0290: return aAttribute;
0291: }
0292:
0293: /**
0294: * Provides convenient way to set a relationship based on a
0295: * ObjectKey, for example
0296: * <code>bar.setFooKey(foo.getPrimaryKey())</code>
0297: *
0298: */
0299: public void setAttributeKey(ObjectKey key) throws TorqueException {
0300:
0301: setAttributeId(new Integer(((NumberKey) key).intValue()));
0302: }
0303:
0304: /**
0305: * Collection to store aggregation of collActivitysRelatedByOldOptionId
0306: */
0307: protected List collActivitysRelatedByOldOptionId;
0308:
0309: /**
0310: * Temporary storage of collActivitysRelatedByOldOptionId to save a possible db hit in
0311: * the event objects are add to the collection, but the
0312: * complete collection is never requested.
0313: */
0314: protected void initActivitysRelatedByOldOptionId() {
0315: if (collActivitysRelatedByOldOptionId == null) {
0316: collActivitysRelatedByOldOptionId = new ArrayList();
0317: }
0318: }
0319:
0320: /**
0321: * Method called to associate a Activity object to this object
0322: * through the Activity foreign key attribute
0323: *
0324: * @param l Activity
0325: * @throws TorqueException
0326: */
0327: public void addActivityRelatedByOldOptionId(Activity l)
0328: throws TorqueException {
0329: getActivitysRelatedByOldOptionId().add(l);
0330: l
0331: .setAttributeOptionRelatedByOldOptionId((AttributeOption) this );
0332: }
0333:
0334: /**
0335: * The criteria used to select the current contents of collActivitysRelatedByOldOptionId
0336: */
0337: private Criteria lastActivitysRelatedByOldOptionIdCriteria = null;
0338:
0339: /**
0340: * If this collection has already been initialized, returns
0341: * the collection. Otherwise returns the results of
0342: * getActivitysRelatedByOldOptionId(new Criteria())
0343: *
0344: * @return the collection of associated objects
0345: * @throws TorqueException
0346: */
0347: public List getActivitysRelatedByOldOptionId()
0348: throws TorqueException {
0349: if (collActivitysRelatedByOldOptionId == null) {
0350: collActivitysRelatedByOldOptionId = getActivitysRelatedByOldOptionId(new Criteria(
0351: 10));
0352: }
0353: return collActivitysRelatedByOldOptionId;
0354: }
0355:
0356: /**
0357: * If this collection has already been initialized with
0358: * an identical criteria, it returns the collection.
0359: * Otherwise if this AttributeOption has previously
0360: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0361: * If this AttributeOption is new, it will return
0362: * an empty collection or the current collection, the criteria
0363: * is ignored on a new object.
0364: *
0365: * @throws TorqueException
0366: */
0367: public List getActivitysRelatedByOldOptionId(Criteria criteria)
0368: throws TorqueException {
0369: if (collActivitysRelatedByOldOptionId == null) {
0370: if (isNew()) {
0371: collActivitysRelatedByOldOptionId = new ArrayList();
0372: } else {
0373: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0374: collActivitysRelatedByOldOptionId = ActivityPeer
0375: .doSelect(criteria);
0376: }
0377: } else {
0378: // criteria has no effect for a new object
0379: if (!isNew()) {
0380: // the following code is to determine if a new query is
0381: // called for. If the criteria is the same as the last
0382: // one, just return the collection.
0383: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0384: if (!lastActivitysRelatedByOldOptionIdCriteria
0385: .equals(criteria)) {
0386: collActivitysRelatedByOldOptionId = ActivityPeer
0387: .doSelect(criteria);
0388: }
0389: }
0390: }
0391: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0392:
0393: return collActivitysRelatedByOldOptionId;
0394: }
0395:
0396: /**
0397: * If this collection has already been initialized, returns
0398: * the collection. Otherwise returns the results of
0399: * getActivitysRelatedByOldOptionId(new Criteria(),Connection)
0400: * This method takes in the Connection also as input so that
0401: * referenced objects can also be obtained using a Connection
0402: * that is taken as input
0403: */
0404: public List getActivitysRelatedByOldOptionId(Connection con)
0405: throws TorqueException {
0406: if (collActivitysRelatedByOldOptionId == null) {
0407: collActivitysRelatedByOldOptionId = getActivitysRelatedByOldOptionId(
0408: new Criteria(10), con);
0409: }
0410: return collActivitysRelatedByOldOptionId;
0411: }
0412:
0413: /**
0414: * If this collection has already been initialized with
0415: * an identical criteria, it returns the collection.
0416: * Otherwise if this AttributeOption has previously
0417: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0418: * If this AttributeOption is new, it will return
0419: * an empty collection or the current collection, the criteria
0420: * is ignored on a new object.
0421: * This method takes in the Connection also as input so that
0422: * referenced objects can also be obtained using a Connection
0423: * that is taken as input
0424: */
0425: public List getActivitysRelatedByOldOptionId(Criteria criteria,
0426: Connection con) throws TorqueException {
0427: if (collActivitysRelatedByOldOptionId == null) {
0428: if (isNew()) {
0429: collActivitysRelatedByOldOptionId = new ArrayList();
0430: } else {
0431: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0432: collActivitysRelatedByOldOptionId = ActivityPeer
0433: .doSelect(criteria, con);
0434: }
0435: } else {
0436: // criteria has no effect for a new object
0437: if (!isNew()) {
0438: // the following code is to determine if a new query is
0439: // called for. If the criteria is the same as the last
0440: // one, just return the collection.
0441: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0442: if (!lastActivitysRelatedByOldOptionIdCriteria
0443: .equals(criteria)) {
0444: collActivitysRelatedByOldOptionId = ActivityPeer
0445: .doSelect(criteria, con);
0446: }
0447: }
0448: }
0449: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0450:
0451: return collActivitysRelatedByOldOptionId;
0452: }
0453:
0454: /**
0455: * If this collection has already been initialized with
0456: * an identical criteria, it returns the collection.
0457: * Otherwise if this AttributeOption is new, it will return
0458: * an empty collection; or if this AttributeOption has previously
0459: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0460: *
0461: * This method is protected by default in order to keep the public
0462: * api reasonable. You can provide public methods for those you
0463: * actually need in AttributeOption.
0464: */
0465: protected List getActivitysRelatedByOldOptionIdJoinIssue(
0466: Criteria criteria) throws TorqueException {
0467: if (collActivitysRelatedByOldOptionId == null) {
0468: if (isNew()) {
0469: collActivitysRelatedByOldOptionId = new ArrayList();
0470: } else {
0471: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0472: collActivitysRelatedByOldOptionId = ActivityPeer
0473: .doSelectJoinIssue(criteria);
0474: }
0475: } else {
0476: // the following code is to determine if a new query is
0477: // called for. If the criteria is the same as the last
0478: // one, just return the collection.
0479: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0480: if (!lastActivitysRelatedByOldOptionIdCriteria
0481: .equals(criteria)) {
0482: collActivitysRelatedByOldOptionId = ActivityPeer
0483: .doSelectJoinIssue(criteria);
0484: }
0485: }
0486: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0487:
0488: return collActivitysRelatedByOldOptionId;
0489: }
0490:
0491: /**
0492: * If this collection has already been initialized with
0493: * an identical criteria, it returns the collection.
0494: * Otherwise if this AttributeOption is new, it will return
0495: * an empty collection; or if this AttributeOption has previously
0496: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0497: *
0498: * This method is protected by default in order to keep the public
0499: * api reasonable. You can provide public methods for those you
0500: * actually need in AttributeOption.
0501: */
0502: protected List getActivitysRelatedByOldOptionIdJoinAttribute(
0503: Criteria criteria) throws TorqueException {
0504: if (collActivitysRelatedByOldOptionId == null) {
0505: if (isNew()) {
0506: collActivitysRelatedByOldOptionId = new ArrayList();
0507: } else {
0508: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0509: collActivitysRelatedByOldOptionId = ActivityPeer
0510: .doSelectJoinAttribute(criteria);
0511: }
0512: } else {
0513: // the following code is to determine if a new query is
0514: // called for. If the criteria is the same as the last
0515: // one, just return the collection.
0516: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0517: if (!lastActivitysRelatedByOldOptionIdCriteria
0518: .equals(criteria)) {
0519: collActivitysRelatedByOldOptionId = ActivityPeer
0520: .doSelectJoinAttribute(criteria);
0521: }
0522: }
0523: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0524:
0525: return collActivitysRelatedByOldOptionId;
0526: }
0527:
0528: /**
0529: * If this collection has already been initialized with
0530: * an identical criteria, it returns the collection.
0531: * Otherwise if this AttributeOption is new, it will return
0532: * an empty collection; or if this AttributeOption has previously
0533: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0534: *
0535: * This method is protected by default in order to keep the public
0536: * api reasonable. You can provide public methods for those you
0537: * actually need in AttributeOption.
0538: */
0539: protected List getActivitysRelatedByOldOptionIdJoinActivitySet(
0540: Criteria criteria) throws TorqueException {
0541: if (collActivitysRelatedByOldOptionId == null) {
0542: if (isNew()) {
0543: collActivitysRelatedByOldOptionId = new ArrayList();
0544: } else {
0545: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0546: collActivitysRelatedByOldOptionId = ActivityPeer
0547: .doSelectJoinActivitySet(criteria);
0548: }
0549: } else {
0550: // the following code is to determine if a new query is
0551: // called for. If the criteria is the same as the last
0552: // one, just return the collection.
0553: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0554: if (!lastActivitysRelatedByOldOptionIdCriteria
0555: .equals(criteria)) {
0556: collActivitysRelatedByOldOptionId = ActivityPeer
0557: .doSelectJoinActivitySet(criteria);
0558: }
0559: }
0560: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0561:
0562: return collActivitysRelatedByOldOptionId;
0563: }
0564:
0565: /**
0566: * If this collection has already been initialized with
0567: * an identical criteria, it returns the collection.
0568: * Otherwise if this AttributeOption is new, it will return
0569: * an empty collection; or if this AttributeOption has previously
0570: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0571: *
0572: * This method is protected by default in order to keep the public
0573: * api reasonable. You can provide public methods for those you
0574: * actually need in AttributeOption.
0575: */
0576: protected List getActivitysRelatedByOldOptionIdJoinScarabUserImplRelatedByOldUserId(
0577: Criteria criteria) throws TorqueException {
0578: if (collActivitysRelatedByOldOptionId == null) {
0579: if (isNew()) {
0580: collActivitysRelatedByOldOptionId = new ArrayList();
0581: } else {
0582: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0583: collActivitysRelatedByOldOptionId = ActivityPeer
0584: .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
0585: }
0586: } else {
0587: // the following code is to determine if a new query is
0588: // called for. If the criteria is the same as the last
0589: // one, just return the collection.
0590: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0591: if (!lastActivitysRelatedByOldOptionIdCriteria
0592: .equals(criteria)) {
0593: collActivitysRelatedByOldOptionId = ActivityPeer
0594: .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
0595: }
0596: }
0597: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0598:
0599: return collActivitysRelatedByOldOptionId;
0600: }
0601:
0602: /**
0603: * If this collection has already been initialized with
0604: * an identical criteria, it returns the collection.
0605: * Otherwise if this AttributeOption is new, it will return
0606: * an empty collection; or if this AttributeOption has previously
0607: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0608: *
0609: * This method is protected by default in order to keep the public
0610: * api reasonable. You can provide public methods for those you
0611: * actually need in AttributeOption.
0612: */
0613: protected List getActivitysRelatedByOldOptionIdJoinScarabUserImplRelatedByNewUserId(
0614: Criteria criteria) throws TorqueException {
0615: if (collActivitysRelatedByOldOptionId == null) {
0616: if (isNew()) {
0617: collActivitysRelatedByOldOptionId = new ArrayList();
0618: } else {
0619: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0620: collActivitysRelatedByOldOptionId = ActivityPeer
0621: .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
0622: }
0623: } else {
0624: // the following code is to determine if a new query is
0625: // called for. If the criteria is the same as the last
0626: // one, just return the collection.
0627: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0628: if (!lastActivitysRelatedByOldOptionIdCriteria
0629: .equals(criteria)) {
0630: collActivitysRelatedByOldOptionId = ActivityPeer
0631: .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
0632: }
0633: }
0634: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0635:
0636: return collActivitysRelatedByOldOptionId;
0637: }
0638:
0639: /**
0640: * If this collection has already been initialized with
0641: * an identical criteria, it returns the collection.
0642: * Otherwise if this AttributeOption is new, it will return
0643: * an empty collection; or if this AttributeOption has previously
0644: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0645: *
0646: * This method is protected by default in order to keep the public
0647: * api reasonable. You can provide public methods for those you
0648: * actually need in AttributeOption.
0649: */
0650: protected List getActivitysRelatedByOldOptionIdJoinAttributeOptionRelatedByNewOptionId(
0651: Criteria criteria) throws TorqueException {
0652: if (collActivitysRelatedByOldOptionId == null) {
0653: if (isNew()) {
0654: collActivitysRelatedByOldOptionId = new ArrayList();
0655: } else {
0656: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0657: collActivitysRelatedByOldOptionId = ActivityPeer
0658: .doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
0659: }
0660: } else {
0661: // the following code is to determine if a new query is
0662: // called for. If the criteria is the same as the last
0663: // one, just return the collection.
0664: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0665: if (!lastActivitysRelatedByOldOptionIdCriteria
0666: .equals(criteria)) {
0667: collActivitysRelatedByOldOptionId = ActivityPeer
0668: .doSelectJoinAttributeOptionRelatedByNewOptionId(criteria);
0669: }
0670: }
0671: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0672:
0673: return collActivitysRelatedByOldOptionId;
0674: }
0675:
0676: /**
0677: * If this collection has already been initialized with
0678: * an identical criteria, it returns the collection.
0679: * Otherwise if this AttributeOption is new, it will return
0680: * an empty collection; or if this AttributeOption has previously
0681: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0682: *
0683: * This method is protected by default in order to keep the public
0684: * api reasonable. You can provide public methods for those you
0685: * actually need in AttributeOption.
0686: */
0687: protected List getActivitysRelatedByOldOptionIdJoinAttachment(
0688: Criteria criteria) throws TorqueException {
0689: if (collActivitysRelatedByOldOptionId == null) {
0690: if (isNew()) {
0691: collActivitysRelatedByOldOptionId = new ArrayList();
0692: } else {
0693: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0694: collActivitysRelatedByOldOptionId = ActivityPeer
0695: .doSelectJoinAttachment(criteria);
0696: }
0697: } else {
0698: // the following code is to determine if a new query is
0699: // called for. If the criteria is the same as the last
0700: // one, just return the collection.
0701: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0702: if (!lastActivitysRelatedByOldOptionIdCriteria
0703: .equals(criteria)) {
0704: collActivitysRelatedByOldOptionId = ActivityPeer
0705: .doSelectJoinAttachment(criteria);
0706: }
0707: }
0708: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0709:
0710: return collActivitysRelatedByOldOptionId;
0711: }
0712:
0713: /**
0714: * If this collection has already been initialized with
0715: * an identical criteria, it returns the collection.
0716: * Otherwise if this AttributeOption is new, it will return
0717: * an empty collection; or if this AttributeOption has previously
0718: * been saved, it will retrieve related ActivitysRelatedByOldOptionId from storage.
0719: *
0720: * This method is protected by default in order to keep the public
0721: * api reasonable. You can provide public methods for those you
0722: * actually need in AttributeOption.
0723: */
0724: protected List getActivitysRelatedByOldOptionIdJoinDepend(
0725: Criteria criteria) throws TorqueException {
0726: if (collActivitysRelatedByOldOptionId == null) {
0727: if (isNew()) {
0728: collActivitysRelatedByOldOptionId = new ArrayList();
0729: } else {
0730: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0731: collActivitysRelatedByOldOptionId = ActivityPeer
0732: .doSelectJoinDepend(criteria);
0733: }
0734: } else {
0735: // the following code is to determine if a new query is
0736: // called for. If the criteria is the same as the last
0737: // one, just return the collection.
0738: criteria.add(ActivityPeer.OLD_OPTION_ID, getOptionId());
0739: if (!lastActivitysRelatedByOldOptionIdCriteria
0740: .equals(criteria)) {
0741: collActivitysRelatedByOldOptionId = ActivityPeer
0742: .doSelectJoinDepend(criteria);
0743: }
0744: }
0745: lastActivitysRelatedByOldOptionIdCriteria = criteria;
0746:
0747: return collActivitysRelatedByOldOptionId;
0748: }
0749:
0750: /**
0751: * Collection to store aggregation of collActivitysRelatedByNewOptionId
0752: */
0753: protected List collActivitysRelatedByNewOptionId;
0754:
0755: /**
0756: * Temporary storage of collActivitysRelatedByNewOptionId to save a possible db hit in
0757: * the event objects are add to the collection, but the
0758: * complete collection is never requested.
0759: */
0760: protected void initActivitysRelatedByNewOptionId() {
0761: if (collActivitysRelatedByNewOptionId == null) {
0762: collActivitysRelatedByNewOptionId = new ArrayList();
0763: }
0764: }
0765:
0766: /**
0767: * Method called to associate a Activity object to this object
0768: * through the Activity foreign key attribute
0769: *
0770: * @param l Activity
0771: * @throws TorqueException
0772: */
0773: public void addActivityRelatedByNewOptionId(Activity l)
0774: throws TorqueException {
0775: getActivitysRelatedByNewOptionId().add(l);
0776: l
0777: .setAttributeOptionRelatedByNewOptionId((AttributeOption) this );
0778: }
0779:
0780: /**
0781: * The criteria used to select the current contents of collActivitysRelatedByNewOptionId
0782: */
0783: private Criteria lastActivitysRelatedByNewOptionIdCriteria = null;
0784:
0785: /**
0786: * If this collection has already been initialized, returns
0787: * the collection. Otherwise returns the results of
0788: * getActivitysRelatedByNewOptionId(new Criteria())
0789: *
0790: * @return the collection of associated objects
0791: * @throws TorqueException
0792: */
0793: public List getActivitysRelatedByNewOptionId()
0794: throws TorqueException {
0795: if (collActivitysRelatedByNewOptionId == null) {
0796: collActivitysRelatedByNewOptionId = getActivitysRelatedByNewOptionId(new Criteria(
0797: 10));
0798: }
0799: return collActivitysRelatedByNewOptionId;
0800: }
0801:
0802: /**
0803: * If this collection has already been initialized with
0804: * an identical criteria, it returns the collection.
0805: * Otherwise if this AttributeOption has previously
0806: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
0807: * If this AttributeOption is new, it will return
0808: * an empty collection or the current collection, the criteria
0809: * is ignored on a new object.
0810: *
0811: * @throws TorqueException
0812: */
0813: public List getActivitysRelatedByNewOptionId(Criteria criteria)
0814: throws TorqueException {
0815: if (collActivitysRelatedByNewOptionId == null) {
0816: if (isNew()) {
0817: collActivitysRelatedByNewOptionId = new ArrayList();
0818: } else {
0819: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0820: collActivitysRelatedByNewOptionId = ActivityPeer
0821: .doSelect(criteria);
0822: }
0823: } else {
0824: // criteria has no effect for a new object
0825: if (!isNew()) {
0826: // the following code is to determine if a new query is
0827: // called for. If the criteria is the same as the last
0828: // one, just return the collection.
0829: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0830: if (!lastActivitysRelatedByNewOptionIdCriteria
0831: .equals(criteria)) {
0832: collActivitysRelatedByNewOptionId = ActivityPeer
0833: .doSelect(criteria);
0834: }
0835: }
0836: }
0837: lastActivitysRelatedByNewOptionIdCriteria = criteria;
0838:
0839: return collActivitysRelatedByNewOptionId;
0840: }
0841:
0842: /**
0843: * If this collection has already been initialized, returns
0844: * the collection. Otherwise returns the results of
0845: * getActivitysRelatedByNewOptionId(new Criteria(),Connection)
0846: * This method takes in the Connection also as input so that
0847: * referenced objects can also be obtained using a Connection
0848: * that is taken as input
0849: */
0850: public List getActivitysRelatedByNewOptionId(Connection con)
0851: throws TorqueException {
0852: if (collActivitysRelatedByNewOptionId == null) {
0853: collActivitysRelatedByNewOptionId = getActivitysRelatedByNewOptionId(
0854: new Criteria(10), con);
0855: }
0856: return collActivitysRelatedByNewOptionId;
0857: }
0858:
0859: /**
0860: * If this collection has already been initialized with
0861: * an identical criteria, it returns the collection.
0862: * Otherwise if this AttributeOption has previously
0863: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
0864: * If this AttributeOption is new, it will return
0865: * an empty collection or the current collection, the criteria
0866: * is ignored on a new object.
0867: * This method takes in the Connection also as input so that
0868: * referenced objects can also be obtained using a Connection
0869: * that is taken as input
0870: */
0871: public List getActivitysRelatedByNewOptionId(Criteria criteria,
0872: Connection con) throws TorqueException {
0873: if (collActivitysRelatedByNewOptionId == null) {
0874: if (isNew()) {
0875: collActivitysRelatedByNewOptionId = new ArrayList();
0876: } else {
0877: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0878: collActivitysRelatedByNewOptionId = ActivityPeer
0879: .doSelect(criteria, con);
0880: }
0881: } else {
0882: // criteria has no effect for a new object
0883: if (!isNew()) {
0884: // the following code is to determine if a new query is
0885: // called for. If the criteria is the same as the last
0886: // one, just return the collection.
0887: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0888: if (!lastActivitysRelatedByNewOptionIdCriteria
0889: .equals(criteria)) {
0890: collActivitysRelatedByNewOptionId = ActivityPeer
0891: .doSelect(criteria, con);
0892: }
0893: }
0894: }
0895: lastActivitysRelatedByNewOptionIdCriteria = criteria;
0896:
0897: return collActivitysRelatedByNewOptionId;
0898: }
0899:
0900: /**
0901: * If this collection has already been initialized with
0902: * an identical criteria, it returns the collection.
0903: * Otherwise if this AttributeOption is new, it will return
0904: * an empty collection; or if this AttributeOption has previously
0905: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
0906: *
0907: * This method is protected by default in order to keep the public
0908: * api reasonable. You can provide public methods for those you
0909: * actually need in AttributeOption.
0910: */
0911: protected List getActivitysRelatedByNewOptionIdJoinIssue(
0912: Criteria criteria) throws TorqueException {
0913: if (collActivitysRelatedByNewOptionId == null) {
0914: if (isNew()) {
0915: collActivitysRelatedByNewOptionId = new ArrayList();
0916: } else {
0917: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0918: collActivitysRelatedByNewOptionId = ActivityPeer
0919: .doSelectJoinIssue(criteria);
0920: }
0921: } else {
0922: // the following code is to determine if a new query is
0923: // called for. If the criteria is the same as the last
0924: // one, just return the collection.
0925: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0926: if (!lastActivitysRelatedByNewOptionIdCriteria
0927: .equals(criteria)) {
0928: collActivitysRelatedByNewOptionId = ActivityPeer
0929: .doSelectJoinIssue(criteria);
0930: }
0931: }
0932: lastActivitysRelatedByNewOptionIdCriteria = criteria;
0933:
0934: return collActivitysRelatedByNewOptionId;
0935: }
0936:
0937: /**
0938: * If this collection has already been initialized with
0939: * an identical criteria, it returns the collection.
0940: * Otherwise if this AttributeOption is new, it will return
0941: * an empty collection; or if this AttributeOption has previously
0942: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
0943: *
0944: * This method is protected by default in order to keep the public
0945: * api reasonable. You can provide public methods for those you
0946: * actually need in AttributeOption.
0947: */
0948: protected List getActivitysRelatedByNewOptionIdJoinAttribute(
0949: Criteria criteria) throws TorqueException {
0950: if (collActivitysRelatedByNewOptionId == null) {
0951: if (isNew()) {
0952: collActivitysRelatedByNewOptionId = new ArrayList();
0953: } else {
0954: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0955: collActivitysRelatedByNewOptionId = ActivityPeer
0956: .doSelectJoinAttribute(criteria);
0957: }
0958: } else {
0959: // the following code is to determine if a new query is
0960: // called for. If the criteria is the same as the last
0961: // one, just return the collection.
0962: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0963: if (!lastActivitysRelatedByNewOptionIdCriteria
0964: .equals(criteria)) {
0965: collActivitysRelatedByNewOptionId = ActivityPeer
0966: .doSelectJoinAttribute(criteria);
0967: }
0968: }
0969: lastActivitysRelatedByNewOptionIdCriteria = criteria;
0970:
0971: return collActivitysRelatedByNewOptionId;
0972: }
0973:
0974: /**
0975: * If this collection has already been initialized with
0976: * an identical criteria, it returns the collection.
0977: * Otherwise if this AttributeOption is new, it will return
0978: * an empty collection; or if this AttributeOption has previously
0979: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
0980: *
0981: * This method is protected by default in order to keep the public
0982: * api reasonable. You can provide public methods for those you
0983: * actually need in AttributeOption.
0984: */
0985: protected List getActivitysRelatedByNewOptionIdJoinActivitySet(
0986: Criteria criteria) throws TorqueException {
0987: if (collActivitysRelatedByNewOptionId == null) {
0988: if (isNew()) {
0989: collActivitysRelatedByNewOptionId = new ArrayList();
0990: } else {
0991: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
0992: collActivitysRelatedByNewOptionId = ActivityPeer
0993: .doSelectJoinActivitySet(criteria);
0994: }
0995: } else {
0996: // the following code is to determine if a new query is
0997: // called for. If the criteria is the same as the last
0998: // one, just return the collection.
0999: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1000: if (!lastActivitysRelatedByNewOptionIdCriteria
1001: .equals(criteria)) {
1002: collActivitysRelatedByNewOptionId = ActivityPeer
1003: .doSelectJoinActivitySet(criteria);
1004: }
1005: }
1006: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1007:
1008: return collActivitysRelatedByNewOptionId;
1009: }
1010:
1011: /**
1012: * If this collection has already been initialized with
1013: * an identical criteria, it returns the collection.
1014: * Otherwise if this AttributeOption is new, it will return
1015: * an empty collection; or if this AttributeOption has previously
1016: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
1017: *
1018: * This method is protected by default in order to keep the public
1019: * api reasonable. You can provide public methods for those you
1020: * actually need in AttributeOption.
1021: */
1022: protected List getActivitysRelatedByNewOptionIdJoinScarabUserImplRelatedByOldUserId(
1023: Criteria criteria) throws TorqueException {
1024: if (collActivitysRelatedByNewOptionId == null) {
1025: if (isNew()) {
1026: collActivitysRelatedByNewOptionId = new ArrayList();
1027: } else {
1028: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1029: collActivitysRelatedByNewOptionId = ActivityPeer
1030: .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
1031: }
1032: } else {
1033: // the following code is to determine if a new query is
1034: // called for. If the criteria is the same as the last
1035: // one, just return the collection.
1036: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1037: if (!lastActivitysRelatedByNewOptionIdCriteria
1038: .equals(criteria)) {
1039: collActivitysRelatedByNewOptionId = ActivityPeer
1040: .doSelectJoinScarabUserImplRelatedByOldUserId(criteria);
1041: }
1042: }
1043: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1044:
1045: return collActivitysRelatedByNewOptionId;
1046: }
1047:
1048: /**
1049: * If this collection has already been initialized with
1050: * an identical criteria, it returns the collection.
1051: * Otherwise if this AttributeOption is new, it will return
1052: * an empty collection; or if this AttributeOption has previously
1053: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
1054: *
1055: * This method is protected by default in order to keep the public
1056: * api reasonable. You can provide public methods for those you
1057: * actually need in AttributeOption.
1058: */
1059: protected List getActivitysRelatedByNewOptionIdJoinScarabUserImplRelatedByNewUserId(
1060: Criteria criteria) throws TorqueException {
1061: if (collActivitysRelatedByNewOptionId == null) {
1062: if (isNew()) {
1063: collActivitysRelatedByNewOptionId = new ArrayList();
1064: } else {
1065: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1066: collActivitysRelatedByNewOptionId = ActivityPeer
1067: .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
1068: }
1069: } else {
1070: // the following code is to determine if a new query is
1071: // called for. If the criteria is the same as the last
1072: // one, just return the collection.
1073: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1074: if (!lastActivitysRelatedByNewOptionIdCriteria
1075: .equals(criteria)) {
1076: collActivitysRelatedByNewOptionId = ActivityPeer
1077: .doSelectJoinScarabUserImplRelatedByNewUserId(criteria);
1078: }
1079: }
1080: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1081:
1082: return collActivitysRelatedByNewOptionId;
1083: }
1084:
1085: /**
1086: * If this collection has already been initialized with
1087: * an identical criteria, it returns the collection.
1088: * Otherwise if this AttributeOption is new, it will return
1089: * an empty collection; or if this AttributeOption has previously
1090: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
1091: *
1092: * This method is protected by default in order to keep the public
1093: * api reasonable. You can provide public methods for those you
1094: * actually need in AttributeOption.
1095: */
1096: protected List getActivitysRelatedByNewOptionIdJoinAttributeOptionRelatedByOldOptionId(
1097: Criteria criteria) throws TorqueException {
1098: if (collActivitysRelatedByNewOptionId == null) {
1099: if (isNew()) {
1100: collActivitysRelatedByNewOptionId = new ArrayList();
1101: } else {
1102: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1103: collActivitysRelatedByNewOptionId = ActivityPeer
1104: .doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
1105: }
1106: } else {
1107: // the following code is to determine if a new query is
1108: // called for. If the criteria is the same as the last
1109: // one, just return the collection.
1110: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1111: if (!lastActivitysRelatedByNewOptionIdCriteria
1112: .equals(criteria)) {
1113: collActivitysRelatedByNewOptionId = ActivityPeer
1114: .doSelectJoinAttributeOptionRelatedByOldOptionId(criteria);
1115: }
1116: }
1117: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1118:
1119: return collActivitysRelatedByNewOptionId;
1120: }
1121:
1122: /**
1123: * If this collection has already been initialized with
1124: * an identical criteria, it returns the collection.
1125: * Otherwise if this AttributeOption is new, it will return
1126: * an empty collection; or if this AttributeOption has previously
1127: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
1128: *
1129: * This method is protected by default in order to keep the public
1130: * api reasonable. You can provide public methods for those you
1131: * actually need in AttributeOption.
1132: */
1133: protected List getActivitysRelatedByNewOptionIdJoinAttachment(
1134: Criteria criteria) throws TorqueException {
1135: if (collActivitysRelatedByNewOptionId == null) {
1136: if (isNew()) {
1137: collActivitysRelatedByNewOptionId = new ArrayList();
1138: } else {
1139: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1140: collActivitysRelatedByNewOptionId = ActivityPeer
1141: .doSelectJoinAttachment(criteria);
1142: }
1143: } else {
1144: // the following code is to determine if a new query is
1145: // called for. If the criteria is the same as the last
1146: // one, just return the collection.
1147: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1148: if (!lastActivitysRelatedByNewOptionIdCriteria
1149: .equals(criteria)) {
1150: collActivitysRelatedByNewOptionId = ActivityPeer
1151: .doSelectJoinAttachment(criteria);
1152: }
1153: }
1154: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1155:
1156: return collActivitysRelatedByNewOptionId;
1157: }
1158:
1159: /**
1160: * If this collection has already been initialized with
1161: * an identical criteria, it returns the collection.
1162: * Otherwise if this AttributeOption is new, it will return
1163: * an empty collection; or if this AttributeOption has previously
1164: * been saved, it will retrieve related ActivitysRelatedByNewOptionId from storage.
1165: *
1166: * This method is protected by default in order to keep the public
1167: * api reasonable. You can provide public methods for those you
1168: * actually need in AttributeOption.
1169: */
1170: protected List getActivitysRelatedByNewOptionIdJoinDepend(
1171: Criteria criteria) throws TorqueException {
1172: if (collActivitysRelatedByNewOptionId == null) {
1173: if (isNew()) {
1174: collActivitysRelatedByNewOptionId = new ArrayList();
1175: } else {
1176: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1177: collActivitysRelatedByNewOptionId = ActivityPeer
1178: .doSelectJoinDepend(criteria);
1179: }
1180: } else {
1181: // the following code is to determine if a new query is
1182: // called for. If the criteria is the same as the last
1183: // one, just return the collection.
1184: criteria.add(ActivityPeer.NEW_OPTION_ID, getOptionId());
1185: if (!lastActivitysRelatedByNewOptionIdCriteria
1186: .equals(criteria)) {
1187: collActivitysRelatedByNewOptionId = ActivityPeer
1188: .doSelectJoinDepend(criteria);
1189: }
1190: }
1191: lastActivitysRelatedByNewOptionIdCriteria = criteria;
1192:
1193: return collActivitysRelatedByNewOptionId;
1194: }
1195:
1196: /**
1197: * Collection to store aggregation of collAttributes
1198: */
1199: protected List collAttributes;
1200:
1201: /**
1202: * Temporary storage of collAttributes to save a possible db hit in
1203: * the event objects are add to the collection, but the
1204: * complete collection is never requested.
1205: */
1206: protected void initAttributes() {
1207: if (collAttributes == null) {
1208: collAttributes = new ArrayList();
1209: }
1210: }
1211:
1212: /**
1213: * Method called to associate a Attribute object to this object
1214: * through the Attribute foreign key attribute
1215: *
1216: * @param l Attribute
1217: * @throws TorqueException
1218: */
1219: public void addAttribute(Attribute l) throws TorqueException {
1220: getAttributes().add(l);
1221: l.setAttributeOption((AttributeOption) this );
1222: }
1223:
1224: /**
1225: * The criteria used to select the current contents of collAttributes
1226: */
1227: private Criteria lastAttributesCriteria = null;
1228:
1229: /**
1230: * If this collection has already been initialized, returns
1231: * the collection. Otherwise returns the results of
1232: * getAttributes(new Criteria())
1233: *
1234: * @return the collection of associated objects
1235: * @throws TorqueException
1236: */
1237: public List getAttributes() throws TorqueException {
1238: if (collAttributes == null) {
1239: collAttributes = getAttributes(new Criteria(10));
1240: }
1241: return collAttributes;
1242: }
1243:
1244: /**
1245: * If this collection has already been initialized with
1246: * an identical criteria, it returns the collection.
1247: * Otherwise if this AttributeOption has previously
1248: * been saved, it will retrieve related Attributes from storage.
1249: * If this AttributeOption is new, it will return
1250: * an empty collection or the current collection, the criteria
1251: * is ignored on a new object.
1252: *
1253: * @throws TorqueException
1254: */
1255: public List getAttributes(Criteria criteria) throws TorqueException {
1256: if (collAttributes == null) {
1257: if (isNew()) {
1258: collAttributes = new ArrayList();
1259: } else {
1260: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1261: getOptionId());
1262: collAttributes = AttributePeer.doSelect(criteria);
1263: }
1264: } else {
1265: // criteria has no effect for a new object
1266: if (!isNew()) {
1267: // the following code is to determine if a new query is
1268: // called for. If the criteria is the same as the last
1269: // one, just return the collection.
1270: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1271: getOptionId());
1272: if (!lastAttributesCriteria.equals(criteria)) {
1273: collAttributes = AttributePeer.doSelect(criteria);
1274: }
1275: }
1276: }
1277: lastAttributesCriteria = criteria;
1278:
1279: return collAttributes;
1280: }
1281:
1282: /**
1283: * If this collection has already been initialized, returns
1284: * the collection. Otherwise returns the results of
1285: * getAttributes(new Criteria(),Connection)
1286: * This method takes in the Connection also as input so that
1287: * referenced objects can also be obtained using a Connection
1288: * that is taken as input
1289: */
1290: public List getAttributes(Connection con) throws TorqueException {
1291: if (collAttributes == null) {
1292: collAttributes = getAttributes(new Criteria(10), con);
1293: }
1294: return collAttributes;
1295: }
1296:
1297: /**
1298: * If this collection has already been initialized with
1299: * an identical criteria, it returns the collection.
1300: * Otherwise if this AttributeOption has previously
1301: * been saved, it will retrieve related Attributes from storage.
1302: * If this AttributeOption is new, it will return
1303: * an empty collection or the current collection, the criteria
1304: * is ignored on a new object.
1305: * This method takes in the Connection also as input so that
1306: * referenced objects can also be obtained using a Connection
1307: * that is taken as input
1308: */
1309: public List getAttributes(Criteria criteria, Connection con)
1310: throws TorqueException {
1311: if (collAttributes == null) {
1312: if (isNew()) {
1313: collAttributes = new ArrayList();
1314: } else {
1315: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1316: getOptionId());
1317: collAttributes = AttributePeer.doSelect(criteria, con);
1318: }
1319: } else {
1320: // criteria has no effect for a new object
1321: if (!isNew()) {
1322: // the following code is to determine if a new query is
1323: // called for. If the criteria is the same as the last
1324: // one, just return the collection.
1325: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1326: getOptionId());
1327: if (!lastAttributesCriteria.equals(criteria)) {
1328: collAttributes = AttributePeer.doSelect(criteria,
1329: con);
1330: }
1331: }
1332: }
1333: lastAttributesCriteria = criteria;
1334:
1335: return collAttributes;
1336: }
1337:
1338: /**
1339: * If this collection has already been initialized with
1340: * an identical criteria, it returns the collection.
1341: * Otherwise if this AttributeOption is new, it will return
1342: * an empty collection; or if this AttributeOption has previously
1343: * been saved, it will retrieve related Attributes from storage.
1344: *
1345: * This method is protected by default in order to keep the public
1346: * api reasonable. You can provide public methods for those you
1347: * actually need in AttributeOption.
1348: */
1349: protected List getAttributesJoinAttributeType(Criteria criteria)
1350: throws TorqueException {
1351: if (collAttributes == null) {
1352: if (isNew()) {
1353: collAttributes = new ArrayList();
1354: } else {
1355: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1356: getOptionId());
1357: collAttributes = AttributePeer
1358: .doSelectJoinAttributeType(criteria);
1359: }
1360: } else {
1361: // the following code is to determine if a new query is
1362: // called for. If the criteria is the same as the last
1363: // one, just return the collection.
1364: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1365: getOptionId());
1366: if (!lastAttributesCriteria.equals(criteria)) {
1367: collAttributes = AttributePeer
1368: .doSelectJoinAttributeType(criteria);
1369: }
1370: }
1371: lastAttributesCriteria = criteria;
1372:
1373: return collAttributes;
1374: }
1375:
1376: /**
1377: * If this collection has already been initialized with
1378: * an identical criteria, it returns the collection.
1379: * Otherwise if this AttributeOption is new, it will return
1380: * an empty collection; or if this AttributeOption has previously
1381: * been saved, it will retrieve related Attributes from storage.
1382: *
1383: * This method is protected by default in order to keep the public
1384: * api reasonable. You can provide public methods for those you
1385: * actually need in AttributeOption.
1386: */
1387: protected List getAttributesJoinAttributeOption(Criteria criteria)
1388: throws TorqueException {
1389: if (collAttributes == null) {
1390: if (isNew()) {
1391: collAttributes = new ArrayList();
1392: } else {
1393: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1394: getOptionId());
1395: collAttributes = AttributePeer
1396: .doSelectJoinAttributeOption(criteria);
1397: }
1398: } else {
1399: // the following code is to determine if a new query is
1400: // called for. If the criteria is the same as the last
1401: // one, just return the collection.
1402: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1403: getOptionId());
1404: if (!lastAttributesCriteria.equals(criteria)) {
1405: collAttributes = AttributePeer
1406: .doSelectJoinAttributeOption(criteria);
1407: }
1408: }
1409: lastAttributesCriteria = criteria;
1410:
1411: return collAttributes;
1412: }
1413:
1414: /**
1415: * If this collection has already been initialized with
1416: * an identical criteria, it returns the collection.
1417: * Otherwise if this AttributeOption is new, it will return
1418: * an empty collection; or if this AttributeOption has previously
1419: * been saved, it will retrieve related Attributes from storage.
1420: *
1421: * This method is protected by default in order to keep the public
1422: * api reasonable. You can provide public methods for those you
1423: * actually need in AttributeOption.
1424: */
1425: protected List getAttributesJoinScarabUserImpl(Criteria criteria)
1426: throws TorqueException {
1427: if (collAttributes == null) {
1428: if (isNew()) {
1429: collAttributes = new ArrayList();
1430: } else {
1431: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1432: getOptionId());
1433: collAttributes = AttributePeer
1434: .doSelectJoinScarabUserImpl(criteria);
1435: }
1436: } else {
1437: // the following code is to determine if a new query is
1438: // called for. If the criteria is the same as the last
1439: // one, just return the collection.
1440: criteria.add(AttributePeer.REQUIRED_OPTION_ID,
1441: getOptionId());
1442: if (!lastAttributesCriteria.equals(criteria)) {
1443: collAttributes = AttributePeer
1444: .doSelectJoinScarabUserImpl(criteria);
1445: }
1446: }
1447: lastAttributesCriteria = criteria;
1448:
1449: return collAttributes;
1450: }
1451:
1452: /**
1453: * Collection to store aggregation of collConditions
1454: */
1455: protected List collConditions;
1456:
1457: /**
1458: * Temporary storage of collConditions to save a possible db hit in
1459: * the event objects are add to the collection, but the
1460: * complete collection is never requested.
1461: */
1462: protected void initConditions() {
1463: if (collConditions == null) {
1464: collConditions = new ArrayList();
1465: }
1466: }
1467:
1468: /**
1469: * Method called to associate a Condition object to this object
1470: * through the Condition foreign key attribute
1471: *
1472: * @param l Condition
1473: * @throws TorqueException
1474: */
1475: public void addCondition(Condition l) throws TorqueException {
1476: getConditions().add(l);
1477: l.setAttributeOption((AttributeOption) this );
1478: }
1479:
1480: /**
1481: * The criteria used to select the current contents of collConditions
1482: */
1483: private Criteria lastConditionsCriteria = null;
1484:
1485: /**
1486: * If this collection has already been initialized, returns
1487: * the collection. Otherwise returns the results of
1488: * getConditions(new Criteria())
1489: *
1490: * @return the collection of associated objects
1491: * @throws TorqueException
1492: */
1493: public List getConditions() throws TorqueException {
1494: if (collConditions == null) {
1495: collConditions = getConditions(new Criteria(10));
1496: }
1497: return collConditions;
1498: }
1499:
1500: /**
1501: * If this collection has already been initialized with
1502: * an identical criteria, it returns the collection.
1503: * Otherwise if this AttributeOption has previously
1504: * been saved, it will retrieve related Conditions from storage.
1505: * If this AttributeOption is new, it will return
1506: * an empty collection or the current collection, the criteria
1507: * is ignored on a new object.
1508: *
1509: * @throws TorqueException
1510: */
1511: public List getConditions(Criteria criteria) throws TorqueException {
1512: if (collConditions == null) {
1513: if (isNew()) {
1514: collConditions = new ArrayList();
1515: } else {
1516: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1517: collConditions = ConditionPeer.doSelect(criteria);
1518: }
1519: } else {
1520: // criteria has no effect for a new object
1521: if (!isNew()) {
1522: // the following code is to determine if a new query is
1523: // called for. If the criteria is the same as the last
1524: // one, just return the collection.
1525: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1526: if (!lastConditionsCriteria.equals(criteria)) {
1527: collConditions = ConditionPeer.doSelect(criteria);
1528: }
1529: }
1530: }
1531: lastConditionsCriteria = criteria;
1532:
1533: return collConditions;
1534: }
1535:
1536: /**
1537: * If this collection has already been initialized, returns
1538: * the collection. Otherwise returns the results of
1539: * getConditions(new Criteria(),Connection)
1540: * This method takes in the Connection also as input so that
1541: * referenced objects can also be obtained using a Connection
1542: * that is taken as input
1543: */
1544: public List getConditions(Connection con) throws TorqueException {
1545: if (collConditions == null) {
1546: collConditions = getConditions(new Criteria(10), con);
1547: }
1548: return collConditions;
1549: }
1550:
1551: /**
1552: * If this collection has already been initialized with
1553: * an identical criteria, it returns the collection.
1554: * Otherwise if this AttributeOption has previously
1555: * been saved, it will retrieve related Conditions from storage.
1556: * If this AttributeOption is new, it will return
1557: * an empty collection or the current collection, the criteria
1558: * is ignored on a new object.
1559: * This method takes in the Connection also as input so that
1560: * referenced objects can also be obtained using a Connection
1561: * that is taken as input
1562: */
1563: public List getConditions(Criteria criteria, Connection con)
1564: throws TorqueException {
1565: if (collConditions == null) {
1566: if (isNew()) {
1567: collConditions = new ArrayList();
1568: } else {
1569: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1570: collConditions = ConditionPeer.doSelect(criteria, con);
1571: }
1572: } else {
1573: // criteria has no effect for a new object
1574: if (!isNew()) {
1575: // the following code is to determine if a new query is
1576: // called for. If the criteria is the same as the last
1577: // one, just return the collection.
1578: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1579: if (!lastConditionsCriteria.equals(criteria)) {
1580: collConditions = ConditionPeer.doSelect(criteria,
1581: con);
1582: }
1583: }
1584: }
1585: lastConditionsCriteria = criteria;
1586:
1587: return collConditions;
1588: }
1589:
1590: /**
1591: * If this collection has already been initialized with
1592: * an identical criteria, it returns the collection.
1593: * Otherwise if this AttributeOption is new, it will return
1594: * an empty collection; or if this AttributeOption has previously
1595: * been saved, it will retrieve related Conditions from storage.
1596: *
1597: * This method is protected by default in order to keep the public
1598: * api reasonable. You can provide public methods for those you
1599: * actually need in AttributeOption.
1600: */
1601: protected List getConditionsJoinRModuleAttribute(Criteria criteria)
1602: throws TorqueException {
1603: if (collConditions == null) {
1604: if (isNew()) {
1605: collConditions = new ArrayList();
1606: } else {
1607: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1608: collConditions = ConditionPeer
1609: .doSelectJoinRModuleAttribute(criteria);
1610: }
1611: } else {
1612: // the following code is to determine if a new query is
1613: // called for. If the criteria is the same as the last
1614: // one, just return the collection.
1615: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1616: if (!lastConditionsCriteria.equals(criteria)) {
1617: collConditions = ConditionPeer
1618: .doSelectJoinRModuleAttribute(criteria);
1619: }
1620: }
1621: lastConditionsCriteria = criteria;
1622:
1623: return collConditions;
1624: }
1625:
1626: /**
1627: * If this collection has already been initialized with
1628: * an identical criteria, it returns the collection.
1629: * Otherwise if this AttributeOption is new, it will return
1630: * an empty collection; or if this AttributeOption has previously
1631: * been saved, it will retrieve related Conditions from storage.
1632: *
1633: * This method is protected by default in order to keep the public
1634: * api reasonable. You can provide public methods for those you
1635: * actually need in AttributeOption.
1636: */
1637: protected List getConditionsJoinTransition(Criteria criteria)
1638: throws TorqueException {
1639: if (collConditions == null) {
1640: if (isNew()) {
1641: collConditions = new ArrayList();
1642: } else {
1643: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1644: collConditions = ConditionPeer
1645: .doSelectJoinTransition(criteria);
1646: }
1647: } else {
1648: // the following code is to determine if a new query is
1649: // called for. If the criteria is the same as the last
1650: // one, just return the collection.
1651: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1652: if (!lastConditionsCriteria.equals(criteria)) {
1653: collConditions = ConditionPeer
1654: .doSelectJoinTransition(criteria);
1655: }
1656: }
1657: lastConditionsCriteria = criteria;
1658:
1659: return collConditions;
1660: }
1661:
1662: /**
1663: * If this collection has already been initialized with
1664: * an identical criteria, it returns the collection.
1665: * Otherwise if this AttributeOption is new, it will return
1666: * an empty collection; or if this AttributeOption has previously
1667: * been saved, it will retrieve related Conditions from storage.
1668: *
1669: * This method is protected by default in order to keep the public
1670: * api reasonable. You can provide public methods for those you
1671: * actually need in AttributeOption.
1672: */
1673: protected List getConditionsJoinAttribute(Criteria criteria)
1674: throws TorqueException {
1675: if (collConditions == null) {
1676: if (isNew()) {
1677: collConditions = new ArrayList();
1678: } else {
1679: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1680: collConditions = ConditionPeer
1681: .doSelectJoinAttribute(criteria);
1682: }
1683: } else {
1684: // the following code is to determine if a new query is
1685: // called for. If the criteria is the same as the last
1686: // one, just return the collection.
1687: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1688: if (!lastConditionsCriteria.equals(criteria)) {
1689: collConditions = ConditionPeer
1690: .doSelectJoinAttribute(criteria);
1691: }
1692: }
1693: lastConditionsCriteria = criteria;
1694:
1695: return collConditions;
1696: }
1697:
1698: /**
1699: * If this collection has already been initialized with
1700: * an identical criteria, it returns the collection.
1701: * Otherwise if this AttributeOption is new, it will return
1702: * an empty collection; or if this AttributeOption has previously
1703: * been saved, it will retrieve related Conditions from storage.
1704: *
1705: * This method is protected by default in order to keep the public
1706: * api reasonable. You can provide public methods for those you
1707: * actually need in AttributeOption.
1708: */
1709: protected List getConditionsJoinAttributeOption(Criteria criteria)
1710: throws TorqueException {
1711: if (collConditions == null) {
1712: if (isNew()) {
1713: collConditions = new ArrayList();
1714: } else {
1715: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1716: collConditions = ConditionPeer
1717: .doSelectJoinAttributeOption(criteria);
1718: }
1719: } else {
1720: // the following code is to determine if a new query is
1721: // called for. If the criteria is the same as the last
1722: // one, just return the collection.
1723: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1724: if (!lastConditionsCriteria.equals(criteria)) {
1725: collConditions = ConditionPeer
1726: .doSelectJoinAttributeOption(criteria);
1727: }
1728: }
1729: lastConditionsCriteria = criteria;
1730:
1731: return collConditions;
1732: }
1733:
1734: /**
1735: * If this collection has already been initialized with
1736: * an identical criteria, it returns the collection.
1737: * Otherwise if this AttributeOption is new, it will return
1738: * an empty collection; or if this AttributeOption has previously
1739: * been saved, it will retrieve related Conditions from storage.
1740: *
1741: * This method is protected by default in order to keep the public
1742: * api reasonable. You can provide public methods for those you
1743: * actually need in AttributeOption.
1744: */
1745: protected List getConditionsJoinRModuleIssueType(Criteria criteria)
1746: throws TorqueException {
1747: if (collConditions == null) {
1748: if (isNew()) {
1749: collConditions = new ArrayList();
1750: } else {
1751: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1752: collConditions = ConditionPeer
1753: .doSelectJoinRModuleIssueType(criteria);
1754: }
1755: } else {
1756: // the following code is to determine if a new query is
1757: // called for. If the criteria is the same as the last
1758: // one, just return the collection.
1759: criteria.add(ConditionPeer.OPTION_ID, getOptionId());
1760: if (!lastConditionsCriteria.equals(criteria)) {
1761: collConditions = ConditionPeer
1762: .doSelectJoinRModuleIssueType(criteria);
1763: }
1764: }
1765: lastConditionsCriteria = criteria;
1766:
1767: return collConditions;
1768: }
1769:
1770: /**
1771: * Collection to store aggregation of collAttributeValues
1772: */
1773: protected List collAttributeValues;
1774:
1775: /**
1776: * Temporary storage of collAttributeValues to save a possible db hit in
1777: * the event objects are add to the collection, but the
1778: * complete collection is never requested.
1779: */
1780: protected void initAttributeValues() {
1781: if (collAttributeValues == null) {
1782: collAttributeValues = new ArrayList();
1783: }
1784: }
1785:
1786: /**
1787: * Method called to associate a AttributeValue object to this object
1788: * through the AttributeValue foreign key attribute
1789: *
1790: * @param l AttributeValue
1791: * @throws TorqueException
1792: */
1793: public void addAttributeValue(AttributeValue l)
1794: throws TorqueException {
1795: getAttributeValues().add(l);
1796: l.setAttributeOption((AttributeOption) this );
1797: }
1798:
1799: /**
1800: * The criteria used to select the current contents of collAttributeValues
1801: */
1802: private Criteria lastAttributeValuesCriteria = null;
1803:
1804: /**
1805: * If this collection has already been initialized, returns
1806: * the collection. Otherwise returns the results of
1807: * getAttributeValues(new Criteria())
1808: *
1809: * @return the collection of associated objects
1810: * @throws TorqueException
1811: */
1812: public List getAttributeValues() throws TorqueException {
1813: if (collAttributeValues == null) {
1814: collAttributeValues = getAttributeValues(new Criteria(10));
1815: }
1816: return collAttributeValues;
1817: }
1818:
1819: /**
1820: * If this collection has already been initialized with
1821: * an identical criteria, it returns the collection.
1822: * Otherwise if this AttributeOption has previously
1823: * been saved, it will retrieve related AttributeValues from storage.
1824: * If this AttributeOption is new, it will return
1825: * an empty collection or the current collection, the criteria
1826: * is ignored on a new object.
1827: *
1828: * @throws TorqueException
1829: */
1830: public List getAttributeValues(Criteria criteria)
1831: throws TorqueException {
1832: if (collAttributeValues == null) {
1833: if (isNew()) {
1834: collAttributeValues = new ArrayList();
1835: } else {
1836: criteria.add(AttributeValuePeer.OPTION_ID,
1837: getOptionId());
1838: collAttributeValues = AttributeValuePeer
1839: .doSelect(criteria);
1840: }
1841: } else {
1842: // criteria has no effect for a new object
1843: if (!isNew()) {
1844: // the following code is to determine if a new query is
1845: // called for. If the criteria is the same as the last
1846: // one, just return the collection.
1847: criteria.add(AttributeValuePeer.OPTION_ID,
1848: getOptionId());
1849: if (!lastAttributeValuesCriteria.equals(criteria)) {
1850: collAttributeValues = AttributeValuePeer
1851: .doSelect(criteria);
1852: }
1853: }
1854: }
1855: lastAttributeValuesCriteria = criteria;
1856:
1857: return collAttributeValues;
1858: }
1859:
1860: /**
1861: * If this collection has already been initialized, returns
1862: * the collection. Otherwise returns the results of
1863: * getAttributeValues(new Criteria(),Connection)
1864: * This method takes in the Connection also as input so that
1865: * referenced objects can also be obtained using a Connection
1866: * that is taken as input
1867: */
1868: public List getAttributeValues(Connection con)
1869: throws TorqueException {
1870: if (collAttributeValues == null) {
1871: collAttributeValues = getAttributeValues(new Criteria(10),
1872: con);
1873: }
1874: return collAttributeValues;
1875: }
1876:
1877: /**
1878: * If this collection has already been initialized with
1879: * an identical criteria, it returns the collection.
1880: * Otherwise if this AttributeOption has previously
1881: * been saved, it will retrieve related AttributeValues from storage.
1882: * If this AttributeOption is new, it will return
1883: * an empty collection or the current collection, the criteria
1884: * is ignored on a new object.
1885: * This method takes in the Connection also as input so that
1886: * referenced objects can also be obtained using a Connection
1887: * that is taken as input
1888: */
1889: public List getAttributeValues(Criteria criteria, Connection con)
1890: throws TorqueException {
1891: if (collAttributeValues == null) {
1892: if (isNew()) {
1893: collAttributeValues = new ArrayList();
1894: } else {
1895: criteria.add(AttributeValuePeer.OPTION_ID,
1896: getOptionId());
1897: collAttributeValues = AttributeValuePeer.doSelect(
1898: criteria, con);
1899: }
1900: } else {
1901: // criteria has no effect for a new object
1902: if (!isNew()) {
1903: // the following code is to determine if a new query is
1904: // called for. If the criteria is the same as the last
1905: // one, just return the collection.
1906: criteria.add(AttributeValuePeer.OPTION_ID,
1907: getOptionId());
1908: if (!lastAttributeValuesCriteria.equals(criteria)) {
1909: collAttributeValues = AttributeValuePeer.doSelect(
1910: criteria, con);
1911: }
1912: }
1913: }
1914: lastAttributeValuesCriteria = criteria;
1915:
1916: return collAttributeValues;
1917: }
1918:
1919: /**
1920: * If this collection has already been initialized with
1921: * an identical criteria, it returns the collection.
1922: * Otherwise if this AttributeOption is new, it will return
1923: * an empty collection; or if this AttributeOption has previously
1924: * been saved, it will retrieve related AttributeValues from storage.
1925: *
1926: * This method is protected by default in order to keep the public
1927: * api reasonable. You can provide public methods for those you
1928: * actually need in AttributeOption.
1929: */
1930: protected List getAttributeValuesJoinIssue(Criteria criteria)
1931: throws TorqueException {
1932: if (collAttributeValues == null) {
1933: if (isNew()) {
1934: collAttributeValues = new ArrayList();
1935: } else {
1936: criteria.add(AttributeValuePeer.OPTION_ID,
1937: getOptionId());
1938: collAttributeValues = AttributeValuePeer
1939: .doSelectJoinIssue(criteria);
1940: }
1941: } else {
1942: // the following code is to determine if a new query is
1943: // called for. If the criteria is the same as the last
1944: // one, just return the collection.
1945: criteria.add(AttributeValuePeer.OPTION_ID, getOptionId());
1946: if (!lastAttributeValuesCriteria.equals(criteria)) {
1947: collAttributeValues = AttributeValuePeer
1948: .doSelectJoinIssue(criteria);
1949: }
1950: }
1951: lastAttributeValuesCriteria = criteria;
1952:
1953: return collAttributeValues;
1954: }
1955:
1956: /**
1957: * If this collection has already been initialized with
1958: * an identical criteria, it returns the collection.
1959: * Otherwise if this AttributeOption is new, it will return
1960: * an empty collection; or if this AttributeOption has previously
1961: * been saved, it will retrieve related AttributeValues from storage.
1962: *
1963: * This method is protected by default in order to keep the public
1964: * api reasonable. You can provide public methods for those you
1965: * actually need in AttributeOption.
1966: */
1967: protected List getAttributeValuesJoinAttribute(Criteria criteria)
1968: throws TorqueException {
1969: if (collAttributeValues == null) {
1970: if (isNew()) {
1971: collAttributeValues = new ArrayList();
1972: } else {
1973: criteria.add(AttributeValuePeer.OPTION_ID,
1974: getOptionId());
1975: collAttributeValues = AttributeValuePeer
1976: .doSelectJoinAttribute(criteria);
1977: }
1978: } else {
1979: // the following code is to determine if a new query is
1980: // called for. If the criteria is the same as the last
1981: // one, just return the collection.
1982: criteria.add(AttributeValuePeer.OPTION_ID, getOptionId());
1983: if (!lastAttributeValuesCriteria.equals(criteria)) {
1984: collAttributeValues = AttributeValuePeer
1985: .doSelectJoinAttribute(criteria);
1986: }
1987: }
1988: lastAttributeValuesCriteria = criteria;
1989:
1990: return collAttributeValues;
1991: }
1992:
1993: /**
1994: * If this collection has already been initialized with
1995: * an identical criteria, it returns the collection.
1996: * Otherwise if this AttributeOption is new, it will return
1997: * an empty collection; or if this AttributeOption has previously
1998: * been saved, it will retrieve related AttributeValues from storage.
1999: *
2000: * This method is protected by default in order to keep the public
2001: * api reasonable. You can provide public methods for those you
2002: * actually need in AttributeOption.
2003: */
2004: protected List getAttributeValuesJoinAttributeOption(
2005: Criteria criteria) throws TorqueException {
2006: if (collAttributeValues == null) {
2007: if (isNew()) {
2008: collAttributeValues = new ArrayList();
2009: } else {
2010: criteria.add(AttributeValuePeer.OPTION_ID,
2011: getOptionId());
2012: collAttributeValues = AttributeValuePeer
2013: .doSelectJoinAttributeOption(criteria);
2014: }
2015: } else {
2016: // the following code is to determine if a new query is
2017: // called for. If the criteria is the same as the last
2018: // one, just return the collection.
2019: criteria.add(AttributeValuePeer.OPTION_ID, getOptionId());
2020: if (!lastAttributeValuesCriteria.equals(criteria)) {
2021: collAttributeValues = AttributeValuePeer
2022: .doSelectJoinAttributeOption(criteria);
2023: }
2024: }
2025: lastAttributeValuesCriteria = criteria;
2026:
2027: return collAttributeValues;
2028: }
2029:
2030: /**
2031: * If this collection has already been initialized with
2032: * an identical criteria, it returns the collection.
2033: * Otherwise if this AttributeOption is new, it will return
2034: * an empty collection; or if this AttributeOption has previously
2035: * been saved, it will retrieve related AttributeValues from storage.
2036: *
2037: * This method is protected by default in order to keep the public
2038: * api reasonable. You can provide public methods for those you
2039: * actually need in AttributeOption.
2040: */
2041: protected List getAttributeValuesJoinScarabUserImpl(
2042: Criteria criteria) throws TorqueException {
2043: if (collAttributeValues == null) {
2044: if (isNew()) {
2045: collAttributeValues = new ArrayList();
2046: } else {
2047: criteria.add(AttributeValuePeer.OPTION_ID,
2048: getOptionId());
2049: collAttributeValues = AttributeValuePeer
2050: .doSelectJoinScarabUserImpl(criteria);
2051: }
2052: } else {
2053: // the following code is to determine if a new query is
2054: // called for. If the criteria is the same as the last
2055: // one, just return the collection.
2056: criteria.add(AttributeValuePeer.OPTION_ID, getOptionId());
2057: if (!lastAttributeValuesCriteria.equals(criteria)) {
2058: collAttributeValues = AttributeValuePeer
2059: .doSelectJoinScarabUserImpl(criteria);
2060: }
2061: }
2062: lastAttributeValuesCriteria = criteria;
2063:
2064: return collAttributeValues;
2065: }
2066:
2067: /**
2068: * Collection to store aggregation of collRModuleOptions
2069: */
2070: protected List collRModuleOptions;
2071:
2072: /**
2073: * Temporary storage of collRModuleOptions to save a possible db hit in
2074: * the event objects are add to the collection, but the
2075: * complete collection is never requested.
2076: */
2077: protected void initRModuleOptions() {
2078: if (collRModuleOptions == null) {
2079: collRModuleOptions = new ArrayList();
2080: }
2081: }
2082:
2083: /**
2084: * Method called to associate a RModuleOption object to this object
2085: * through the RModuleOption foreign key attribute
2086: *
2087: * @param l RModuleOption
2088: * @throws TorqueException
2089: */
2090: public void addRModuleOption(RModuleOption l)
2091: throws TorqueException {
2092: getRModuleOptions().add(l);
2093: l.setAttributeOption((AttributeOption) this );
2094: }
2095:
2096: /**
2097: * The criteria used to select the current contents of collRModuleOptions
2098: */
2099: private Criteria lastRModuleOptionsCriteria = null;
2100:
2101: /**
2102: * If this collection has already been initialized, returns
2103: * the collection. Otherwise returns the results of
2104: * getRModuleOptions(new Criteria())
2105: *
2106: * @return the collection of associated objects
2107: * @throws TorqueException
2108: */
2109: public List getRModuleOptions() throws TorqueException {
2110: if (collRModuleOptions == null) {
2111: collRModuleOptions = getRModuleOptions(new Criteria(10));
2112: }
2113: return collRModuleOptions;
2114: }
2115:
2116: /**
2117: * If this collection has already been initialized with
2118: * an identical criteria, it returns the collection.
2119: * Otherwise if this AttributeOption has previously
2120: * been saved, it will retrieve related RModuleOptions from storage.
2121: * If this AttributeOption is new, it will return
2122: * an empty collection or the current collection, the criteria
2123: * is ignored on a new object.
2124: *
2125: * @throws TorqueException
2126: */
2127: public List getRModuleOptions(Criteria criteria)
2128: throws TorqueException {
2129: if (collRModuleOptions == null) {
2130: if (isNew()) {
2131: collRModuleOptions = new ArrayList();
2132: } else {
2133: criteria
2134: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2135: collRModuleOptions = RModuleOptionPeer
2136: .doSelect(criteria);
2137: }
2138: } else {
2139: // criteria has no effect for a new object
2140: if (!isNew()) {
2141: // the following code is to determine if a new query is
2142: // called for. If the criteria is the same as the last
2143: // one, just return the collection.
2144: criteria
2145: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2146: if (!lastRModuleOptionsCriteria.equals(criteria)) {
2147: collRModuleOptions = RModuleOptionPeer
2148: .doSelect(criteria);
2149: }
2150: }
2151: }
2152: lastRModuleOptionsCriteria = criteria;
2153:
2154: return collRModuleOptions;
2155: }
2156:
2157: /**
2158: * If this collection has already been initialized, returns
2159: * the collection. Otherwise returns the results of
2160: * getRModuleOptions(new Criteria(),Connection)
2161: * This method takes in the Connection also as input so that
2162: * referenced objects can also be obtained using a Connection
2163: * that is taken as input
2164: */
2165: public List getRModuleOptions(Connection con)
2166: throws TorqueException {
2167: if (collRModuleOptions == null) {
2168: collRModuleOptions = getRModuleOptions(new Criteria(10),
2169: con);
2170: }
2171: return collRModuleOptions;
2172: }
2173:
2174: /**
2175: * If this collection has already been initialized with
2176: * an identical criteria, it returns the collection.
2177: * Otherwise if this AttributeOption has previously
2178: * been saved, it will retrieve related RModuleOptions from storage.
2179: * If this AttributeOption is new, it will return
2180: * an empty collection or the current collection, the criteria
2181: * is ignored on a new object.
2182: * This method takes in the Connection also as input so that
2183: * referenced objects can also be obtained using a Connection
2184: * that is taken as input
2185: */
2186: public List getRModuleOptions(Criteria criteria, Connection con)
2187: throws TorqueException {
2188: if (collRModuleOptions == null) {
2189: if (isNew()) {
2190: collRModuleOptions = new ArrayList();
2191: } else {
2192: criteria
2193: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2194: collRModuleOptions = RModuleOptionPeer.doSelect(
2195: criteria, con);
2196: }
2197: } else {
2198: // criteria has no effect for a new object
2199: if (!isNew()) {
2200: // the following code is to determine if a new query is
2201: // called for. If the criteria is the same as the last
2202: // one, just return the collection.
2203: criteria
2204: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2205: if (!lastRModuleOptionsCriteria.equals(criteria)) {
2206: collRModuleOptions = RModuleOptionPeer.doSelect(
2207: criteria, con);
2208: }
2209: }
2210: }
2211: lastRModuleOptionsCriteria = criteria;
2212:
2213: return collRModuleOptions;
2214: }
2215:
2216: /**
2217: * If this collection has already been initialized with
2218: * an identical criteria, it returns the collection.
2219: * Otherwise if this AttributeOption is new, it will return
2220: * an empty collection; or if this AttributeOption has previously
2221: * been saved, it will retrieve related RModuleOptions from storage.
2222: *
2223: * This method is protected by default in order to keep the public
2224: * api reasonable. You can provide public methods for those you
2225: * actually need in AttributeOption.
2226: */
2227: protected List getRModuleOptionsJoinAttributeOption(
2228: Criteria criteria) throws TorqueException {
2229: if (collRModuleOptions == null) {
2230: if (isNew()) {
2231: collRModuleOptions = new ArrayList();
2232: } else {
2233: criteria
2234: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2235: collRModuleOptions = RModuleOptionPeer
2236: .doSelectJoinAttributeOption(criteria);
2237: }
2238: } else {
2239: // the following code is to determine if a new query is
2240: // called for. If the criteria is the same as the last
2241: // one, just return the collection.
2242: criteria.add(RModuleOptionPeer.OPTION_ID, getOptionId());
2243: if (!lastRModuleOptionsCriteria.equals(criteria)) {
2244: collRModuleOptions = RModuleOptionPeer
2245: .doSelectJoinAttributeOption(criteria);
2246: }
2247: }
2248: lastRModuleOptionsCriteria = criteria;
2249:
2250: return collRModuleOptions;
2251: }
2252:
2253: /**
2254: * If this collection has already been initialized with
2255: * an identical criteria, it returns the collection.
2256: * Otherwise if this AttributeOption is new, it will return
2257: * an empty collection; or if this AttributeOption has previously
2258: * been saved, it will retrieve related RModuleOptions from storage.
2259: *
2260: * This method is protected by default in order to keep the public
2261: * api reasonable. You can provide public methods for those you
2262: * actually need in AttributeOption.
2263: */
2264: protected List getRModuleOptionsJoinScarabModule(Criteria criteria)
2265: throws TorqueException {
2266: if (collRModuleOptions == null) {
2267: if (isNew()) {
2268: collRModuleOptions = new ArrayList();
2269: } else {
2270: criteria
2271: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2272: collRModuleOptions = RModuleOptionPeer
2273: .doSelectJoinScarabModule(criteria);
2274: }
2275: } else {
2276: // the following code is to determine if a new query is
2277: // called for. If the criteria is the same as the last
2278: // one, just return the collection.
2279: criteria.add(RModuleOptionPeer.OPTION_ID, getOptionId());
2280: if (!lastRModuleOptionsCriteria.equals(criteria)) {
2281: collRModuleOptions = RModuleOptionPeer
2282: .doSelectJoinScarabModule(criteria);
2283: }
2284: }
2285: lastRModuleOptionsCriteria = criteria;
2286:
2287: return collRModuleOptions;
2288: }
2289:
2290: /**
2291: * If this collection has already been initialized with
2292: * an identical criteria, it returns the collection.
2293: * Otherwise if this AttributeOption is new, it will return
2294: * an empty collection; or if this AttributeOption has previously
2295: * been saved, it will retrieve related RModuleOptions from storage.
2296: *
2297: * This method is protected by default in order to keep the public
2298: * api reasonable. You can provide public methods for those you
2299: * actually need in AttributeOption.
2300: */
2301: protected List getRModuleOptionsJoinIssueType(Criteria criteria)
2302: throws TorqueException {
2303: if (collRModuleOptions == null) {
2304: if (isNew()) {
2305: collRModuleOptions = new ArrayList();
2306: } else {
2307: criteria
2308: .add(RModuleOptionPeer.OPTION_ID, getOptionId());
2309: collRModuleOptions = RModuleOptionPeer
2310: .doSelectJoinIssueType(criteria);
2311: }
2312: } else {
2313: // the following code is to determine if a new query is
2314: // called for. If the criteria is the same as the last
2315: // one, just return the collection.
2316: criteria.add(RModuleOptionPeer.OPTION_ID, getOptionId());
2317: if (!lastRModuleOptionsCriteria.equals(criteria)) {
2318: collRModuleOptions = RModuleOptionPeer
2319: .doSelectJoinIssueType(criteria);
2320: }
2321: }
2322: lastRModuleOptionsCriteria = criteria;
2323:
2324: return collRModuleOptions;
2325: }
2326:
2327: /**
2328: * Collection to store aggregation of collRIssueTypeOptions
2329: */
2330: protected List collRIssueTypeOptions;
2331:
2332: /**
2333: * Temporary storage of collRIssueTypeOptions to save a possible db hit in
2334: * the event objects are add to the collection, but the
2335: * complete collection is never requested.
2336: */
2337: protected void initRIssueTypeOptions() {
2338: if (collRIssueTypeOptions == null) {
2339: collRIssueTypeOptions = new ArrayList();
2340: }
2341: }
2342:
2343: /**
2344: * Method called to associate a RIssueTypeOption object to this object
2345: * through the RIssueTypeOption foreign key attribute
2346: *
2347: * @param l RIssueTypeOption
2348: * @throws TorqueException
2349: */
2350: public void addRIssueTypeOption(RIssueTypeOption l)
2351: throws TorqueException {
2352: getRIssueTypeOptions().add(l);
2353: l.setAttributeOption((AttributeOption) this );
2354: }
2355:
2356: /**
2357: * The criteria used to select the current contents of collRIssueTypeOptions
2358: */
2359: private Criteria lastRIssueTypeOptionsCriteria = null;
2360:
2361: /**
2362: * If this collection has already been initialized, returns
2363: * the collection. Otherwise returns the results of
2364: * getRIssueTypeOptions(new Criteria())
2365: *
2366: * @return the collection of associated objects
2367: * @throws TorqueException
2368: */
2369: public List getRIssueTypeOptions() throws TorqueException {
2370: if (collRIssueTypeOptions == null) {
2371: collRIssueTypeOptions = getRIssueTypeOptions(new Criteria(
2372: 10));
2373: }
2374: return collRIssueTypeOptions;
2375: }
2376:
2377: /**
2378: * If this collection has already been initialized with
2379: * an identical criteria, it returns the collection.
2380: * Otherwise if this AttributeOption has previously
2381: * been saved, it will retrieve related RIssueTypeOptions from storage.
2382: * If this AttributeOption is new, it will return
2383: * an empty collection or the current collection, the criteria
2384: * is ignored on a new object.
2385: *
2386: * @throws TorqueException
2387: */
2388: public List getRIssueTypeOptions(Criteria criteria)
2389: throws TorqueException {
2390: if (collRIssueTypeOptions == null) {
2391: if (isNew()) {
2392: collRIssueTypeOptions = new ArrayList();
2393: } else {
2394: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2395: getOptionId());
2396: collRIssueTypeOptions = RIssueTypeOptionPeer
2397: .doSelect(criteria);
2398: }
2399: } else {
2400: // criteria has no effect for a new object
2401: if (!isNew()) {
2402: // the following code is to determine if a new query is
2403: // called for. If the criteria is the same as the last
2404: // one, just return the collection.
2405: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2406: getOptionId());
2407: if (!lastRIssueTypeOptionsCriteria.equals(criteria)) {
2408: collRIssueTypeOptions = RIssueTypeOptionPeer
2409: .doSelect(criteria);
2410: }
2411: }
2412: }
2413: lastRIssueTypeOptionsCriteria = criteria;
2414:
2415: return collRIssueTypeOptions;
2416: }
2417:
2418: /**
2419: * If this collection has already been initialized, returns
2420: * the collection. Otherwise returns the results of
2421: * getRIssueTypeOptions(new Criteria(),Connection)
2422: * This method takes in the Connection also as input so that
2423: * referenced objects can also be obtained using a Connection
2424: * that is taken as input
2425: */
2426: public List getRIssueTypeOptions(Connection con)
2427: throws TorqueException {
2428: if (collRIssueTypeOptions == null) {
2429: collRIssueTypeOptions = getRIssueTypeOptions(new Criteria(
2430: 10), con);
2431: }
2432: return collRIssueTypeOptions;
2433: }
2434:
2435: /**
2436: * If this collection has already been initialized with
2437: * an identical criteria, it returns the collection.
2438: * Otherwise if this AttributeOption has previously
2439: * been saved, it will retrieve related RIssueTypeOptions from storage.
2440: * If this AttributeOption is new, it will return
2441: * an empty collection or the current collection, the criteria
2442: * is ignored on a new object.
2443: * This method takes in the Connection also as input so that
2444: * referenced objects can also be obtained using a Connection
2445: * that is taken as input
2446: */
2447: public List getRIssueTypeOptions(Criteria criteria, Connection con)
2448: throws TorqueException {
2449: if (collRIssueTypeOptions == null) {
2450: if (isNew()) {
2451: collRIssueTypeOptions = new ArrayList();
2452: } else {
2453: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2454: getOptionId());
2455: collRIssueTypeOptions = RIssueTypeOptionPeer.doSelect(
2456: criteria, con);
2457: }
2458: } else {
2459: // criteria has no effect for a new object
2460: if (!isNew()) {
2461: // the following code is to determine if a new query is
2462: // called for. If the criteria is the same as the last
2463: // one, just return the collection.
2464: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2465: getOptionId());
2466: if (!lastRIssueTypeOptionsCriteria.equals(criteria)) {
2467: collRIssueTypeOptions = RIssueTypeOptionPeer
2468: .doSelect(criteria, con);
2469: }
2470: }
2471: }
2472: lastRIssueTypeOptionsCriteria = criteria;
2473:
2474: return collRIssueTypeOptions;
2475: }
2476:
2477: /**
2478: * If this collection has already been initialized with
2479: * an identical criteria, it returns the collection.
2480: * Otherwise if this AttributeOption is new, it will return
2481: * an empty collection; or if this AttributeOption has previously
2482: * been saved, it will retrieve related RIssueTypeOptions from storage.
2483: *
2484: * This method is protected by default in order to keep the public
2485: * api reasonable. You can provide public methods for those you
2486: * actually need in AttributeOption.
2487: */
2488: protected List getRIssueTypeOptionsJoinAttributeOption(
2489: Criteria criteria) throws TorqueException {
2490: if (collRIssueTypeOptions == null) {
2491: if (isNew()) {
2492: collRIssueTypeOptions = new ArrayList();
2493: } else {
2494: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2495: getOptionId());
2496: collRIssueTypeOptions = RIssueTypeOptionPeer
2497: .doSelectJoinAttributeOption(criteria);
2498: }
2499: } else {
2500: // the following code is to determine if a new query is
2501: // called for. If the criteria is the same as the last
2502: // one, just return the collection.
2503: criteria.add(RIssueTypeOptionPeer.OPTION_ID, getOptionId());
2504: if (!lastRIssueTypeOptionsCriteria.equals(criteria)) {
2505: collRIssueTypeOptions = RIssueTypeOptionPeer
2506: .doSelectJoinAttributeOption(criteria);
2507: }
2508: }
2509: lastRIssueTypeOptionsCriteria = criteria;
2510:
2511: return collRIssueTypeOptions;
2512: }
2513:
2514: /**
2515: * If this collection has already been initialized with
2516: * an identical criteria, it returns the collection.
2517: * Otherwise if this AttributeOption is new, it will return
2518: * an empty collection; or if this AttributeOption has previously
2519: * been saved, it will retrieve related RIssueTypeOptions from storage.
2520: *
2521: * This method is protected by default in order to keep the public
2522: * api reasonable. You can provide public methods for those you
2523: * actually need in AttributeOption.
2524: */
2525: protected List getRIssueTypeOptionsJoinIssueType(Criteria criteria)
2526: throws TorqueException {
2527: if (collRIssueTypeOptions == null) {
2528: if (isNew()) {
2529: collRIssueTypeOptions = new ArrayList();
2530: } else {
2531: criteria.add(RIssueTypeOptionPeer.OPTION_ID,
2532: getOptionId());
2533: collRIssueTypeOptions = RIssueTypeOptionPeer
2534: .doSelectJoinIssueType(criteria);
2535: }
2536: } else {
2537: // the following code is to determine if a new query is
2538: // called for. If the criteria is the same as the last
2539: // one, just return the collection.
2540: criteria.add(RIssueTypeOptionPeer.OPTION_ID, getOptionId());
2541: if (!lastRIssueTypeOptionsCriteria.equals(criteria)) {
2542: collRIssueTypeOptions = RIssueTypeOptionPeer
2543: .doSelectJoinIssueType(criteria);
2544: }
2545: }
2546: lastRIssueTypeOptionsCriteria = criteria;
2547:
2548: return collRIssueTypeOptions;
2549: }
2550:
2551: /**
2552: * Collection to store aggregation of collROptionOptionsRelatedByOption1Id
2553: */
2554: protected List collROptionOptionsRelatedByOption1Id;
2555:
2556: /**
2557: * Temporary storage of collROptionOptionsRelatedByOption1Id to save a possible db hit in
2558: * the event objects are add to the collection, but the
2559: * complete collection is never requested.
2560: */
2561: protected void initROptionOptionsRelatedByOption1Id() {
2562: if (collROptionOptionsRelatedByOption1Id == null) {
2563: collROptionOptionsRelatedByOption1Id = new ArrayList();
2564: }
2565: }
2566:
2567: /**
2568: * Method called to associate a ROptionOption object to this object
2569: * through the ROptionOption foreign key attribute
2570: *
2571: * @param l ROptionOption
2572: * @throws TorqueException
2573: */
2574: public void addROptionOptionRelatedByOption1Id(ROptionOption l)
2575: throws TorqueException {
2576: getROptionOptionsRelatedByOption1Id().add(l);
2577: l.setAttributeOptionRelatedByOption1Id((AttributeOption) this );
2578: }
2579:
2580: /**
2581: * The criteria used to select the current contents of collROptionOptionsRelatedByOption1Id
2582: */
2583: private Criteria lastROptionOptionsRelatedByOption1IdCriteria = null;
2584:
2585: /**
2586: * If this collection has already been initialized, returns
2587: * the collection. Otherwise returns the results of
2588: * getROptionOptionsRelatedByOption1Id(new Criteria())
2589: *
2590: * @return the collection of associated objects
2591: * @throws TorqueException
2592: */
2593: public List getROptionOptionsRelatedByOption1Id()
2594: throws TorqueException {
2595: if (collROptionOptionsRelatedByOption1Id == null) {
2596: collROptionOptionsRelatedByOption1Id = getROptionOptionsRelatedByOption1Id(new Criteria(
2597: 10));
2598: }
2599: return collROptionOptionsRelatedByOption1Id;
2600: }
2601:
2602: /**
2603: * If this collection has already been initialized with
2604: * an identical criteria, it returns the collection.
2605: * Otherwise if this AttributeOption has previously
2606: * been saved, it will retrieve related ROptionOptionsRelatedByOption1Id from storage.
2607: * If this AttributeOption is new, it will return
2608: * an empty collection or the current collection, the criteria
2609: * is ignored on a new object.
2610: *
2611: * @throws TorqueException
2612: */
2613: public List getROptionOptionsRelatedByOption1Id(Criteria criteria)
2614: throws TorqueException {
2615: if (collROptionOptionsRelatedByOption1Id == null) {
2616: if (isNew()) {
2617: collROptionOptionsRelatedByOption1Id = new ArrayList();
2618: } else {
2619: criteria.add(ROptionOptionPeer.OPTION1_ID,
2620: getOptionId());
2621: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2622: .doSelect(criteria);
2623: }
2624: } else {
2625: // criteria has no effect for a new object
2626: if (!isNew()) {
2627: // the following code is to determine if a new query is
2628: // called for. If the criteria is the same as the last
2629: // one, just return the collection.
2630: criteria.add(ROptionOptionPeer.OPTION1_ID,
2631: getOptionId());
2632: if (!lastROptionOptionsRelatedByOption1IdCriteria
2633: .equals(criteria)) {
2634: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2635: .doSelect(criteria);
2636: }
2637: }
2638: }
2639: lastROptionOptionsRelatedByOption1IdCriteria = criteria;
2640:
2641: return collROptionOptionsRelatedByOption1Id;
2642: }
2643:
2644: /**
2645: * If this collection has already been initialized, returns
2646: * the collection. Otherwise returns the results of
2647: * getROptionOptionsRelatedByOption1Id(new Criteria(),Connection)
2648: * This method takes in the Connection also as input so that
2649: * referenced objects can also be obtained using a Connection
2650: * that is taken as input
2651: */
2652: public List getROptionOptionsRelatedByOption1Id(Connection con)
2653: throws TorqueException {
2654: if (collROptionOptionsRelatedByOption1Id == null) {
2655: collROptionOptionsRelatedByOption1Id = getROptionOptionsRelatedByOption1Id(
2656: new Criteria(10), con);
2657: }
2658: return collROptionOptionsRelatedByOption1Id;
2659: }
2660:
2661: /**
2662: * If this collection has already been initialized with
2663: * an identical criteria, it returns the collection.
2664: * Otherwise if this AttributeOption has previously
2665: * been saved, it will retrieve related ROptionOptionsRelatedByOption1Id from storage.
2666: * If this AttributeOption is new, it will return
2667: * an empty collection or the current collection, the criteria
2668: * is ignored on a new object.
2669: * This method takes in the Connection also as input so that
2670: * referenced objects can also be obtained using a Connection
2671: * that is taken as input
2672: */
2673: public List getROptionOptionsRelatedByOption1Id(Criteria criteria,
2674: Connection con) throws TorqueException {
2675: if (collROptionOptionsRelatedByOption1Id == null) {
2676: if (isNew()) {
2677: collROptionOptionsRelatedByOption1Id = new ArrayList();
2678: } else {
2679: criteria.add(ROptionOptionPeer.OPTION1_ID,
2680: getOptionId());
2681: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2682: .doSelect(criteria, con);
2683: }
2684: } else {
2685: // criteria has no effect for a new object
2686: if (!isNew()) {
2687: // the following code is to determine if a new query is
2688: // called for. If the criteria is the same as the last
2689: // one, just return the collection.
2690: criteria.add(ROptionOptionPeer.OPTION1_ID,
2691: getOptionId());
2692: if (!lastROptionOptionsRelatedByOption1IdCriteria
2693: .equals(criteria)) {
2694: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2695: .doSelect(criteria, con);
2696: }
2697: }
2698: }
2699: lastROptionOptionsRelatedByOption1IdCriteria = criteria;
2700:
2701: return collROptionOptionsRelatedByOption1Id;
2702: }
2703:
2704: /**
2705: * If this collection has already been initialized with
2706: * an identical criteria, it returns the collection.
2707: * Otherwise if this AttributeOption is new, it will return
2708: * an empty collection; or if this AttributeOption has previously
2709: * been saved, it will retrieve related ROptionOptionsRelatedByOption1Id from storage.
2710: *
2711: * This method is protected by default in order to keep the public
2712: * api reasonable. You can provide public methods for those you
2713: * actually need in AttributeOption.
2714: */
2715: protected List getROptionOptionsRelatedByOption1IdJoinAttributeOptionRelatedByOption2Id(
2716: Criteria criteria) throws TorqueException {
2717: if (collROptionOptionsRelatedByOption1Id == null) {
2718: if (isNew()) {
2719: collROptionOptionsRelatedByOption1Id = new ArrayList();
2720: } else {
2721: criteria.add(ROptionOptionPeer.OPTION1_ID,
2722: getOptionId());
2723: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2724: .doSelectJoinAttributeOptionRelatedByOption2Id(criteria);
2725: }
2726: } else {
2727: // the following code is to determine if a new query is
2728: // called for. If the criteria is the same as the last
2729: // one, just return the collection.
2730: criteria.add(ROptionOptionPeer.OPTION1_ID, getOptionId());
2731: if (!lastROptionOptionsRelatedByOption1IdCriteria
2732: .equals(criteria)) {
2733: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2734: .doSelectJoinAttributeOptionRelatedByOption2Id(criteria);
2735: }
2736: }
2737: lastROptionOptionsRelatedByOption1IdCriteria = criteria;
2738:
2739: return collROptionOptionsRelatedByOption1Id;
2740: }
2741:
2742: /**
2743: * If this collection has already been initialized with
2744: * an identical criteria, it returns the collection.
2745: * Otherwise if this AttributeOption is new, it will return
2746: * an empty collection; or if this AttributeOption has previously
2747: * been saved, it will retrieve related ROptionOptionsRelatedByOption1Id from storage.
2748: *
2749: * This method is protected by default in order to keep the public
2750: * api reasonable. You can provide public methods for those you
2751: * actually need in AttributeOption.
2752: */
2753: protected List getROptionOptionsRelatedByOption1IdJoinOptionRelationship(
2754: Criteria criteria) throws TorqueException {
2755: if (collROptionOptionsRelatedByOption1Id == null) {
2756: if (isNew()) {
2757: collROptionOptionsRelatedByOption1Id = new ArrayList();
2758: } else {
2759: criteria.add(ROptionOptionPeer.OPTION1_ID,
2760: getOptionId());
2761: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2762: .doSelectJoinOptionRelationship(criteria);
2763: }
2764: } else {
2765: // the following code is to determine if a new query is
2766: // called for. If the criteria is the same as the last
2767: // one, just return the collection.
2768: criteria.add(ROptionOptionPeer.OPTION1_ID, getOptionId());
2769: if (!lastROptionOptionsRelatedByOption1IdCriteria
2770: .equals(criteria)) {
2771: collROptionOptionsRelatedByOption1Id = ROptionOptionPeer
2772: .doSelectJoinOptionRelationship(criteria);
2773: }
2774: }
2775: lastROptionOptionsRelatedByOption1IdCriteria = criteria;
2776:
2777: return collROptionOptionsRelatedByOption1Id;
2778: }
2779:
2780: /**
2781: * Collection to store aggregation of collROptionOptionsRelatedByOption2Id
2782: */
2783: protected List collROptionOptionsRelatedByOption2Id;
2784:
2785: /**
2786: * Temporary storage of collROptionOptionsRelatedByOption2Id to save a possible db hit in
2787: * the event objects are add to the collection, but the
2788: * complete collection is never requested.
2789: */
2790: protected void initROptionOptionsRelatedByOption2Id() {
2791: if (collROptionOptionsRelatedByOption2Id == null) {
2792: collROptionOptionsRelatedByOption2Id = new ArrayList();
2793: }
2794: }
2795:
2796: /**
2797: * Method called to associate a ROptionOption object to this object
2798: * through the ROptionOption foreign key attribute
2799: *
2800: * @param l ROptionOption
2801: * @throws TorqueException
2802: */
2803: public void addROptionOptionRelatedByOption2Id(ROptionOption l)
2804: throws TorqueException {
2805: getROptionOptionsRelatedByOption2Id().add(l);
2806: l.setAttributeOptionRelatedByOption2Id((AttributeOption) this );
2807: }
2808:
2809: /**
2810: * The criteria used to select the current contents of collROptionOptionsRelatedByOption2Id
2811: */
2812: private Criteria lastROptionOptionsRelatedByOption2IdCriteria = null;
2813:
2814: /**
2815: * If this collection has already been initialized, returns
2816: * the collection. Otherwise returns the results of
2817: * getROptionOptionsRelatedByOption2Id(new Criteria())
2818: *
2819: * @return the collection of associated objects
2820: * @throws TorqueException
2821: */
2822: public List getROptionOptionsRelatedByOption2Id()
2823: throws TorqueException {
2824: if (collROptionOptionsRelatedByOption2Id == null) {
2825: collROptionOptionsRelatedByOption2Id = getROptionOptionsRelatedByOption2Id(new Criteria(
2826: 10));
2827: }
2828: return collROptionOptionsRelatedByOption2Id;
2829: }
2830:
2831: /**
2832: * If this collection has already been initialized with
2833: * an identical criteria, it returns the collection.
2834: * Otherwise if this AttributeOption has previously
2835: * been saved, it will retrieve related ROptionOptionsRelatedByOption2Id from storage.
2836: * If this AttributeOption is new, it will return
2837: * an empty collection or the current collection, the criteria
2838: * is ignored on a new object.
2839: *
2840: * @throws TorqueException
2841: */
2842: public List getROptionOptionsRelatedByOption2Id(Criteria criteria)
2843: throws TorqueException {
2844: if (collROptionOptionsRelatedByOption2Id == null) {
2845: if (isNew()) {
2846: collROptionOptionsRelatedByOption2Id = new ArrayList();
2847: } else {
2848: criteria.add(ROptionOptionPeer.OPTION2_ID,
2849: getOptionId());
2850: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2851: .doSelect(criteria);
2852: }
2853: } else {
2854: // criteria has no effect for a new object
2855: if (!isNew()) {
2856: // the following code is to determine if a new query is
2857: // called for. If the criteria is the same as the last
2858: // one, just return the collection.
2859: criteria.add(ROptionOptionPeer.OPTION2_ID,
2860: getOptionId());
2861: if (!lastROptionOptionsRelatedByOption2IdCriteria
2862: .equals(criteria)) {
2863: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2864: .doSelect(criteria);
2865: }
2866: }
2867: }
2868: lastROptionOptionsRelatedByOption2IdCriteria = criteria;
2869:
2870: return collROptionOptionsRelatedByOption2Id;
2871: }
2872:
2873: /**
2874: * If this collection has already been initialized, returns
2875: * the collection. Otherwise returns the results of
2876: * getROptionOptionsRelatedByOption2Id(new Criteria(),Connection)
2877: * This method takes in the Connection also as input so that
2878: * referenced objects can also be obtained using a Connection
2879: * that is taken as input
2880: */
2881: public List getROptionOptionsRelatedByOption2Id(Connection con)
2882: throws TorqueException {
2883: if (collROptionOptionsRelatedByOption2Id == null) {
2884: collROptionOptionsRelatedByOption2Id = getROptionOptionsRelatedByOption2Id(
2885: new Criteria(10), con);
2886: }
2887: return collROptionOptionsRelatedByOption2Id;
2888: }
2889:
2890: /**
2891: * If this collection has already been initialized with
2892: * an identical criteria, it returns the collection.
2893: * Otherwise if this AttributeOption has previously
2894: * been saved, it will retrieve related ROptionOptionsRelatedByOption2Id from storage.
2895: * If this AttributeOption is new, it will return
2896: * an empty collection or the current collection, the criteria
2897: * is ignored on a new object.
2898: * This method takes in the Connection also as input so that
2899: * referenced objects can also be obtained using a Connection
2900: * that is taken as input
2901: */
2902: public List getROptionOptionsRelatedByOption2Id(Criteria criteria,
2903: Connection con) throws TorqueException {
2904: if (collROptionOptionsRelatedByOption2Id == null) {
2905: if (isNew()) {
2906: collROptionOptionsRelatedByOption2Id = new ArrayList();
2907: } else {
2908: criteria.add(ROptionOptionPeer.OPTION2_ID,
2909: getOptionId());
2910: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2911: .doSelect(criteria, con);
2912: }
2913: } else {
2914: // criteria has no effect for a new object
2915: if (!isNew()) {
2916: // the following code is to determine if a new query is
2917: // called for. If the criteria is the same as the last
2918: // one, just return the collection.
2919: criteria.add(ROptionOptionPeer.OPTION2_ID,
2920: getOptionId());
2921: if (!lastROptionOptionsRelatedByOption2IdCriteria
2922: .equals(criteria)) {
2923: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2924: .doSelect(criteria, con);
2925: }
2926: }
2927: }
2928: lastROptionOptionsRelatedByOption2IdCriteria = criteria;
2929:
2930: return collROptionOptionsRelatedByOption2Id;
2931: }
2932:
2933: /**
2934: * If this collection has already been initialized with
2935: * an identical criteria, it returns the collection.
2936: * Otherwise if this AttributeOption is new, it will return
2937: * an empty collection; or if this AttributeOption has previously
2938: * been saved, it will retrieve related ROptionOptionsRelatedByOption2Id from storage.
2939: *
2940: * This method is protected by default in order to keep the public
2941: * api reasonable. You can provide public methods for those you
2942: * actually need in AttributeOption.
2943: */
2944: protected List getROptionOptionsRelatedByOption2IdJoinAttributeOptionRelatedByOption1Id(
2945: Criteria criteria) throws TorqueException {
2946: if (collROptionOptionsRelatedByOption2Id == null) {
2947: if (isNew()) {
2948: collROptionOptionsRelatedByOption2Id = new ArrayList();
2949: } else {
2950: criteria.add(ROptionOptionPeer.OPTION2_ID,
2951: getOptionId());
2952: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2953: .doSelectJoinAttributeOptionRelatedByOption1Id(criteria);
2954: }
2955: } else {
2956: // the following code is to determine if a new query is
2957: // called for. If the criteria is the same as the last
2958: // one, just return the collection.
2959: criteria.add(ROptionOptionPeer.OPTION2_ID, getOptionId());
2960: if (!lastROptionOptionsRelatedByOption2IdCriteria
2961: .equals(criteria)) {
2962: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2963: .doSelectJoinAttributeOptionRelatedByOption1Id(criteria);
2964: }
2965: }
2966: lastROptionOptionsRelatedByOption2IdCriteria = criteria;
2967:
2968: return collROptionOptionsRelatedByOption2Id;
2969: }
2970:
2971: /**
2972: * If this collection has already been initialized with
2973: * an identical criteria, it returns the collection.
2974: * Otherwise if this AttributeOption is new, it will return
2975: * an empty collection; or if this AttributeOption has previously
2976: * been saved, it will retrieve related ROptionOptionsRelatedByOption2Id from storage.
2977: *
2978: * This method is protected by default in order to keep the public
2979: * api reasonable. You can provide public methods for those you
2980: * actually need in AttributeOption.
2981: */
2982: protected List getROptionOptionsRelatedByOption2IdJoinOptionRelationship(
2983: Criteria criteria) throws TorqueException {
2984: if (collROptionOptionsRelatedByOption2Id == null) {
2985: if (isNew()) {
2986: collROptionOptionsRelatedByOption2Id = new ArrayList();
2987: } else {
2988: criteria.add(ROptionOptionPeer.OPTION2_ID,
2989: getOptionId());
2990: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
2991: .doSelectJoinOptionRelationship(criteria);
2992: }
2993: } else {
2994: // the following code is to determine if a new query is
2995: // called for. If the criteria is the same as the last
2996: // one, just return the collection.
2997: criteria.add(ROptionOptionPeer.OPTION2_ID, getOptionId());
2998: if (!lastROptionOptionsRelatedByOption2IdCriteria
2999: .equals(criteria)) {
3000: collROptionOptionsRelatedByOption2Id = ROptionOptionPeer
3001: .doSelectJoinOptionRelationship(criteria);
3002: }
3003: }
3004: lastROptionOptionsRelatedByOption2IdCriteria = criteria;
3005:
3006: return collROptionOptionsRelatedByOption2Id;
3007: }
3008:
3009: /**
3010: * Collection to store aggregation of collTransitionsRelatedByFromOptionId
3011: */
3012: protected List collTransitionsRelatedByFromOptionId;
3013:
3014: /**
3015: * Temporary storage of collTransitionsRelatedByFromOptionId to save a possible db hit in
3016: * the event objects are add to the collection, but the
3017: * complete collection is never requested.
3018: */
3019: protected void initTransitionsRelatedByFromOptionId() {
3020: if (collTransitionsRelatedByFromOptionId == null) {
3021: collTransitionsRelatedByFromOptionId = new ArrayList();
3022: }
3023: }
3024:
3025: /**
3026: * Method called to associate a Transition object to this object
3027: * through the Transition foreign key attribute
3028: *
3029: * @param l Transition
3030: * @throws TorqueException
3031: */
3032: public void addTransitionRelatedByFromOptionId(Transition l)
3033: throws TorqueException {
3034: getTransitionsRelatedByFromOptionId().add(l);
3035: l
3036: .setAttributeOptionRelatedByFromOptionId((AttributeOption) this );
3037: }
3038:
3039: /**
3040: * The criteria used to select the current contents of collTransitionsRelatedByFromOptionId
3041: */
3042: private Criteria lastTransitionsRelatedByFromOptionIdCriteria = null;
3043:
3044: /**
3045: * If this collection has already been initialized, returns
3046: * the collection. Otherwise returns the results of
3047: * getTransitionsRelatedByFromOptionId(new Criteria())
3048: *
3049: * @return the collection of associated objects
3050: * @throws TorqueException
3051: */
3052: public List getTransitionsRelatedByFromOptionId()
3053: throws TorqueException {
3054: if (collTransitionsRelatedByFromOptionId == null) {
3055: collTransitionsRelatedByFromOptionId = getTransitionsRelatedByFromOptionId(new Criteria(
3056: 10));
3057: }
3058: return collTransitionsRelatedByFromOptionId;
3059: }
3060:
3061: /**
3062: * If this collection has already been initialized with
3063: * an identical criteria, it returns the collection.
3064: * Otherwise if this AttributeOption has previously
3065: * been saved, it will retrieve related TransitionsRelatedByFromOptionId from storage.
3066: * If this AttributeOption is new, it will return
3067: * an empty collection or the current collection, the criteria
3068: * is ignored on a new object.
3069: *
3070: * @throws TorqueException
3071: */
3072: public List getTransitionsRelatedByFromOptionId(Criteria criteria)
3073: throws TorqueException {
3074: if (collTransitionsRelatedByFromOptionId == null) {
3075: if (isNew()) {
3076: collTransitionsRelatedByFromOptionId = new ArrayList();
3077: } else {
3078: criteria.add(TransitionPeer.FROM_OPTION_ID,
3079: getOptionId());
3080: collTransitionsRelatedByFromOptionId = TransitionPeer
3081: .doSelect(criteria);
3082: }
3083: } else {
3084: // criteria has no effect for a new object
3085: if (!isNew()) {
3086: // the following code is to determine if a new query is
3087: // called for. If the criteria is the same as the last
3088: // one, just return the collection.
3089: criteria.add(TransitionPeer.FROM_OPTION_ID,
3090: getOptionId());
3091: if (!lastTransitionsRelatedByFromOptionIdCriteria
3092: .equals(criteria)) {
3093: collTransitionsRelatedByFromOptionId = TransitionPeer
3094: .doSelect(criteria);
3095: }
3096: }
3097: }
3098: lastTransitionsRelatedByFromOptionIdCriteria = criteria;
3099:
3100: return collTransitionsRelatedByFromOptionId;
3101: }
3102:
3103: /**
3104: * If this collection has already been initialized, returns
3105: * the collection. Otherwise returns the results of
3106: * getTransitionsRelatedByFromOptionId(new Criteria(),Connection)
3107: * This method takes in the Connection also as input so that
3108: * referenced objects can also be obtained using a Connection
3109: * that is taken as input
3110: */
3111: public List getTransitionsRelatedByFromOptionId(Connection con)
3112: throws TorqueException {
3113: if (collTransitionsRelatedByFromOptionId == null) {
3114: collTransitionsRelatedByFromOptionId = getTransitionsRelatedByFromOptionId(
3115: new Criteria(10), con);
3116: }
3117: return collTransitionsRelatedByFromOptionId;
3118: }
3119:
3120: /**
3121: * If this collection has already been initialized with
3122: * an identical criteria, it returns the collection.
3123: * Otherwise if this AttributeOption has previously
3124: * been saved, it will retrieve related TransitionsRelatedByFromOptionId from storage.
3125: * If this AttributeOption is new, it will return
3126: * an empty collection or the current collection, the criteria
3127: * is ignored on a new object.
3128: * This method takes in the Connection also as input so that
3129: * referenced objects can also be obtained using a Connection
3130: * that is taken as input
3131: */
3132: public List getTransitionsRelatedByFromOptionId(Criteria criteria,
3133: Connection con) throws TorqueException {
3134: if (collTransitionsRelatedByFromOptionId == null) {
3135: if (isNew()) {
3136: collTransitionsRelatedByFromOptionId = new ArrayList();
3137: } else {
3138: criteria.add(TransitionPeer.FROM_OPTION_ID,
3139: getOptionId());
3140: collTransitionsRelatedByFromOptionId = TransitionPeer
3141: .doSelect(criteria, con);
3142: }
3143: } else {
3144: // criteria has no effect for a new object
3145: if (!isNew()) {
3146: // the following code is to determine if a new query is
3147: // called for. If the criteria is the same as the last
3148: // one, just return the collection.
3149: criteria.add(TransitionPeer.FROM_OPTION_ID,
3150: getOptionId());
3151: if (!lastTransitionsRelatedByFromOptionIdCriteria
3152: .equals(criteria)) {
3153: collTransitionsRelatedByFromOptionId = TransitionPeer
3154: .doSelect(criteria, con);
3155: }
3156: }
3157: }
3158: lastTransitionsRelatedByFromOptionIdCriteria = criteria;
3159:
3160: return collTransitionsRelatedByFromOptionId;
3161: }
3162:
3163: /**
3164: * If this collection has already been initialized with
3165: * an identical criteria, it returns the collection.
3166: * Otherwise if this AttributeOption is new, it will return
3167: * an empty collection; or if this AttributeOption has previously
3168: * been saved, it will retrieve related TransitionsRelatedByFromOptionId from storage.
3169: *
3170: * This method is protected by default in order to keep the public
3171: * api reasonable. You can provide public methods for those you
3172: * actually need in AttributeOption.
3173: */
3174: protected List getTransitionsRelatedByFromOptionIdJoinAttribute(
3175: Criteria criteria) throws TorqueException {
3176: if (collTransitionsRelatedByFromOptionId == null) {
3177: if (isNew()) {
3178: collTransitionsRelatedByFromOptionId = new ArrayList();
3179: } else {
3180: criteria.add(TransitionPeer.FROM_OPTION_ID,
3181: getOptionId());
3182: collTransitionsRelatedByFromOptionId = TransitionPeer
3183: .doSelectJoinAttribute(criteria);
3184: }
3185: } else {
3186: // the following code is to determine if a new query is
3187: // called for. If the criteria is the same as the last
3188: // one, just return the collection.
3189: criteria.add(TransitionPeer.FROM_OPTION_ID, getOptionId());
3190: if (!lastTransitionsRelatedByFromOptionIdCriteria
3191: .equals(criteria)) {
3192: collTransitionsRelatedByFromOptionId = TransitionPeer
3193: .doSelectJoinAttribute(criteria);
3194: }
3195: }
3196: lastTransitionsRelatedByFromOptionIdCriteria = criteria;
3197:
3198: return collTransitionsRelatedByFromOptionId;
3199: }
3200:
3201: /**
3202: * If this collection has already been initialized with
3203: * an identical criteria, it returns the collection.
3204: * Otherwise if this AttributeOption is new, it will return
3205: * an empty collection; or if this AttributeOption has previously
3206: * been saved, it will retrieve related TransitionsRelatedByFromOptionId from storage.
3207: *
3208: * This method is protected by default in order to keep the public
3209: * api reasonable. You can provide public methods for those you
3210: * actually need in AttributeOption.
3211: */
3212: protected List getTransitionsRelatedByFromOptionIdJoinAttributeOptionRelatedByToOptionId(
3213: Criteria criteria) throws TorqueException {
3214: if (collTransitionsRelatedByFromOptionId == null) {
3215: if (isNew()) {
3216: collTransitionsRelatedByFromOptionId = new ArrayList();
3217: } else {
3218: criteria.add(TransitionPeer.FROM_OPTION_ID,
3219: getOptionId());
3220: collTransitionsRelatedByFromOptionId = TransitionPeer
3221: .doSelectJoinAttributeOptionRelatedByToOptionId(criteria);
3222: }
3223: } else {
3224: // the following code is to determine if a new query is
3225: // called for. If the criteria is the same as the last
3226: // one, just return the collection.
3227: criteria.add(TransitionPeer.FROM_OPTION_ID, getOptionId());
3228: if (!lastTransitionsRelatedByFromOptionIdCriteria
3229: .equals(criteria)) {
3230: collTransitionsRelatedByFromOptionId = TransitionPeer
3231: .doSelectJoinAttributeOptionRelatedByToOptionId(criteria);
3232: }
3233: }
3234: lastTransitionsRelatedByFromOptionIdCriteria = criteria;
3235:
3236: return collTransitionsRelatedByFromOptionId;
3237: }
3238:
3239: /**
3240: * Collection to store aggregation of collTransitionsRelatedByToOptionId
3241: */
3242: protected List collTransitionsRelatedByToOptionId;
3243:
3244: /**
3245: * Temporary storage of collTransitionsRelatedByToOptionId to save a possible db hit in
3246: * the event objects are add to the collection, but the
3247: * complete collection is never requested.
3248: */
3249: protected void initTransitionsRelatedByToOptionId() {
3250: if (collTransitionsRelatedByToOptionId == null) {
3251: collTransitionsRelatedByToOptionId = new ArrayList();
3252: }
3253: }
3254:
3255: /**
3256: * Method called to associate a Transition object to this object
3257: * through the Transition foreign key attribute
3258: *
3259: * @param l Transition
3260: * @throws TorqueException
3261: */
3262: public void addTransitionRelatedByToOptionId(Transition l)
3263: throws TorqueException {
3264: getTransitionsRelatedByToOptionId().add(l);
3265: l.setAttributeOptionRelatedByToOptionId((AttributeOption) this );
3266: }
3267:
3268: /**
3269: * The criteria used to select the current contents of collTransitionsRelatedByToOptionId
3270: */
3271: private Criteria lastTransitionsRelatedByToOptionIdCriteria = null;
3272:
3273: /**
3274: * If this collection has already been initialized, returns
3275: * the collection. Otherwise returns the results of
3276: * getTransitionsRelatedByToOptionId(new Criteria())
3277: *
3278: * @return the collection of associated objects
3279: * @throws TorqueException
3280: */
3281: public List getTransitionsRelatedByToOptionId()
3282: throws TorqueException {
3283: if (collTransitionsRelatedByToOptionId == null) {
3284: collTransitionsRelatedByToOptionId = getTransitionsRelatedByToOptionId(new Criteria(
3285: 10));
3286: }
3287: return collTransitionsRelatedByToOptionId;
3288: }
3289:
3290: /**
3291: * If this collection has already been initialized with
3292: * an identical criteria, it returns the collection.
3293: * Otherwise if this AttributeOption has previously
3294: * been saved, it will retrieve related TransitionsRelatedByToOptionId from storage.
3295: * If this AttributeOption is new, it will return
3296: * an empty collection or the current collection, the criteria
3297: * is ignored on a new object.
3298: *
3299: * @throws TorqueException
3300: */
3301: public List getTransitionsRelatedByToOptionId(Criteria criteria)
3302: throws TorqueException {
3303: if (collTransitionsRelatedByToOptionId == null) {
3304: if (isNew()) {
3305: collTransitionsRelatedByToOptionId = new ArrayList();
3306: } else {
3307: criteria
3308: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3309: collTransitionsRelatedByToOptionId = TransitionPeer
3310: .doSelect(criteria);
3311: }
3312: } else {
3313: // criteria has no effect for a new object
3314: if (!isNew()) {
3315: // the following code is to determine if a new query is
3316: // called for. If the criteria is the same as the last
3317: // one, just return the collection.
3318: criteria
3319: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3320: if (!lastTransitionsRelatedByToOptionIdCriteria
3321: .equals(criteria)) {
3322: collTransitionsRelatedByToOptionId = TransitionPeer
3323: .doSelect(criteria);
3324: }
3325: }
3326: }
3327: lastTransitionsRelatedByToOptionIdCriteria = criteria;
3328:
3329: return collTransitionsRelatedByToOptionId;
3330: }
3331:
3332: /**
3333: * If this collection has already been initialized, returns
3334: * the collection. Otherwise returns the results of
3335: * getTransitionsRelatedByToOptionId(new Criteria(),Connection)
3336: * This method takes in the Connection also as input so that
3337: * referenced objects can also be obtained using a Connection
3338: * that is taken as input
3339: */
3340: public List getTransitionsRelatedByToOptionId(Connection con)
3341: throws TorqueException {
3342: if (collTransitionsRelatedByToOptionId == null) {
3343: collTransitionsRelatedByToOptionId = getTransitionsRelatedByToOptionId(
3344: new Criteria(10), con);
3345: }
3346: return collTransitionsRelatedByToOptionId;
3347: }
3348:
3349: /**
3350: * If this collection has already been initialized with
3351: * an identical criteria, it returns the collection.
3352: * Otherwise if this AttributeOption has previously
3353: * been saved, it will retrieve related TransitionsRelatedByToOptionId from storage.
3354: * If this AttributeOption is new, it will return
3355: * an empty collection or the current collection, the criteria
3356: * is ignored on a new object.
3357: * This method takes in the Connection also as input so that
3358: * referenced objects can also be obtained using a Connection
3359: * that is taken as input
3360: */
3361: public List getTransitionsRelatedByToOptionId(Criteria criteria,
3362: Connection con) throws TorqueException {
3363: if (collTransitionsRelatedByToOptionId == null) {
3364: if (isNew()) {
3365: collTransitionsRelatedByToOptionId = new ArrayList();
3366: } else {
3367: criteria
3368: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3369: collTransitionsRelatedByToOptionId = TransitionPeer
3370: .doSelect(criteria, con);
3371: }
3372: } else {
3373: // criteria has no effect for a new object
3374: if (!isNew()) {
3375: // the following code is to determine if a new query is
3376: // called for. If the criteria is the same as the last
3377: // one, just return the collection.
3378: criteria
3379: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3380: if (!lastTransitionsRelatedByToOptionIdCriteria
3381: .equals(criteria)) {
3382: collTransitionsRelatedByToOptionId = TransitionPeer
3383: .doSelect(criteria, con);
3384: }
3385: }
3386: }
3387: lastTransitionsRelatedByToOptionIdCriteria = criteria;
3388:
3389: return collTransitionsRelatedByToOptionId;
3390: }
3391:
3392: /**
3393: * If this collection has already been initialized with
3394: * an identical criteria, it returns the collection.
3395: * Otherwise if this AttributeOption is new, it will return
3396: * an empty collection; or if this AttributeOption has previously
3397: * been saved, it will retrieve related TransitionsRelatedByToOptionId from storage.
3398: *
3399: * This method is protected by default in order to keep the public
3400: * api reasonable. You can provide public methods for those you
3401: * actually need in AttributeOption.
3402: */
3403: protected List getTransitionsRelatedByToOptionIdJoinAttribute(
3404: Criteria criteria) throws TorqueException {
3405: if (collTransitionsRelatedByToOptionId == null) {
3406: if (isNew()) {
3407: collTransitionsRelatedByToOptionId = new ArrayList();
3408: } else {
3409: criteria
3410: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3411: collTransitionsRelatedByToOptionId = TransitionPeer
3412: .doSelectJoinAttribute(criteria);
3413: }
3414: } else {
3415: // the following code is to determine if a new query is
3416: // called for. If the criteria is the same as the last
3417: // one, just return the collection.
3418: criteria.add(TransitionPeer.TO_OPTION_ID, getOptionId());
3419: if (!lastTransitionsRelatedByToOptionIdCriteria
3420: .equals(criteria)) {
3421: collTransitionsRelatedByToOptionId = TransitionPeer
3422: .doSelectJoinAttribute(criteria);
3423: }
3424: }
3425: lastTransitionsRelatedByToOptionIdCriteria = criteria;
3426:
3427: return collTransitionsRelatedByToOptionId;
3428: }
3429:
3430: /**
3431: * If this collection has already been initialized with
3432: * an identical criteria, it returns the collection.
3433: * Otherwise if this AttributeOption is new, it will return
3434: * an empty collection; or if this AttributeOption has previously
3435: * been saved, it will retrieve related TransitionsRelatedByToOptionId from storage.
3436: *
3437: * This method is protected by default in order to keep the public
3438: * api reasonable. You can provide public methods for those you
3439: * actually need in AttributeOption.
3440: */
3441: protected List getTransitionsRelatedByToOptionIdJoinAttributeOptionRelatedByFromOptionId(
3442: Criteria criteria) throws TorqueException {
3443: if (collTransitionsRelatedByToOptionId == null) {
3444: if (isNew()) {
3445: collTransitionsRelatedByToOptionId = new ArrayList();
3446: } else {
3447: criteria
3448: .add(TransitionPeer.TO_OPTION_ID, getOptionId());
3449: collTransitionsRelatedByToOptionId = TransitionPeer
3450: .doSelectJoinAttributeOptionRelatedByFromOptionId(criteria);
3451: }
3452: } else {
3453: // the following code is to determine if a new query is
3454: // called for. If the criteria is the same as the last
3455: // one, just return the collection.
3456: criteria.add(TransitionPeer.TO_OPTION_ID, getOptionId());
3457: if (!lastTransitionsRelatedByToOptionIdCriteria
3458: .equals(criteria)) {
3459: collTransitionsRelatedByToOptionId = TransitionPeer
3460: .doSelectJoinAttributeOptionRelatedByFromOptionId(criteria);
3461: }
3462: }
3463: lastTransitionsRelatedByToOptionIdCriteria = criteria;
3464:
3465: return collTransitionsRelatedByToOptionId;
3466: }
3467:
3468: private static List fieldNames = null;
3469:
3470: /**
3471: * Generate a list of field names.
3472: *
3473: * @return a list of field names
3474: */
3475: public static synchronized List getFieldNames() {
3476: if (fieldNames == null) {
3477: fieldNames = new ArrayList();
3478: fieldNames.add("OptionId");
3479: fieldNames.add("AttributeId");
3480: fieldNames.add("Name");
3481: fieldNames.add("Deleted");
3482: fieldNames = Collections.unmodifiableList(fieldNames);
3483: }
3484: return fieldNames;
3485: }
3486:
3487: /**
3488: * Retrieves a field from the object by name passed in as a String.
3489: *
3490: * @param name field name
3491: * @return value
3492: */
3493: public Object getByName(String name) {
3494: if (name.equals("OptionId")) {
3495: return getOptionId();
3496: }
3497: if (name.equals("AttributeId")) {
3498: return getAttributeId();
3499: }
3500: if (name.equals("Name")) {
3501: return getName();
3502: }
3503: if (name.equals("Deleted")) {
3504: return Boolean.valueOf(getDeleted());
3505: }
3506: return null;
3507: }
3508:
3509: /**
3510: * Retrieves a field from the object by name passed in
3511: * as a String. The String must be one of the static
3512: * Strings defined in this Class' Peer.
3513: *
3514: * @param name peer name
3515: * @return value
3516: */
3517: public Object getByPeerName(String name) {
3518: if (name.equals(AttributeOptionPeer.OPTION_ID)) {
3519: return getOptionId();
3520: }
3521: if (name.equals(AttributeOptionPeer.ATTRIBUTE_ID)) {
3522: return getAttributeId();
3523: }
3524: if (name.equals(AttributeOptionPeer.OPTION_NAME)) {
3525: return getName();
3526: }
3527: if (name.equals(AttributeOptionPeer.DELETED)) {
3528: return Boolean.valueOf(getDeleted());
3529: }
3530: return null;
3531: }
3532:
3533: /**
3534: * Retrieves a field from the object by Position as specified
3535: * in the xml schema. Zero-based.
3536: *
3537: * @param pos position in xml schema
3538: * @return value
3539: */
3540: public Object getByPosition(int pos) {
3541: if (pos == 0) {
3542: return getOptionId();
3543: }
3544: if (pos == 1) {
3545: return getAttributeId();
3546: }
3547: if (pos == 2) {
3548: return getName();
3549: }
3550: if (pos == 3) {
3551: return Boolean.valueOf(getDeleted());
3552: }
3553: return null;
3554: }
3555:
3556: /**
3557: * Stores the object in the database. If the object is new,
3558: * it inserts it; otherwise an update is performed.
3559: *
3560: * @throws TorqueException
3561: */
3562: public void save() throws TorqueException {
3563: save(AttributeOptionPeer.getMapBuilder().getDatabaseMap()
3564: .getName());
3565: }
3566:
3567: /**
3568: * Stores the object in the database. If the object is new,
3569: * it inserts it; otherwise an update is performed.
3570: * Note: this code is here because the method body is
3571: * auto-generated conditionally and therefore needs to be
3572: * in this file instead of in the super class, BaseObject.
3573: *
3574: * @param dbName
3575: * @throws TorqueException
3576: */
3577: public void save(String dbName) throws TorqueException {
3578: Connection con = null;
3579: try {
3580: con = Transaction.begin(dbName);
3581: save(con);
3582: Transaction.commit(con);
3583: } catch (TorqueException e) {
3584: Transaction.safeRollback(con);
3585: throw e;
3586: }
3587: }
3588:
3589: /** flag to prevent endless save loop, if this object is referenced
3590: by another object which falls in this transaction. */
3591: private boolean alreadyInSave = false;
3592:
3593: /**
3594: * Stores the object in the database. If the object is new,
3595: * it inserts it; otherwise an update is performed. This method
3596: * is meant to be used as part of a transaction, otherwise use
3597: * the save() method and the connection details will be handled
3598: * internally
3599: *
3600: * @param con
3601: * @throws TorqueException
3602: */
3603: public void save(Connection con) throws TorqueException {
3604: if (!alreadyInSave) {
3605: alreadyInSave = true;
3606:
3607: // If this object has been modified, then save it to the database.
3608: if (isModified()) {
3609: if (isNew()) {
3610: AttributeOptionPeer.doInsert(
3611: (AttributeOption) this , con);
3612: setNew(false);
3613: } else {
3614: AttributeOptionPeer.doUpdate(
3615: (AttributeOption) this , con);
3616: }
3617:
3618: if (isCacheOnSave()) {
3619: AttributeOptionManager.putInstance(this );
3620: }
3621: }
3622:
3623: if (collActivitysRelatedByOldOptionId != null) {
3624: for (int i = 0; i < collActivitysRelatedByOldOptionId
3625: .size(); i++) {
3626: ((Activity) collActivitysRelatedByOldOptionId
3627: .get(i)).save(con);
3628: }
3629: }
3630:
3631: if (collActivitysRelatedByNewOptionId != null) {
3632: for (int i = 0; i < collActivitysRelatedByNewOptionId
3633: .size(); i++) {
3634: ((Activity) collActivitysRelatedByNewOptionId
3635: .get(i)).save(con);
3636: }
3637: }
3638:
3639: if (collAttributes != null) {
3640: for (int i = 0; i < collAttributes.size(); i++) {
3641: ((Attribute) collAttributes.get(i)).save(con);
3642: }
3643: }
3644:
3645: if (collConditions != null) {
3646: for (int i = 0; i < collConditions.size(); i++) {
3647: ((Condition) collConditions.get(i)).save(con);
3648: }
3649: }
3650:
3651: if (collAttributeValues != null) {
3652: for (int i = 0; i < collAttributeValues.size(); i++) {
3653: ((AttributeValue) collAttributeValues.get(i))
3654: .save(con);
3655: }
3656: }
3657:
3658: if (collRModuleOptions != null) {
3659: for (int i = 0; i < collRModuleOptions.size(); i++) {
3660: ((RModuleOption) collRModuleOptions.get(i))
3661: .save(con);
3662: }
3663: }
3664:
3665: if (collRIssueTypeOptions != null) {
3666: for (int i = 0; i < collRIssueTypeOptions.size(); i++) {
3667: ((RIssueTypeOption) collRIssueTypeOptions.get(i))
3668: .save(con);
3669: }
3670: }
3671:
3672: if (collROptionOptionsRelatedByOption1Id != null) {
3673: for (int i = 0; i < collROptionOptionsRelatedByOption1Id
3674: .size(); i++) {
3675: ((ROptionOption) collROptionOptionsRelatedByOption1Id
3676: .get(i)).save(con);
3677: }
3678: }
3679:
3680: if (collROptionOptionsRelatedByOption2Id != null) {
3681: for (int i = 0; i < collROptionOptionsRelatedByOption2Id
3682: .size(); i++) {
3683: ((ROptionOption) collROptionOptionsRelatedByOption2Id
3684: .get(i)).save(con);
3685: }
3686: }
3687:
3688: if (collTransitionsRelatedByFromOptionId != null) {
3689: for (int i = 0; i < collTransitionsRelatedByFromOptionId
3690: .size(); i++) {
3691: ((Transition) collTransitionsRelatedByFromOptionId
3692: .get(i)).save(con);
3693: }
3694: }
3695:
3696: if (collTransitionsRelatedByToOptionId != null) {
3697: for (int i = 0; i < collTransitionsRelatedByToOptionId
3698: .size(); i++) {
3699: ((Transition) collTransitionsRelatedByToOptionId
3700: .get(i)).save(con);
3701: }
3702: }
3703: alreadyInSave = false;
3704: }
3705: }
3706:
3707: /**
3708: * Specify whether to cache the object after saving to the db.
3709: * This method returns true
3710: */
3711: protected boolean isCacheOnSave() {
3712: return true;
3713: }
3714:
3715: /**
3716: * Set the PrimaryKey using ObjectKey.
3717: *
3718: * @param key optionId ObjectKey
3719: */
3720: public void setPrimaryKey(ObjectKey key) throws TorqueException {
3721: setOptionId(new Integer(((NumberKey) key).intValue()));
3722: }
3723:
3724: /**
3725: * Set the PrimaryKey using a String.
3726: *
3727: * @param key
3728: */
3729: public void setPrimaryKey(String key) throws TorqueException {
3730: setOptionId(new Integer(key));
3731: }
3732:
3733: /**
3734: * returns an id that differentiates this object from others
3735: * of its class.
3736: */
3737: public ObjectKey getPrimaryKey() {
3738: return SimpleKey.keyFor(getOptionId());
3739: }
3740:
3741: /**
3742: * get an id that differentiates this object from others
3743: * of its class.
3744: */
3745: public String getQueryKey() {
3746: if (getPrimaryKey() == null) {
3747: return "";
3748: } else {
3749: return getPrimaryKey().toString();
3750: }
3751: }
3752:
3753: /**
3754: * set an id that differentiates this object from others
3755: * of its class.
3756: */
3757: public void setQueryKey(String key) throws TorqueException {
3758: setPrimaryKey(key);
3759: }
3760:
3761: /**
3762: * Makes a copy of this object.
3763: * It creates a new object filling in the simple attributes.
3764: * It then fills all the association collections and sets the
3765: * related objects to isNew=true.
3766: */
3767: public AttributeOption copy() throws TorqueException {
3768: return copyInto(new AttributeOption());
3769: }
3770:
3771: protected AttributeOption copyInto(AttributeOption copyObj)
3772: throws TorqueException {
3773: copyObj.setOptionId(optionId);
3774: copyObj.setAttributeId(attributeId);
3775: copyObj.setName(name);
3776: copyObj.setDeleted(deleted);
3777:
3778: copyObj.setOptionId((Integer) null);
3779:
3780: List v = getActivitysRelatedByOldOptionId();
3781: if (v != null) {
3782: for (int i = 0; i < v.size(); i++) {
3783: Activity obj = (Activity) v.get(i);
3784: copyObj.addActivityRelatedByOldOptionId(obj.copy());
3785: }
3786: } else {
3787: copyObj.collActivitysRelatedByOldOptionId = null;
3788: }
3789:
3790: v = getActivitysRelatedByNewOptionId();
3791: if (v != null) {
3792: for (int i = 0; i < v.size(); i++) {
3793: Activity obj = (Activity) v.get(i);
3794: copyObj.addActivityRelatedByNewOptionId(obj.copy());
3795: }
3796: } else {
3797: copyObj.collActivitysRelatedByNewOptionId = null;
3798: }
3799:
3800: v = getAttributes();
3801: if (v != null) {
3802: for (int i = 0; i < v.size(); i++) {
3803: Attribute obj = (Attribute) v.get(i);
3804: copyObj.addAttribute(obj.copy());
3805: }
3806: } else {
3807: copyObj.collAttributes = null;
3808: }
3809:
3810: v = getConditions();
3811: if (v != null) {
3812: for (int i = 0; i < v.size(); i++) {
3813: Condition obj = (Condition) v.get(i);
3814: copyObj.addCondition(obj.copy());
3815: }
3816: } else {
3817: copyObj.collConditions = null;
3818: }
3819:
3820: v = getAttributeValues();
3821: if (v != null) {
3822: for (int i = 0; i < v.size(); i++) {
3823: AttributeValue obj = (AttributeValue) v.get(i);
3824: copyObj.addAttributeValue(obj.copy());
3825: }
3826: } else {
3827: copyObj.collAttributeValues = null;
3828: }
3829:
3830: v = getRModuleOptions();
3831: if (v != null) {
3832: for (int i = 0; i < v.size(); i++) {
3833: RModuleOption obj = (RModuleOption) v.get(i);
3834: copyObj.addRModuleOption(obj.copy());
3835: }
3836: } else {
3837: copyObj.collRModuleOptions = null;
3838: }
3839:
3840: v = getRIssueTypeOptions();
3841: if (v != null) {
3842: for (int i = 0; i < v.size(); i++) {
3843: RIssueTypeOption obj = (RIssueTypeOption) v.get(i);
3844: copyObj.addRIssueTypeOption(obj.copy());
3845: }
3846: } else {
3847: copyObj.collRIssueTypeOptions = null;
3848: }
3849:
3850: v = getROptionOptionsRelatedByOption1Id();
3851: if (v != null) {
3852: for (int i = 0; i < v.size(); i++) {
3853: ROptionOption obj = (ROptionOption) v.get(i);
3854: copyObj.addROptionOptionRelatedByOption1Id(obj.copy());
3855: }
3856: } else {
3857: copyObj.collROptionOptionsRelatedByOption1Id = null;
3858: }
3859:
3860: v = getROptionOptionsRelatedByOption2Id();
3861: if (v != null) {
3862: for (int i = 0; i < v.size(); i++) {
3863: ROptionOption obj = (ROptionOption) v.get(i);
3864: copyObj.addROptionOptionRelatedByOption2Id(obj.copy());
3865: }
3866: } else {
3867: copyObj.collROptionOptionsRelatedByOption2Id = null;
3868: }
3869:
3870: v = getTransitionsRelatedByFromOptionId();
3871: if (v != null) {
3872: for (int i = 0; i < v.size(); i++) {
3873: Transition obj = (Transition) v.get(i);
3874: copyObj.addTransitionRelatedByFromOptionId(obj.copy());
3875: }
3876: } else {
3877: copyObj.collTransitionsRelatedByFromOptionId = null;
3878: }
3879:
3880: v = getTransitionsRelatedByToOptionId();
3881: if (v != null) {
3882: for (int i = 0; i < v.size(); i++) {
3883: Transition obj = (Transition) v.get(i);
3884: copyObj.addTransitionRelatedByToOptionId(obj.copy());
3885: }
3886: } else {
3887: copyObj.collTransitionsRelatedByToOptionId = null;
3888: }
3889: return copyObj;
3890: }
3891:
3892: /**
3893: * returns a peer instance associated with this om. Since Peer classes
3894: * are not to have any instance attributes, this method returns the
3895: * same instance for all member of this class. The method could therefore
3896: * be static, but this would prevent one from overriding the behavior.
3897: */
3898: public AttributeOptionPeer getPeer() {
3899: return peer;
3900: }
3901:
3902: public String toString() {
3903: StringBuffer str = new StringBuffer();
3904: str.append("AttributeOption:\n");
3905: str.append("OptionId = ").append(getOptionId()).append("\n");
3906: str.append("AttributeId = ").append(getAttributeId()).append(
3907: "\n");
3908: str.append("Name = ").append(getName()).append("\n");
3909: str.append("Deleted = ").append(getDeleted()).append("\n");
3910: return (str.toString());
3911: }
3912: }
|