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