1packageorg.apache.jetspeed.om.security.turbine;
23import java.math.BigDecimal;
4import java.sql.Connection;
5import java.sql.SQLException;
6import java.util.ArrayList;
7import java.util.Date;
8import java.util.Iterator;
9import java.util.LinkedList;
10import java.util.List;
1112import org.apache.torque.NoRowsException;
13import org.apache.torque.TooManyRowsException;
14import org.apache.torque.Torque;
15import org.apache.torque.TorqueException;
16import org.apache.torque.map.MapBuilder;
17import org.apache.torque.map.TableMap;
18import org.apache.torque.om.DateKey;
19import org.apache.torque.om.NumberKey;
20import org.apache.torque.om.StringKey;
21import org.apache.torque.om.ObjectKey;
22import org.apache.torque.om.SimpleKey;
23import org.apache.torque.util.BasePeer;
24import org.apache.torque.util.Criteria;
2526import com.workingdogs.village.DataSetException;
27import com.workingdogs.village.QueryDataSet;
28import com.workingdogs.village.Record;
2930// Local classes31importorg.apache.jetspeed.om.security.turbine.map.*;
323334353637/***38 * This class was autogenerated by Torque on:39 *40 * [Thu Apr 22 23:12:36 EDT 2004]41 *42 */43publicabstractclassBaseTurbineUserGroupRolePeer44extends BasePeer
45 {
4647/*** the default database name for this class */48publicstaticfinal String DATABASE_NAME = "default";
4950/*** the table name for this class */51publicstaticfinal String TABLE_NAME = "TURBINE_USER_GROUP_ROLE";
5253/***54 * @return the map builder for this peer55 * @throws TorqueException Any exceptions caught during processing will be56 * rethrown wrapped into a TorqueException.57 */58publicstatic MapBuilder getMapBuilder()
59 throws TorqueException
60 {
61return getMapBuilder(TurbineUserGroupRoleMapBuilder.CLASS_NAME);
62 }
6364/*** the column name for the USER_ID field */65publicstaticfinal String USER_ID;
66/*** the column name for the GROUP_ID field */67publicstaticfinal String GROUP_ID;
68/*** the column name for the ROLE_ID field */69publicstaticfinal String ROLE_ID;
7071static72 {
73 USER_ID = "TURBINE_USER_GROUP_ROLE.USER_ID";
74 GROUP_ID = "TURBINE_USER_GROUP_ROLE.GROUP_ID";
75 ROLE_ID = "TURBINE_USER_GROUP_ROLE.ROLE_ID";
76if (Torque.isInit())
77 {
78try79 {
80 getMapBuilder();
81 }
82catch (Exception e)
83 {
84 log.error("Could not initialize Peer", e);
85 }
86 }
87else88 {
89 Torque.registerMapBuilder(TurbineUserGroupRoleMapBuilder.CLASS_NAME);
90 }
91 }
9293/*** number of columns for this peer */94publicstaticfinalint numColumns = 3;
9596/*** A class that can be returned by this peer. */97protectedstaticfinal String CLASSNAME_DEFAULT =
98"org.apache.jetspeed.om.security.turbine.TurbineUserGroupRole";
99100/*** A class that can be returned by this peer. */101protectedstaticfinal Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
102103/***104 * Class object initialization method.105 *106 * @param className name of the class to initialize107 * @return the initialized class108 */109privatestatic Class initClass(String className)
110 {
111 Class c = null;
112try113 {
114 c = Class.forName(className);
115 }
116catch (Throwable t)
117 {
118 log.error("A FATAL ERROR has occurred which should not "119 + "have happened under any circumstance. Please notify "120 + "the Torque developers <turbine-torque-dev@jakarta.apache.org> "121 + "and give as many details as possible (including the error "122 + "stack trace).", t);
123124// Error objects should always be propogated.125if (t instanceof Error)
126 {
127throw (Error) t.fillInStackTrace();
128 }
129 }
130return c;
131 }
132133/***134 * Get the list of objects for a ResultSet. Please not that your135 * resultset MUST return columns in the right order. You can use136 * getFieldNames() in BaseObject to get the correct sequence.137 *138 * @param results the ResultSet139 * @return the list of objects140 * @throws TorqueException Any exceptions caught during processing will be141 * rethrown wrapped into a TorqueException.142 */143publicstatic List resultSet2Objects(java.sql.ResultSet results)
144 throws TorqueException
145 {
146try147 {
148 QueryDataSet qds = null;
149 List rows = null;
150try151 {
152 qds = new QueryDataSet(results);
153 rows = getSelectResults(qds);
154 }
155finally156 {
157if (qds != null)
158 {
159 qds.close();
160 }
161 }
162163return populateObjects(rows);
164 }
165catch (SQLException e)
166 {
167thrownew TorqueException(e);
168 }
169catch (DataSetException e)
170 {
171thrownew TorqueException(e);
172 }
173 }
174175176177/***178 * Method to do inserts.179 *180 * @param criteria object used to create the INSERT statement.181 * @throws TorqueException Any exceptions caught during processing will be182 * rethrown wrapped into a TorqueException.183 */184publicstatic ObjectKey doInsert(Criteria criteria)
185 throws TorqueException
186 {
187returnBaseTurbineUserGroupRolePeer188 .doInsert(criteria, (Connection) null);
189 }
190191/***192 * Method to do inserts. This method is to be used during a transaction,193 * otherwise use the doInsert(Criteria) method. It will take care of194 * the connection details internally.195 *196 * @param criteria object used to create the INSERT statement.197 * @param con the connection to use198 * @throws TorqueException Any exceptions caught during processing will be199 * rethrown wrapped into a TorqueException.200 */201publicstatic ObjectKey doInsert(Criteria criteria, Connection con)
202 throws TorqueException
203 {
204205// Set the correct dbName if it has not been overridden206// criteria.getDbName will return the same object if not set to207// another value so == check is okay and faster208if (criteria.getDbName() == Torque.getDefaultDB())
209 {
210 criteria.setDbName(DATABASE_NAME);
211 }
212if (con == null)
213 {
214return BasePeer.doInsert(criteria);
215 }
216else217 {
218return BasePeer.doInsert(criteria, con);
219 }
220 }
221222/***223 * Add all the columns needed to create a new object.224 *225 * @param criteria object containing the columns to add.226 * @throws TorqueException Any exceptions caught during processing will be227 * rethrown wrapped into a TorqueException.228 */229publicstaticvoid addSelectColumns(Criteria criteria)
230 throws TorqueException
231 {
232 criteria.addSelectColumn(USER_ID);
233 criteria.addSelectColumn(GROUP_ID);
234 criteria.addSelectColumn(ROLE_ID);
235 }
236237/***238 * Create a new object of type cls from a resultset row starting239 * from a specified offset. This is done so that you can select240 * other rows than just those needed for this object. You may241 * for example want to create two objects from the same row.242 *243 * @throws TorqueException Any exceptions caught during processing will be244 * rethrown wrapped into a TorqueException.245 */246publicstaticTurbineUserGroupRole row2Object(Record row,
247int offset,
248 Class cls)
249 throws TorqueException
250 {
251try252 {
253TurbineUserGroupRole obj = (TurbineUserGroupRole) cls.newInstance();
254 TurbineUserGroupRolePeer.populateObject(row, offset, obj);
255 obj.setModified(false);
256 obj.setNew(false);
257258return obj;
259 }
260catch (InstantiationException e)
261 {
262thrownew TorqueException(e);
263 }
264catch (IllegalAccessException e)
265 {
266thrownew TorqueException(e);
267 }
268 }
269270/***271 * Populates an object from a resultset row starting272 * from a specified offset. This is done so that you can select273 * other rows than just those needed for this object. You may274 * for example want to create two objects from the same row.275 *276 * @throws TorqueException Any exceptions caught during processing will be277 * rethrown wrapped into a TorqueException.278 */279publicstaticvoid populateObject(Record row,
280int offset,
281TurbineUserGroupRole obj)
282 throws TorqueException
283 {
284try285 {
286 obj.setUserId(row.getValue(offset + 0).asInt());
287 obj.setGroupId(row.getValue(offset + 1).asInt());
288 obj.setRoleId(row.getValue(offset + 2).asInt());
289 }
290catch (DataSetException e)
291 {
292thrownew TorqueException(e);
293 }
294 }
295296/***297 * Method to do selects.298 *299 * @param criteria object used to create the SELECT statement.300 * @return List of selected Objects301 * @throws TorqueException Any exceptions caught during processing will be302 * rethrown wrapped into a TorqueException.303 */304publicstatic List doSelect(Criteria criteria) throws TorqueException
305 {
306return populateObjects(doSelectVillageRecords(criteria));
307 }
308309/***310 * Method to do selects within a transaction.311 *312 * @param criteria object used to create the SELECT statement.313 * @param con the connection to use314 * @return List of selected Objects315 * @throws TorqueException Any exceptions caught during processing will be316 * rethrown wrapped into a TorqueException.317 */318publicstatic List doSelect(Criteria criteria, Connection con)
319 throws TorqueException
320 {
321return populateObjects(doSelectVillageRecords(criteria, con));
322 }
323324/***325 * Grabs the raw Village records to be formed into objects.326 * This method handles connections internally. The Record objects327 * returned by this method should be considered readonly. Do not328 * alter the data and call save(), your results may vary, but are329 * certainly likely to result in hard to track MT bugs.330 *331 * @throws TorqueException Any exceptions caught during processing will be332 * rethrown wrapped into a TorqueException.333 */334publicstatic List doSelectVillageRecords(Criteria criteria)
335 throws TorqueException
336 {
337returnBaseTurbineUserGroupRolePeer338 .doSelectVillageRecords(criteria, (Connection) null);
339 }
340341/***342 * Grabs the raw Village records to be formed into objects.343 * This method should be used for transactions344 *345 * @param con the connection to use346 * @throws TorqueException Any exceptions caught during processing will be347 * rethrown wrapped into a TorqueException.348 */349publicstatic List doSelectVillageRecords(Criteria criteria, Connection con)
350 throws TorqueException
351 {
352if (criteria.getSelectColumns().size() == 0)
353 {
354 addSelectColumns(criteria);
355 }
356357358// Set the correct dbName if it has not been overridden359// criteria.getDbName will return the same object if not set to360// another value so == check is okay and faster361if (criteria.getDbName() == Torque.getDefaultDB())
362 {
363 criteria.setDbName(DATABASE_NAME);
364 }
365// BasePeer returns a List of Value (Village) arrays. The array366// order follows the order columns were placed in the Select clause.367if (con == null)
368 {
369return BasePeer.doSelect(criteria);
370 }
371else372 {
373return BasePeer.doSelect(criteria, con);
374 }
375 }
376377/***378 * The returned List will contain objects of the default type or379 * objects that inherit from the default.380 *381 * @throws TorqueException Any exceptions caught during processing will be382 * rethrown wrapped into a TorqueException.383 */384publicstatic List populateObjects(List records)
385 throws TorqueException
386 {
387 List results = new ArrayList(records.size());
388389// populate the object(s)390for (int i = 0; i < records.size(); i++)
391 {
392 Record row = (Record) records.get(i);
393 results.add(TurbineUserGroupRolePeer.row2Object(row, 1,
394 TurbineUserGroupRolePeer.getOMClass()));
395 }
396return results;
397 }
398399400/***401 * The class that the Peer will make instances of.402 * If the BO is abstract then you must implement this method403 * in the BO.404 *405 * @throws TorqueException Any exceptions caught during processing will be406 * rethrown wrapped into a TorqueException.407 */408publicstatic Class getOMClass()
409 throws TorqueException
410 {
411return CLASS_DEFAULT;
412 }
413414/***415 * Method to do updates.416 *417 * @param criteria object containing data that is used to create the UPDATE418 * statement.419 * @throws TorqueException Any exceptions caught during processing will be420 * rethrown wrapped into a TorqueException.421 */422publicstaticvoid doUpdate(Criteria criteria) throws TorqueException
423 {
424BaseTurbineUserGroupRolePeer425 .doUpdate(criteria, (Connection) null);
426 }
427428/***429 * Method to do updates. This method is to be used during a transaction,430 * otherwise use the doUpdate(Criteria) method. It will take care of431 * the connection details internally.432 *433 * @param criteria object containing data that is used to create the UPDATE434 * statement.435 * @param con the connection to use436 * @throws TorqueException Any exceptions caught during processing will be437 * rethrown wrapped into a TorqueException.438 */439publicstaticvoid doUpdate(Criteria criteria, Connection con)
440 throws TorqueException
441 {
442 Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
443 selectCriteria.put(USER_ID, criteria.remove(USER_ID));
444 selectCriteria.put(GROUP_ID, criteria.remove(GROUP_ID));
445 selectCriteria.put(ROLE_ID, criteria.remove(ROLE_ID));
446447// Set the correct dbName if it has not been overridden448// criteria.getDbName will return the same object if not set to449// another value so == check is okay and faster450if (criteria.getDbName() == Torque.getDefaultDB())
451 {
452 criteria.setDbName(DATABASE_NAME);
453 }
454if (con == null)
455 {
456 BasePeer.doUpdate(selectCriteria, criteria);
457 }
458else459 {
460 BasePeer.doUpdate(selectCriteria, criteria, con);
461 }
462 }
463464/***465 * Method to do deletes.466 *467 * @param criteria object containing data that is used DELETE from database.468 * @throws TorqueException Any exceptions caught during processing will be469 * rethrown wrapped into a TorqueException.470 */471publicstaticvoid doDelete(Criteria criteria) throws TorqueException
472 {
473BaseTurbineUserGroupRolePeer474 .doDelete(criteria, (Connection) null);
475 }
476477/***478 * Method to do deletes. This method is to be used during a transaction,479 * otherwise use the doDelete(Criteria) method. It will take care of480 * the connection details internally.481 *482 * @param criteria object containing data that is used DELETE from database.483 * @param con the connection to use484 * @throws TorqueException Any exceptions caught during processing will be485 * rethrown wrapped into a TorqueException.486 */487publicstaticvoid doDelete(Criteria criteria, Connection con)
488 throws TorqueException
489 {
490491// Set the correct dbName if it has not been overridden492// criteria.getDbName will return the same object if not set to493// another value so == check is okay and faster494if (criteria.getDbName() == Torque.getDefaultDB())
495 {
496 criteria.setDbName(DATABASE_NAME);
497 }
498if (con == null)
499 {
500 BasePeer.doDelete(criteria);
501 }
502else503 {
504 BasePeer.doDelete(criteria, con);
505 }
506 }
507508/***509 * Method to do selects510 *511 * @throws TorqueException Any exceptions caught during processing will be512 * rethrown wrapped into a TorqueException.513 */514publicstatic List doSelect(TurbineUserGroupRole obj) throws TorqueException
515 {
516return doSelect(buildCriteria(obj));
517 }
518519/***520 * Method to do inserts521 *522 * @throws TorqueException Any exceptions caught during processing will be523 * rethrown wrapped into a TorqueException.524 */525publicstaticvoid doInsert(TurbineUserGroupRole obj) throws TorqueException
526 {
527 doInsert(buildCriteria(obj));
528 obj.setNew(false);
529 obj.setModified(false);
530 }
531532/***533 * @param obj the data object to update in the database.534 * @throws TorqueException Any exceptions caught during processing will be535 * rethrown wrapped into a TorqueException.536 */537publicstaticvoid doUpdate(TurbineUserGroupRole obj) throws TorqueException
538 {
539 doUpdate(buildCriteria(obj));
540 obj.setModified(false);
541 }
542543/***544 * @param obj the data object to delete in the database.545 * @throws TorqueException Any exceptions caught during processing will be546 * rethrown wrapped into a TorqueException.547 */548publicstaticvoid doDelete(TurbineUserGroupRole obj) throws TorqueException
549 {
550 doDelete(buildCriteria(obj));
551 }
552553/***554 * Method to do inserts. This method is to be used during a transaction,555 * otherwise use the doInsert(TurbineUserGroupRole) method. It will take556 * care of the connection details internally.557 *558 * @param obj the data object to insert into the database.559 * @param con the connection to use560 * @throws TorqueException Any exceptions caught during processing will be561 * rethrown wrapped into a TorqueException.562 */563publicstaticvoid doInsert(TurbineUserGroupRole obj, Connection con)
564 throws TorqueException
565 {
566 doInsert(buildCriteria(obj), con);
567 obj.setNew(false);
568 obj.setModified(false);
569 }
570571/***572 * Method to do update. This method is to be used during a transaction,573 * otherwise use the doUpdate(TurbineUserGroupRole) method. It will take574 * care of the connection details internally.575 *576 * @param obj the data object to update in the database.577 * @param con the connection to use578 * @throws TorqueException Any exceptions caught during processing will be579 * rethrown wrapped into a TorqueException.580 */581publicstaticvoid doUpdate(TurbineUserGroupRole obj, Connection con)
582 throws TorqueException
583 {
584 doUpdate(buildCriteria(obj), con);
585 obj.setModified(false);
586 }
587588/***589 * Method to delete. This method is to be used during a transaction,590 * otherwise use the doDelete(TurbineUserGroupRole) method. It will take591 * care of the connection details internally.592 *593 * @param obj the data object to delete in the database.594 * @param con the connection to use595 * @throws TorqueException Any exceptions caught during processing will be596 * rethrown wrapped into a TorqueException.597 */598publicstaticvoid doDelete(TurbineUserGroupRole obj, Connection con)
599 throws TorqueException
600 {
601 doDelete(buildCriteria(obj), con);
602 }
603604/***605 * Method to do deletes.606 *607 * @param pk ObjectKey that is used DELETE from database.608 * @throws TorqueException Any exceptions caught during processing will be609 * rethrown wrapped into a TorqueException.610 */611publicstaticvoid doDelete(ObjectKey pk) throws TorqueException
612 {
613BaseTurbineUserGroupRolePeer614 .doDelete(pk, (Connection) null);
615 }
616617/***618 * Method to delete. This method is to be used during a transaction,619 * otherwise use the doDelete(ObjectKey) method. It will take620 * care of the connection details internally.621 *622 * @param pk the primary key for the object to delete in the database.623 * @param con the connection to use624 * @throws TorqueException Any exceptions caught during processing will be625 * rethrown wrapped into a TorqueException.626 */627publicstaticvoid doDelete(ObjectKey pk, Connection con)
628 throws TorqueException
629 {
630 doDelete(buildCriteria(pk), con);
631 }
632633/*** Build a Criteria object from an ObjectKey */634publicstatic Criteria buildCriteria( ObjectKey pk )
635 {
636 Criteria criteria = new Criteria();
637 SimpleKey[] keys = (SimpleKey[])pk.getValue();
638 criteria.add(USER_ID, keys[0]);
639 criteria.add(GROUP_ID, keys[1]);
640 criteria.add(ROLE_ID, keys[2]);
641return criteria;
642 }
643644/*** Build a Criteria object from the data object for this peer */645publicstatic Criteria buildCriteria( TurbineUserGroupRole obj )
646 {
647 Criteria criteria = new Criteria(DATABASE_NAME);
648 criteria.add(USER_ID, obj.getUserId());
649 criteria.add(GROUP_ID, obj.getGroupId());
650 criteria.add(ROLE_ID, obj.getRoleId());
651return criteria;
652 }
653654655656/***657 * Retrieve a single object by pk658 *659 * @param pk the primary key660 * @throws TorqueException Any exceptions caught during processing will be661 * rethrown wrapped into a TorqueException.662 * @throws NoRowsException Primary key was not found in database.663 * @throws TooManyRowsException Primary key was not found in database.664 */665publicstaticTurbineUserGroupRole retrieveByPK(ObjectKey pk)
666 throws TorqueException, NoRowsException, TooManyRowsException
667 {
668 Connection db = null;
669TurbineUserGroupRole retVal = null;
670try671 {
672 db = Torque.getConnection(DATABASE_NAME);
673 retVal = retrieveByPK(pk, db);
674 }
675finally676 {
677 Torque.closeConnection(db);
678 }
679return(retVal);
680 }
681682/***683 * Retrieve a single object by pk684 *685 * @param pk the primary key686 * @param con the connection to use687 * @throws TorqueException Any exceptions caught during processing will be688 * rethrown wrapped into a TorqueException.689 * @throws NoRowsException Primary key was not found in database.690 * @throws TooManyRowsException Primary key was not found in database.691 */692publicstaticTurbineUserGroupRole retrieveByPK(ObjectKey pk, Connection con)
693 throws TorqueException, NoRowsException, TooManyRowsException
694 {
695 Criteria criteria = buildCriteria(pk);
696 List v = doSelect(criteria, con);
697if (v.size() == 0)
698 {
699thrownew NoRowsException("Failed to select a row.");
700 }
701elseif (v.size() > 1)
702 {
703thrownew TooManyRowsException("Failed to select only one row.");
704 }
705else706 {
707return (TurbineUserGroupRole)v.get(0);
708 }
709 }
710711/***712 * Retrieve a multiple objects by pk713 *714 * @param pks List of primary keys715 * @throws TorqueException Any exceptions caught during processing will be716 * rethrown wrapped into a TorqueException.717 */718publicstatic List retrieveByPKs(List pks)
719 throws TorqueException
720 {
721 Connection db = null;
722 List retVal = null;
723try724 {
725 db = Torque.getConnection(DATABASE_NAME);
726 retVal = retrieveByPKs(pks, db);
727 }
728finally729 {
730 Torque.closeConnection(db);
731 }
732return(retVal);
733 }
734735/***736 * Retrieve a multiple objects by pk737 *738 * @param pks List of primary keys739 * @param dbcon the connection to use740 * @throws TorqueException Any exceptions caught during processing will be741 * rethrown wrapped into a TorqueException.742 */743publicstatic List retrieveByPKs( List pks, Connection dbcon )
744 throws TorqueException
745 {
746 List objs = null;
747if (pks == null || pks.size() == 0)
748 {
749 objs = new LinkedList();
750 }
751else752 {
753 Criteria criteria = new Criteria();
754 Iterator iter = pks.iterator();
755while (iter.hasNext())
756 {
757 ObjectKey pk = (ObjectKey)iter.next();
758 SimpleKey[] keys = (SimpleKey[])pk.getValue();
759 Criteria.Criterion c0 = criteria.getNewCriterion(
760 USER_ID, keys[0], Criteria.EQUAL);
761 Criteria.Criterion c1 = criteria.getNewCriterion(
762 GROUP_ID, keys[1], Criteria.EQUAL);
763 c0.and(c1);
764 Criteria.Criterion c2 = criteria.getNewCriterion(
765 ROLE_ID, keys[2], Criteria.EQUAL);
766 c1.and(c2);
767 criteria.or(c0);
768 }
769 objs = doSelect(criteria, dbcon);
770 }
771return objs;
772 }
773774775/***776 * retrieve object using using pk values.777 *778 * @param user_id int779 * @param group_id int780 * @param role_id int781 */782publicstaticTurbineUserGroupRole retrieveByPK(
783int user_id
784 , int group_id
785 , int role_id
786 ) throws TorqueException
787 {
788 Connection db = null;
789TurbineUserGroupRole retVal = null;
790try791 {
792 db = Torque.getConnection(DATABASE_NAME);
793 retVal = retrieveByPK(
794 user_id
795 , group_id
796 , role_id
797 , db);
798 }
799finally800 {
801 Torque.closeConnection(db);
802 }
803return(retVal);
804 }
805806/***807 * retrieve object using using pk values.808 *809 * @param user_id int810 * @param group_id int811 * @param role_id int812 * @param Connection con813 */814publicstaticTurbineUserGroupRole retrieveByPK(
815int user_id
816 , int group_id
817 , int role_id
818 ,Connection con) throws TorqueException
819 {
820821 Criteria criteria = new Criteria(5);
822 criteria.add(USER_ID, user_id);
823 criteria.add(GROUP_ID, group_id);
824 criteria.add(ROLE_ID, role_id);
825 List v = doSelect(criteria, con);
826if (v.size() != 1)
827 {
828thrownew TorqueException("Failed to select one and only one row.");
829 }
830else831 {
832return (TurbineUserGroupRole) v.get(0);
833 }
834 }
835836837838839840841842843/***844 * selects a collection of TurbineUserGroupRole objects pre-filled with their845 * TurbineUser objects.846 *847 * This method is protected by default in order to keep the public848 * api reasonable. You can provide public methods for those you849 * actually need in TurbineUserGroupRolePeer.850 *851 * @throws TorqueException Any exceptions caught during processing will be852 * rethrown wrapped into a TorqueException.853 */854protectedstatic List doSelectJoinTurbineUser(Criteria c)
855 throws TorqueException
856 {
857// Set the correct dbName if it has not been overridden858// c.getDbName will return the same object if not set to859// another value so == check is okay and faster860if (c.getDbName() == Torque.getDefaultDB())
861 {
862 c.setDbName(DATABASE_NAME);
863 }
864865 TurbineUserGroupRolePeer.addSelectColumns(c);
866int offset = numColumns + 1;
867 TurbineUserPeer.addSelectColumns(c);
868869870 c.addJoin(TurbineUserGroupRolePeer.USER_ID,
871 TurbineUserPeer.USER_ID);
872873874875 List rows = BasePeer.doSelect(c);
876 List results = new ArrayList();
877878for (int i = 0; i < rows.size(); i++)
879 {
880 Record row = (Record) rows.get(i);
881882 Class omClass = TurbineUserGroupRolePeer.getOMClass();
883TurbineUserGroupRole obj1 = (TurbineUserGroupRole) TurbineUserGroupRolePeer
884 .row2Object(row, 1, omClass);
885 omClass = TurbineUserPeer.getOMClass();
886TurbineUser obj2 = (TurbineUser)TurbineUserPeer
887 .row2Object(row, offset, omClass);
888889boolean newObject = true;
890for (int j = 0; j < results.size(); j++)
891 {
892TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
893TurbineUser temp_obj2 = (TurbineUser)temp_obj1.getTurbineUser();
894if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
895 {
896 newObject = false;
897 temp_obj2.addTurbineUserGroupRole(obj1);
898break;
899 }
900 }
901if (newObject)
902 {
903 obj2.initTurbineUserGroupRoles();
904 obj2.addTurbineUserGroupRole(obj1);
905 }
906 results.add(obj1);
907 }
908return results;
909 }
910911912913914/***915 * selects a collection of TurbineUserGroupRole objects pre-filled with their916 * TurbineGroup objects.917 *918 * This method is protected by default in order to keep the public919 * api reasonable. You can provide public methods for those you920 * actually need in TurbineUserGroupRolePeer.921 *922 * @throws TorqueException Any exceptions caught during processing will be923 * rethrown wrapped into a TorqueException.924 */925protectedstatic List doSelectJoinTurbineGroup(Criteria c)
926 throws TorqueException
927 {
928// Set the correct dbName if it has not been overridden929// c.getDbName will return the same object if not set to930// another value so == check is okay and faster931if (c.getDbName() == Torque.getDefaultDB())
932 {
933 c.setDbName(DATABASE_NAME);
934 }
935936 TurbineUserGroupRolePeer.addSelectColumns(c);
937int offset = numColumns + 1;
938 TurbineGroupPeer.addSelectColumns(c);
939940941 c.addJoin(TurbineUserGroupRolePeer.GROUP_ID,
942 TurbineGroupPeer.GROUP_ID);
943944945946 List rows = BasePeer.doSelect(c);
947 List results = new ArrayList();
948949for (int i = 0; i < rows.size(); i++)
950 {
951 Record row = (Record) rows.get(i);
952953 Class omClass = TurbineUserGroupRolePeer.getOMClass();
954TurbineUserGroupRole obj1 = (TurbineUserGroupRole) TurbineUserGroupRolePeer
955 .row2Object(row, 1, omClass);
956 omClass = TurbineGroupPeer.getOMClass();
957TurbineGroup obj2 = (TurbineGroup)TurbineGroupPeer
958 .row2Object(row, offset, omClass);
959960boolean newObject = true;
961for (int j = 0; j < results.size(); j++)
962 {
963TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
964TurbineGroup temp_obj2 = (TurbineGroup)temp_obj1.getTurbineGroup();
965if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
966 {
967 newObject = false;
968 temp_obj2.addTurbineUserGroupRole(obj1);
969break;
970 }
971 }
972if (newObject)
973 {
974 obj2.initTurbineUserGroupRoles();
975 obj2.addTurbineUserGroupRole(obj1);
976 }
977 results.add(obj1);
978 }
979return results;
980 }
981982983984985/***986 * selects a collection of TurbineUserGroupRole objects pre-filled with their987 * TurbineRole objects.988 *989 * This method is protected by default in order to keep the public990 * api reasonable. You can provide public methods for those you991 * actually need in TurbineUserGroupRolePeer.992 *993 * @throws TorqueException Any exceptions caught during processing will be994 * rethrown wrapped into a TorqueException.995 */996protectedstatic List doSelectJoinTurbineRole(Criteria c)
997 throws TorqueException
998 {
999// Set the correct dbName if it has not been overridden1000// c.getDbName will return the same object if not set to1001// another value so == check is okay and faster1002if (c.getDbName() == Torque.getDefaultDB())
1003 {
1004 c.setDbName(DATABASE_NAME);
1005 }
10061007 TurbineUserGroupRolePeer.addSelectColumns(c);
1008int offset = numColumns + 1;
1009 TurbineRolePeer.addSelectColumns(c);
101010111012 c.addJoin(TurbineUserGroupRolePeer.ROLE_ID,
1013 TurbineRolePeer.ROLE_ID);
1014101510161017 List rows = BasePeer.doSelect(c);
1018 List results = new ArrayList();
10191020for (int i = 0; i < rows.size(); i++)
1021 {
1022 Record row = (Record) rows.get(i);
10231024 Class omClass = TurbineUserGroupRolePeer.getOMClass();
1025TurbineUserGroupRole obj1 = (TurbineUserGroupRole) TurbineUserGroupRolePeer
1026 .row2Object(row, 1, omClass);
1027 omClass = TurbineRolePeer.getOMClass();
1028TurbineRole obj2 = (TurbineRole)TurbineRolePeer
1029 .row2Object(row, offset, omClass);
10301031boolean newObject = true;
1032for (int j = 0; j < results.size(); j++)
1033 {
1034TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1035TurbineRole temp_obj2 = (TurbineRole)temp_obj1.getTurbineRole();
1036if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1037 {
1038 newObject = false;
1039 temp_obj2.addTurbineUserGroupRole(obj1);
1040break;
1041 }
1042 }
1043if (newObject)
1044 {
1045 obj2.initTurbineUserGroupRoles();
1046 obj2.addTurbineUserGroupRole(obj1);
1047 }
1048 results.add(obj1);
1049 }
1050return results;
1051 }
105210531054105510561057105810591060/***1061 * selects a collection of TurbineUserGroupRole objects pre-filled with1062 * all related objects.1063 *1064 * This method is protected by default in order to keep the public1065 * api reasonable. You can provide public methods for those you1066 * actually need in TurbineUserGroupRolePeer.1067 *1068 * @throws TorqueException Any exceptions caught during processing will be1069 * rethrown wrapped into a TorqueException.1070 */1071protectedstatic List doSelectJoinAllExceptTurbineUser(Criteria c)
1072 throws TorqueException
1073 {
1074// Set the correct dbName if it has not been overridden1075// c.getDbName will return the same object if not set to another value1076// so == check is okay and faster1077if (c.getDbName() == Torque.getDefaultDB())
1078 {
1079 c.setDbName(DATABASE_NAME);
1080 }
10811082 addSelectColumns(c);
1083int offset2 = numColumns + 1;
108410851086 TurbineGroupPeer.addSelectColumns(c);
1087int offset3 = offset2 + TurbineGroupPeer.numColumns;
10881089 TurbineRolePeer.addSelectColumns(c);
1090int offset4 = offset3 + TurbineRolePeer.numColumns;
10911092 List rows = BasePeer.doSelect(c);
1093 List results = new ArrayList();
10941095for (int i = 0; i < rows.size(); i++)
1096 {
1097 Record row = (Record)rows.get(i);
10981099 Class omClass = TurbineUserGroupRolePeer.getOMClass();
1100TurbineUserGroupRole obj1 = (TurbineUserGroupRole)TurbineUserGroupRolePeer
1101 .row2Object(row, 1, omClass);
110211031104110511061107 omClass = TurbineGroupPeer.getOMClass();
1108TurbineGroup obj2 = (TurbineGroup)TurbineGroupPeer
1109 .row2Object( row, offset2, omClass);
11101111boolean newObject = true;
1112for (int j = 0; j < results.size(); j++)
1113 {
1114TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1115TurbineGroup temp_obj2 = (TurbineGroup)temp_obj1.getTurbineGroup();
1116if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1117 {
1118 newObject = false;
1119 temp_obj2.addTurbineUserGroupRole(obj1);
1120break;
1121 }
1122 }
1123if (newObject)
1124 {
1125 obj2.initTurbineUserGroupRoles();
1126 obj2.addTurbineUserGroupRole(obj1);
1127 }
11281129113011311132 omClass = TurbineRolePeer.getOMClass();
1133TurbineRole obj3 = (TurbineRole)TurbineRolePeer
1134 .row2Object( row, offset3, omClass);
11351136 newObject = true;
1137for (int j = 0; j < results.size(); j++)
1138 {
1139TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1140TurbineRole temp_obj3 = (TurbineRole)temp_obj1.getTurbineRole();
1141if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1142 {
1143 newObject = false;
1144 temp_obj3.addTurbineUserGroupRole(obj1);
1145break;
1146 }
1147 }
1148if (newObject)
1149 {
1150 obj3.initTurbineUserGroupRoles();
1151 obj3.addTurbineUserGroupRole(obj1);
1152 }
1153 results.add(obj1);
1154 }
1155return results;
1156 }
115711581159116011611162/***1163 * selects a collection of TurbineUserGroupRole objects pre-filled with1164 * all related objects.1165 *1166 * This method is protected by default in order to keep the public1167 * api reasonable. You can provide public methods for those you1168 * actually need in TurbineUserGroupRolePeer.1169 *1170 * @throws TorqueException Any exceptions caught during processing will be1171 * rethrown wrapped into a TorqueException.1172 */1173protectedstatic List doSelectJoinAllExceptTurbineGroup(Criteria c)
1174 throws TorqueException
1175 {
1176// Set the correct dbName if it has not been overridden1177// c.getDbName will return the same object if not set to another value1178// so == check is okay and faster1179if (c.getDbName() == Torque.getDefaultDB())
1180 {
1181 c.setDbName(DATABASE_NAME);
1182 }
11831184 addSelectColumns(c);
1185int offset2 = numColumns + 1;
11861187 TurbineUserPeer.addSelectColumns(c);
1188int offset3 = offset2 + TurbineUserPeer.numColumns;
118911901191 TurbineRolePeer.addSelectColumns(c);
1192int offset4 = offset3 + TurbineRolePeer.numColumns;
11931194 List rows = BasePeer.doSelect(c);
1195 List results = new ArrayList();
11961197for (int i = 0; i < rows.size(); i++)
1198 {
1199 Record row = (Record)rows.get(i);
12001201 Class omClass = TurbineUserGroupRolePeer.getOMClass();
1202TurbineUserGroupRole obj1 = (TurbineUserGroupRole)TurbineUserGroupRolePeer
1203 .row2Object(row, 1, omClass);
12041205120612071208 omClass = TurbineUserPeer.getOMClass();
1209TurbineUser obj2 = (TurbineUser)TurbineUserPeer
1210 .row2Object( row, offset2, omClass);
12111212boolean newObject = true;
1213for (int j = 0; j < results.size(); j++)
1214 {
1215TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1216TurbineUser temp_obj2 = (TurbineUser)temp_obj1.getTurbineUser();
1217if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1218 {
1219 newObject = false;
1220 temp_obj2.addTurbineUserGroupRole(obj1);
1221break;
1222 }
1223 }
1224if (newObject)
1225 {
1226 obj2.initTurbineUserGroupRoles();
1227 obj2.addTurbineUserGroupRole(obj1);
1228 }
122912301231123212331234 omClass = TurbineRolePeer.getOMClass();
1235TurbineRole obj3 = (TurbineRole)TurbineRolePeer
1236 .row2Object( row, offset3, omClass);
12371238 newObject = true;
1239for (int j = 0; j < results.size(); j++)
1240 {
1241TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1242TurbineRole temp_obj3 = (TurbineRole)temp_obj1.getTurbineRole();
1243if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1244 {
1245 newObject = false;
1246 temp_obj3.addTurbineUserGroupRole(obj1);
1247break;
1248 }
1249 }
1250if (newObject)
1251 {
1252 obj3.initTurbineUserGroupRoles();
1253 obj3.addTurbineUserGroupRole(obj1);
1254 }
1255 results.add(obj1);
1256 }
1257return results;
1258 }
125912601261126212631264/***1265 * selects a collection of TurbineUserGroupRole objects pre-filled with1266 * all related objects.1267 *1268 * This method is protected by default in order to keep the public1269 * api reasonable. You can provide public methods for those you1270 * actually need in TurbineUserGroupRolePeer.1271 *1272 * @throws TorqueException Any exceptions caught during processing will be1273 * rethrown wrapped into a TorqueException.1274 */1275protectedstatic List doSelectJoinAllExceptTurbineRole(Criteria c)
1276 throws TorqueException
1277 {
1278// Set the correct dbName if it has not been overridden1279// c.getDbName will return the same object if not set to another value1280// so == check is okay and faster1281if (c.getDbName() == Torque.getDefaultDB())
1282 {
1283 c.setDbName(DATABASE_NAME);
1284 }
12851286 addSelectColumns(c);
1287int offset2 = numColumns + 1;
12881289 TurbineUserPeer.addSelectColumns(c);
1290int offset3 = offset2 + TurbineUserPeer.numColumns;
12911292 TurbineGroupPeer.addSelectColumns(c);
1293int offset4 = offset3 + TurbineGroupPeer.numColumns;
129412951296 List rows = BasePeer.doSelect(c);
1297 List results = new ArrayList();
12981299for (int i = 0; i < rows.size(); i++)
1300 {
1301 Record row = (Record)rows.get(i);
13021303 Class omClass = TurbineUserGroupRolePeer.getOMClass();
1304TurbineUserGroupRole obj1 = (TurbineUserGroupRole)TurbineUserGroupRolePeer
1305 .row2Object(row, 1, omClass);
13061307130813091310 omClass = TurbineUserPeer.getOMClass();
1311TurbineUser obj2 = (TurbineUser)TurbineUserPeer
1312 .row2Object( row, offset2, omClass);
13131314boolean newObject = true;
1315for (int j = 0; j < results.size(); j++)
1316 {
1317TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1318TurbineUser temp_obj2 = (TurbineUser)temp_obj1.getTurbineUser();
1319if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1320 {
1321 newObject = false;
1322 temp_obj2.addTurbineUserGroupRole(obj1);
1323break;
1324 }
1325 }
1326if (newObject)
1327 {
1328 obj2.initTurbineUserGroupRoles();
1329 obj2.addTurbineUserGroupRole(obj1);
1330 }
13311332133313341335 omClass = TurbineGroupPeer.getOMClass();
1336TurbineGroup obj3 = (TurbineGroup)TurbineGroupPeer
1337 .row2Object( row, offset3, omClass);
13381339 newObject = true;
1340for (int j = 0; j < results.size(); j++)
1341 {
1342TurbineUserGroupRole temp_obj1 = (TurbineUserGroupRole)results.get(j);
1343TurbineGroup temp_obj3 = (TurbineGroup)temp_obj1.getTurbineGroup();
1344if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1345 {
1346 newObject = false;
1347 temp_obj3.addTurbineUserGroupRole(obj1);
1348break;
1349 }
1350 }
1351if (newObject)
1352 {
1353 obj3.initTurbineUserGroupRoles();
1354 obj3.addTurbineUserGroupRole(obj1);
1355 }
13561357 results.add(obj1);
1358 }
1359return results;
1360 }
136113621363/***1364 * Returns the TableMap related to this peer. This method is not1365 * needed for general use but a specific application could have a need.1366 *1367 * @throws TorqueException Any exceptions caught during processing will be1368 * rethrown wrapped into a TorqueException.1369 */1370protectedstatic TableMap getTableMap()
1371 throws TorqueException
1372 {
1373return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
1374 }
1375 }