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