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.*;
323334/***35 * This class was autogenerated by Torque on:36 *37 * [Thu Apr 22 23:12:36 EDT 2004]38 *39 */40publicabstractclassBaseTurbineUserPeer41extends BasePeer
42 {
4344/*** the default database name for this class */45publicstaticfinal String DATABASE_NAME = "default";
4647/*** the table name for this class */48publicstaticfinal String TABLE_NAME = "TURBINE_USER";
4950/***51 * @return the map builder for this peer52 * @throws TorqueException Any exceptions caught during processing will be53 * rethrown wrapped into a TorqueException.54 */55publicstatic MapBuilder getMapBuilder()
56 throws TorqueException
57 {
58return getMapBuilder(TurbineUserMapBuilder.CLASS_NAME);
59 }
6061/*** the column name for the USER_ID field */62publicstaticfinal String USER_ID;
63/*** the column name for the LOGIN_NAME field */64publicstaticfinal String LOGIN_NAME;
65/*** the column name for the PASSWORD_VALUE field */66publicstaticfinal String PASSWORD_VALUE;
67/*** the column name for the FIRST_NAME field */68publicstaticfinal String FIRST_NAME;
69/*** the column name for the LAST_NAME field */70publicstaticfinal String LAST_NAME;
71/*** the column name for the EMAIL field */72publicstaticfinal String EMAIL;
73/*** the column name for the CONFIRM_VALUE field */74publicstaticfinal String CONFIRM_VALUE;
75/*** the column name for the MODIFIED field */76publicstaticfinal String MODIFIED;
77/*** the column name for the CREATED field */78publicstaticfinal String CREATED;
79/*** the column name for the LAST_LOGIN field */80publicstaticfinal String LAST_LOGIN;
81/*** the column name for the DISABLED field */82publicstaticfinal String DISABLED;
83/*** the column name for the OBJECTDATA field */84publicstaticfinal String OBJECTDATA;
85/*** the column name for the PASSWORD_CHANGED field */86publicstaticfinal String PASSWORD_CHANGED;
8788static89 {
90 USER_ID = "TURBINE_USER.USER_ID";
91 LOGIN_NAME = "TURBINE_USER.LOGIN_NAME";
92 PASSWORD_VALUE = "TURBINE_USER.PASSWORD_VALUE";
93 FIRST_NAME = "TURBINE_USER.FIRST_NAME";
94 LAST_NAME = "TURBINE_USER.LAST_NAME";
95 EMAIL = "TURBINE_USER.EMAIL";
96 CONFIRM_VALUE = "TURBINE_USER.CONFIRM_VALUE";
97 MODIFIED = "TURBINE_USER.MODIFIED";
98 CREATED = "TURBINE_USER.CREATED";
99 LAST_LOGIN = "TURBINE_USER.LAST_LOGIN";
100 DISABLED = "TURBINE_USER.DISABLED";
101 OBJECTDATA = "TURBINE_USER.OBJECTDATA";
102 PASSWORD_CHANGED = "TURBINE_USER.PASSWORD_CHANGED";
103if (Torque.isInit())
104 {
105try106 {
107 getMapBuilder();
108 }
109catch (Exception e)
110 {
111 log.error("Could not initialize Peer", e);
112 }
113 }
114else115 {
116 Torque.registerMapBuilder(TurbineUserMapBuilder.CLASS_NAME);
117 }
118 }
119120/*** number of columns for this peer */121publicstaticfinalint numColumns = 13;
122123/*** A class that can be returned by this peer. */124protectedstaticfinal String CLASSNAME_DEFAULT =
125"org.apache.jetspeed.om.security.turbine.TurbineUser";
126127/*** A class that can be returned by this peer. */128protectedstaticfinal Class CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
129130/***131 * Class object initialization method.132 *133 * @param className name of the class to initialize134 * @return the initialized class135 */136privatestatic Class initClass(String className)
137 {
138 Class c = null;
139try140 {
141 c = Class.forName(className);
142 }
143catch (Throwable t)
144 {
145 log.error("A FATAL ERROR has occurred which should not "146 + "have happened under any circumstance. Please notify "147 + "the Torque developers <turbine-torque-dev@jakarta.apache.org> "148 + "and give as many details as possible (including the error "149 + "stack trace).", t);
150151// Error objects should always be propogated.152if (t instanceof Error)
153 {
154throw (Error) t.fillInStackTrace();
155 }
156 }
157return c;
158 }
159160/***161 * Get the list of objects for a ResultSet. Please not that your162 * resultset MUST return columns in the right order. You can use163 * getFieldNames() in BaseObject to get the correct sequence.164 *165 * @param results the ResultSet166 * @return the list of objects167 * @throws TorqueException Any exceptions caught during processing will be168 * rethrown wrapped into a TorqueException.169 */170publicstatic List resultSet2Objects(java.sql.ResultSet results)
171 throws TorqueException
172 {
173try174 {
175 QueryDataSet qds = null;
176 List rows = null;
177try178 {
179 qds = new QueryDataSet(results);
180 rows = getSelectResults(qds);
181 }
182finally183 {
184if (qds != null)
185 {
186 qds.close();
187 }
188 }
189190return populateObjects(rows);
191 }
192catch (SQLException e)
193 {
194thrownew TorqueException(e);
195 }
196catch (DataSetException e)
197 {
198thrownew TorqueException(e);
199 }
200 }
201202203204/***205 * Method to do inserts.206 *207 * @param criteria object used to create the INSERT statement.208 * @throws TorqueException Any exceptions caught during processing will be209 * rethrown wrapped into a TorqueException.210 */211publicstatic ObjectKey doInsert(Criteria criteria)
212 throws TorqueException
213 {
214returnBaseTurbineUserPeer215 .doInsert(criteria, (Connection) null);
216 }
217218/***219 * Method to do inserts. This method is to be used during a transaction,220 * otherwise use the doInsert(Criteria) method. It will take care of221 * the connection details internally.222 *223 * @param criteria object used to create the INSERT statement.224 * @param con the connection to use225 * @throws TorqueException Any exceptions caught during processing will be226 * rethrown wrapped into a TorqueException.227 */228publicstatic ObjectKey doInsert(Criteria criteria, Connection con)
229 throws TorqueException
230 {
231232// Set the correct dbName if it has not been overridden233// criteria.getDbName will return the same object if not set to234// another value so == check is okay and faster235if (criteria.getDbName() == Torque.getDefaultDB())
236 {
237 criteria.setDbName(DATABASE_NAME);
238 }
239if (con == null)
240 {
241return BasePeer.doInsert(criteria);
242 }
243else244 {
245return BasePeer.doInsert(criteria, con);
246 }
247 }
248249/***250 * Add all the columns needed to create a new object.251 *252 * @param criteria object containing the columns to add.253 * @throws TorqueException Any exceptions caught during processing will be254 * rethrown wrapped into a TorqueException.255 */256publicstaticvoid addSelectColumns(Criteria criteria)
257 throws TorqueException
258 {
259 criteria.addSelectColumn(USER_ID);
260 criteria.addSelectColumn(LOGIN_NAME);
261 criteria.addSelectColumn(PASSWORD_VALUE);
262 criteria.addSelectColumn(FIRST_NAME);
263 criteria.addSelectColumn(LAST_NAME);
264 criteria.addSelectColumn(EMAIL);
265 criteria.addSelectColumn(CONFIRM_VALUE);
266 criteria.addSelectColumn(MODIFIED);
267 criteria.addSelectColumn(CREATED);
268 criteria.addSelectColumn(LAST_LOGIN);
269 criteria.addSelectColumn(DISABLED);
270 criteria.addSelectColumn(OBJECTDATA);
271 criteria.addSelectColumn(PASSWORD_CHANGED);
272 }
273274/***275 * Create a new object of type cls from a resultset row starting276 * from a specified offset. This is done so that you can select277 * other rows than just those needed for this object. You may278 * for example want to create two objects from the same row.279 *280 * @throws TorqueException Any exceptions caught during processing will be281 * rethrown wrapped into a TorqueException.282 */283publicstaticTurbineUser row2Object(Record row,
284int offset,
285 Class cls)
286 throws TorqueException
287 {
288try289 {
290TurbineUser obj = (TurbineUser) cls.newInstance();
291 TurbineUserPeer.populateObject(row, offset, obj);
292 obj.setModified(false);
293 obj.setNew(false);
294295return obj;
296 }
297catch (InstantiationException e)
298 {
299thrownew TorqueException(e);
300 }
301catch (IllegalAccessException e)
302 {
303thrownew TorqueException(e);
304 }
305 }
306307/***308 * Populates an object from a resultset row starting309 * from a specified offset. This is done so that you can select310 * other rows than just those needed for this object. You may311 * for example want to create two objects from the same row.312 *313 * @throws TorqueException Any exceptions caught during processing will be314 * rethrown wrapped into a TorqueException.315 */316publicstaticvoid populateObject(Record row,
317int offset,
318TurbineUser obj)
319 throws TorqueException
320 {
321try322 {
323 obj.setUserId(row.getValue(offset + 0).asInt());
324 obj.setLoginName(row.getValue(offset + 1).asString());
325 obj.setPasswordValue(row.getValue(offset + 2).asString());
326 obj.setFirstName(row.getValue(offset + 3).asString());
327 obj.setLastName(row.getValue(offset + 4).asString());
328 obj.setEmail(row.getValue(offset + 5).asString());
329 obj.setConfirmValue(row.getValue(offset + 6).asString());
330 obj.setModified(row.getValue(offset + 7).asUtilDate());
331 obj.setCreated(row.getValue(offset + 8).asUtilDate());
332 obj.setLastLogin(row.getValue(offset + 9).asUtilDate());
333 obj.setDisabled(row.getValue(offset + 10).asString());
334 obj.setObjectdata(row.getValue(offset + 11).asBytes());
335 obj.setPasswordChanged(row.getValue(offset + 12).asUtilDate());
336 }
337catch (DataSetException e)
338 {
339thrownew TorqueException(e);
340 }
341 }
342343/***344 * Method to do selects.345 *346 * @param criteria object used to create the SELECT statement.347 * @return List of selected Objects348 * @throws TorqueException Any exceptions caught during processing will be349 * rethrown wrapped into a TorqueException.350 */351publicstatic List doSelect(Criteria criteria) throws TorqueException
352 {
353return populateObjects(doSelectVillageRecords(criteria));
354 }
355356/***357 * Method to do selects within a transaction.358 *359 * @param criteria object used to create the SELECT statement.360 * @param con the connection to use361 * @return List of selected Objects362 * @throws TorqueException Any exceptions caught during processing will be363 * rethrown wrapped into a TorqueException.364 */365publicstatic List doSelect(Criteria criteria, Connection con)
366 throws TorqueException
367 {
368return populateObjects(doSelectVillageRecords(criteria, con));
369 }
370371/***372 * Grabs the raw Village records to be formed into objects.373 * This method handles connections internally. The Record objects374 * returned by this method should be considered readonly. Do not375 * alter the data and call save(), your results may vary, but are376 * certainly likely to result in hard to track MT bugs.377 *378 * @throws TorqueException Any exceptions caught during processing will be379 * rethrown wrapped into a TorqueException.380 */381publicstatic List doSelectVillageRecords(Criteria criteria)
382 throws TorqueException
383 {
384returnBaseTurbineUserPeer385 .doSelectVillageRecords(criteria, (Connection) null);
386 }
387388/***389 * Grabs the raw Village records to be formed into objects.390 * This method should be used for transactions391 *392 * @param con the connection to use393 * @throws TorqueException Any exceptions caught during processing will be394 * rethrown wrapped into a TorqueException.395 */396publicstatic List doSelectVillageRecords(Criteria criteria, Connection con)
397 throws TorqueException
398 {
399if (criteria.getSelectColumns().size() == 0)
400 {
401 addSelectColumns(criteria);
402 }
403404405// Set the correct dbName if it has not been overridden406// criteria.getDbName will return the same object if not set to407// another value so == check is okay and faster408if (criteria.getDbName() == Torque.getDefaultDB())
409 {
410 criteria.setDbName(DATABASE_NAME);
411 }
412// BasePeer returns a List of Value (Village) arrays. The array413// order follows the order columns were placed in the Select clause.414if (con == null)
415 {
416return BasePeer.doSelect(criteria);
417 }
418else419 {
420return BasePeer.doSelect(criteria, con);
421 }
422 }
423424/***425 * The returned List will contain objects of the default type or426 * objects that inherit from the default.427 *428 * @throws TorqueException Any exceptions caught during processing will be429 * rethrown wrapped into a TorqueException.430 */431publicstatic List populateObjects(List records)
432 throws TorqueException
433 {
434 List results = new ArrayList(records.size());
435436// populate the object(s)437for (int i = 0; i < records.size(); i++)
438 {
439 Record row = (Record) records.get(i);
440 results.add(TurbineUserPeer.row2Object(row, 1,
441 TurbineUserPeer.getOMClass()));
442 }
443return results;
444 }
445446447/***448 * The class that the Peer will make instances of.449 * If the BO is abstract then you must implement this method450 * in the BO.451 *452 * @throws TorqueException Any exceptions caught during processing will be453 * rethrown wrapped into a TorqueException.454 */455publicstatic Class getOMClass()
456 throws TorqueException
457 {
458return CLASS_DEFAULT;
459 }
460461/***462 * Method to do updates.463 *464 * @param criteria object containing data that is used to create the UPDATE465 * statement.466 * @throws TorqueException Any exceptions caught during processing will be467 * rethrown wrapped into a TorqueException.468 */469publicstaticvoid doUpdate(Criteria criteria) throws TorqueException
470 {
471BaseTurbineUserPeer472 .doUpdate(criteria, (Connection) null);
473 }
474475/***476 * Method to do updates. This method is to be used during a transaction,477 * otherwise use the doUpdate(Criteria) method. It will take care of478 * the connection details internally.479 *480 * @param criteria object containing data that is used to create the UPDATE481 * statement.482 * @param con the connection to use483 * @throws TorqueException Any exceptions caught during processing will be484 * rethrown wrapped into a TorqueException.485 */486publicstaticvoid doUpdate(Criteria criteria, Connection con)
487 throws TorqueException
488 {
489 Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
490 selectCriteria.put(USER_ID, criteria.remove(USER_ID));
491492// Set the correct dbName if it has not been overridden493// criteria.getDbName will return the same object if not set to494// another value so == check is okay and faster495if (criteria.getDbName() == Torque.getDefaultDB())
496 {
497 criteria.setDbName(DATABASE_NAME);
498 }
499if (con == null)
500 {
501 BasePeer.doUpdate(selectCriteria, criteria);
502 }
503else504 {
505 BasePeer.doUpdate(selectCriteria, criteria, con);
506 }
507 }
508509/***510 * Method to do deletes.511 *512 * @param criteria object containing data that is used DELETE from database.513 * @throws TorqueException Any exceptions caught during processing will be514 * rethrown wrapped into a TorqueException.515 */516publicstaticvoid doDelete(Criteria criteria) throws TorqueException
517 {
518BaseTurbineUserPeer519 .doDelete(criteria, (Connection) null);
520 }
521522/***523 * Method to do deletes. This method is to be used during a transaction,524 * otherwise use the doDelete(Criteria) method. It will take care of525 * the connection details internally.526 *527 * @param criteria object containing data that is used DELETE from database.528 * @param con the connection to use529 * @throws TorqueException Any exceptions caught during processing will be530 * rethrown wrapped into a TorqueException.531 */532publicstaticvoid doDelete(Criteria criteria, Connection con)
533 throws TorqueException
534 {
535536// Set the correct dbName if it has not been overridden537// criteria.getDbName will return the same object if not set to538// another value so == check is okay and faster539if (criteria.getDbName() == Torque.getDefaultDB())
540 {
541 criteria.setDbName(DATABASE_NAME);
542 }
543if (con == null)
544 {
545 BasePeer.doDelete(criteria);
546 }
547else548 {
549 BasePeer.doDelete(criteria, con);
550 }
551 }
552553/***554 * Method to do selects555 *556 * @throws TorqueException Any exceptions caught during processing will be557 * rethrown wrapped into a TorqueException.558 */559publicstatic List doSelect(TurbineUser obj) throws TorqueException
560 {
561return doSelect(buildCriteria(obj));
562 }
563564/***565 * Method to do inserts566 *567 * @throws TorqueException Any exceptions caught during processing will be568 * rethrown wrapped into a TorqueException.569 */570publicstaticvoid doInsert(TurbineUser obj) throws TorqueException
571 {
572 obj.setPrimaryKey(doInsert(buildCriteria(obj)));
573 obj.setNew(false);
574 obj.setModified(false);
575 }
576577/***578 * @param obj the data object to update in the database.579 * @throws TorqueException Any exceptions caught during processing will be580 * rethrown wrapped into a TorqueException.581 */582publicstaticvoid doUpdate(TurbineUser obj) throws TorqueException
583 {
584 doUpdate(buildCriteria(obj));
585 obj.setModified(false);
586 }
587588/***589 * @param obj the data object to delete in the database.590 * @throws TorqueException Any exceptions caught during processing will be591 * rethrown wrapped into a TorqueException.592 */593publicstaticvoid doDelete(TurbineUser obj) throws TorqueException
594 {
595 doDelete(buildCriteria(obj));
596 }
597598/***599 * Method to do inserts. This method is to be used during a transaction,600 * otherwise use the doInsert(TurbineUser) method. It will take601 * care of the connection details internally.602 *603 * @param obj the data object to insert into the database.604 * @param con the connection to use605 * @throws TorqueException Any exceptions caught during processing will be606 * rethrown wrapped into a TorqueException.607 */608publicstaticvoid doInsert(TurbineUser obj, Connection con)
609 throws TorqueException
610 {
611 obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
612 obj.setNew(false);
613 obj.setModified(false);
614 }
615616/***617 * Method to do update. This method is to be used during a transaction,618 * otherwise use the doUpdate(TurbineUser) method. It will take619 * care of the connection details internally.620 *621 * @param obj the data object to update in the database.622 * @param con the connection to use623 * @throws TorqueException Any exceptions caught during processing will be624 * rethrown wrapped into a TorqueException.625 */626publicstaticvoid doUpdate(TurbineUser obj, Connection con)
627 throws TorqueException
628 {
629 doUpdate(buildCriteria(obj), con);
630 obj.setModified(false);
631 }
632633/***634 * Method to delete. This method is to be used during a transaction,635 * otherwise use the doDelete(TurbineUser) method. It will take636 * care of the connection details internally.637 *638 * @param obj the data object to delete in the database.639 * @param con the connection to use640 * @throws TorqueException Any exceptions caught during processing will be641 * rethrown wrapped into a TorqueException.642 */643publicstaticvoid doDelete(TurbineUser obj, Connection con)
644 throws TorqueException
645 {
646 doDelete(buildCriteria(obj), con);
647 }
648649/***650 * Method to do deletes.651 *652 * @param pk ObjectKey that is used DELETE from database.653 * @throws TorqueException Any exceptions caught during processing will be654 * rethrown wrapped into a TorqueException.655 */656publicstaticvoid doDelete(ObjectKey pk) throws TorqueException
657 {
658BaseTurbineUserPeer659 .doDelete(pk, (Connection) null);
660 }
661662/***663 * Method to delete. This method is to be used during a transaction,664 * otherwise use the doDelete(ObjectKey) method. It will take665 * care of the connection details internally.666 *667 * @param pk the primary key for the object to delete in the database.668 * @param con the connection to use669 * @throws TorqueException Any exceptions caught during processing will be670 * rethrown wrapped into a TorqueException.671 */672publicstaticvoid doDelete(ObjectKey pk, Connection con)
673 throws TorqueException
674 {
675 doDelete(buildCriteria(pk), con);
676 }
677678/*** Build a Criteria object from an ObjectKey */679publicstatic Criteria buildCriteria( ObjectKey pk )
680 {
681 Criteria criteria = new Criteria();
682 criteria.add(USER_ID, pk);
683return criteria;
684 }
685686/*** Build a Criteria object from the data object for this peer */687publicstatic Criteria buildCriteria( TurbineUser obj )
688 {
689 Criteria criteria = new Criteria(DATABASE_NAME);
690if (!obj.isNew())
691 criteria.add(USER_ID, obj.getUserId());
692 criteria.add(LOGIN_NAME, obj.getLoginName());
693 criteria.add(PASSWORD_VALUE, obj.getPasswordValue());
694 criteria.add(FIRST_NAME, obj.getFirstName());
695 criteria.add(LAST_NAME, obj.getLastName());
696 criteria.add(EMAIL, obj.getEmail());
697 criteria.add(CONFIRM_VALUE, obj.getConfirmValue());
698 criteria.add(MODIFIED, obj.getModified());
699 criteria.add(CREATED, obj.getCreated());
700 criteria.add(LAST_LOGIN, obj.getLastLogin());
701 criteria.add(DISABLED, obj.getDisabled());
702 criteria.add(OBJECTDATA, obj.getObjectdata());
703 criteria.add(PASSWORD_CHANGED, obj.getPasswordChanged());
704return criteria;
705 }
706707708/***709 * Retrieve a single object by pk710 *711 * @param pk the primary key712 * @throws TorqueException Any exceptions caught during processing will be713 * rethrown wrapped into a TorqueException.714 * @throws NoRowsException Primary key was not found in database.715 * @throws TooManyRowsException Primary key was not found in database.716 */717publicstaticTurbineUser retrieveByPK(int pk)
718 throws TorqueException, NoRowsException, TooManyRowsException
719 {
720return retrieveByPK(SimpleKey.keyFor(pk));
721 }
722723/***724 * Retrieve a single object by pk725 *726 * @param pk the primary key727 * @throws TorqueException Any exceptions caught during processing will be728 * rethrown wrapped into a TorqueException.729 * @throws NoRowsException Primary key was not found in database.730 * @throws TooManyRowsException Primary key was not found in database.731 */732publicstaticTurbineUser retrieveByPK(ObjectKey pk)
733 throws TorqueException, NoRowsException, TooManyRowsException
734 {
735 Connection db = null;
736TurbineUser retVal = null;
737try738 {
739 db = Torque.getConnection(DATABASE_NAME);
740 retVal = retrieveByPK(pk, db);
741 }
742finally743 {
744 Torque.closeConnection(db);
745 }
746return(retVal);
747 }
748749/***750 * Retrieve a single object by pk751 *752 * @param pk the primary key753 * @param con the connection to use754 * @throws TorqueException Any exceptions caught during processing will be755 * rethrown wrapped into a TorqueException.756 * @throws NoRowsException Primary key was not found in database.757 * @throws TooManyRowsException Primary key was not found in database.758 */759publicstaticTurbineUser retrieveByPK(ObjectKey pk, Connection con)
760 throws TorqueException, NoRowsException, TooManyRowsException
761 {
762 Criteria criteria = buildCriteria(pk);
763 List v = doSelect(criteria, con);
764if (v.size() == 0)
765 {
766thrownew NoRowsException("Failed to select a row.");
767 }
768elseif (v.size() > 1)
769 {
770thrownew TooManyRowsException("Failed to select only one row.");
771 }
772else773 {
774return (TurbineUser)v.get(0);
775 }
776 }
777778/***779 * Retrieve a multiple objects by pk780 *781 * @param pks List of primary keys782 * @throws TorqueException Any exceptions caught during processing will be783 * rethrown wrapped into a TorqueException.784 */785publicstatic List retrieveByPKs(List pks)
786 throws TorqueException
787 {
788 Connection db = null;
789 List retVal = null;
790try791 {
792 db = Torque.getConnection(DATABASE_NAME);
793 retVal = retrieveByPKs(pks, db);
794 }
795finally796 {
797 Torque.closeConnection(db);
798 }
799return(retVal);
800 }
801802/***803 * Retrieve a multiple objects by pk804 *805 * @param pks List of primary keys806 * @param dbcon the connection to use807 * @throws TorqueException Any exceptions caught during processing will be808 * rethrown wrapped into a TorqueException.809 */810publicstatic List retrieveByPKs( List pks, Connection dbcon )
811 throws TorqueException
812 {
813 List objs = null;
814if (pks == null || pks.size() == 0)
815 {
816 objs = new LinkedList();
817 }
818else819 {
820 Criteria criteria = new Criteria();
821 criteria.addIn( USER_ID, pks );
822 objs = doSelect(criteria, dbcon);
823 }
824return objs;
825 }
826827828829830831832833834835836/***837 * Returns the TableMap related to this peer. This method is not838 * needed for general use but a specific application could have a need.839 *840 * @throws TorqueException Any exceptions caught during processing will be841 * rethrown wrapped into a TorqueException.842 */843protectedstatic TableMap getTableMap()
844 throws TorqueException
845 {
846return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
847 }
848 }