001package org.apache.fulcrum.security.torque.om;
002
003import java.sql.Connection;
004import java.util.Collection;
005import java.util.List;
006import java.util.Map;
007import java.util.stream.Stream;
008
009import org.apache.torque.NoRowsException;
010import org.apache.torque.TooManyRowsException;
011import org.apache.torque.Column;
012import org.apache.torque.Torque;
013import org.apache.torque.TorqueException;
014import org.apache.torque.adapter.IDMethod;
015import org.apache.torque.criteria.Criteria;
016import org.apache.torque.map.DatabaseMap;
017import org.apache.torque.map.TableMap;
018import org.apache.torque.map.ColumnMap;
019import org.apache.torque.om.mapper.RecordMapper;
020import org.apache.torque.om.ObjectKey;
021import org.apache.torque.util.ColumnValues;
022import org.apache.torque.util.JdbcTypedValue;
023
024
025
026/**
027 * The skeleton for this class was autogenerated by Torque on:
028 *
029 * [Thu Nov 04 13:34:22 CET 2021]
030 *
031 * You should not use this class directly.  It should not even be
032 * extended; all references should be to TorqueDynamicUserPeer
033 */
034
035@SuppressWarnings("unused")
036public abstract class BaseTorqueDynamicUserPeer
037{
038    /** The default database name for this class. */
039    public static final String DATABASE_NAME;
040
041     /** The table name for this class. */
042    public static final String TABLE_NAME;
043
044     /** The table map for this class. */
045    public static final TableMap TABLE;
046    /** The column for the USER_ID field */
047    public static final ColumnMap USER_ID;
048    /** The column for the LOGIN_NAME field */
049    public static final ColumnMap LOGIN_NAME;
050    /** The column for the PASSWORD_VALUE field */
051    public static final ColumnMap PASSWORD_VALUE;
052
053    /** number of columns for this peer */
054    public static final int numColumns = 3;
055
056
057    /** The implementation of the peer. */
058    private static TorqueDynamicUserPeerImpl torqueDynamicUserPeerImpl;
059
060
061    static
062    {
063        DatabaseMap dbMap = Torque.getOrCreateDatabase("fulcrum")
064                .getDatabaseMap();
065        if (dbMap.getTable("FULCRUM_DYNAMIC_USER") == null)
066        {
067            dbMap.addTable("FULCRUM_DYNAMIC_USER");
068        }
069        DATABASE_NAME = "fulcrum";
070        TABLE_NAME = "FULCRUM_DYNAMIC_USER";
071
072        TABLE = dbMap.getTable("FULCRUM_DYNAMIC_USER");
073        TABLE.setJavaName("TorqueDynamicUser");
074        TABLE.setOMClass(org.apache.fulcrum.security.torque.om.TorqueDynamicUser.class);
075        TABLE.setPeerClass(org.apache.fulcrum.security.torque.om.TorqueDynamicUserPeer.class);
076        TABLE.setPrimaryKeyMethod(IDMethod.ID_BROKER);
077        TABLE.setPrimaryKeyMethodInfo(IDMethod.ID_BROKER, TABLE.getName());
078        TABLE.setPrimaryKeyMethodInfo(IDMethod.SEQUENCE, "$sequenceName");
079        TABLE.setPrimaryKeyMethodInfo(IDMethod.AUTO_INCREMENT, "FULCRUM_DYNAMIC_USER");
080        TABLE.setUseInheritance(true);
081
082
083    // ------------- Column: USER_ID --------------------
084        USER_ID = new ColumnMap("USER_ID", TABLE);
085        USER_ID.setType(Integer.valueOf(0));
086        USER_ID.setTorqueType("INTEGER");
087        USER_ID.setUsePrimitive(false);
088        USER_ID.setPrimaryKey(true);
089        USER_ID.setNotNull(true);
090        USER_ID.setJavaName("EntityId");
091        USER_ID.setAutoIncrement(true);
092        USER_ID.setProtected(false);
093        USER_ID.setJavaType( "Integer" );
094        USER_ID.setPosition(1);
095        TABLE.addColumn(USER_ID);
096    // ------------- Column: LOGIN_NAME --------------------
097        LOGIN_NAME = new ColumnMap("LOGIN_NAME", TABLE);
098        LOGIN_NAME.setType("");
099        LOGIN_NAME.setTorqueType("VARCHAR");
100        LOGIN_NAME.setUsePrimitive(false);
101        LOGIN_NAME.setPrimaryKey(false);
102        LOGIN_NAME.setNotNull(true);
103        LOGIN_NAME.setJavaName("EntityName");
104        LOGIN_NAME.setAutoIncrement(true);
105        LOGIN_NAME.setProtected(false);
106        LOGIN_NAME.setJavaType( "String" );
107        LOGIN_NAME.setSize(64);
108        LOGIN_NAME.setPosition(2);
109        TABLE.addColumn(LOGIN_NAME);
110    // ------------- Column: PASSWORD_VALUE --------------------
111        PASSWORD_VALUE = new ColumnMap("PASSWORD_VALUE", TABLE);
112        PASSWORD_VALUE.setType("");
113        PASSWORD_VALUE.setTorqueType("VARCHAR");
114        PASSWORD_VALUE.setUsePrimitive(false);
115        PASSWORD_VALUE.setPrimaryKey(false);
116        PASSWORD_VALUE.setNotNull(true);
117        PASSWORD_VALUE.setJavaName("Password");
118        PASSWORD_VALUE.setAutoIncrement(true);
119        PASSWORD_VALUE.setProtected(false);
120        PASSWORD_VALUE.setJavaType( "String" );
121        PASSWORD_VALUE.setSize(16);
122        PASSWORD_VALUE.setPosition(3);
123        TABLE.addColumn(PASSWORD_VALUE);
124
125
126
127        initDatabaseMap();
128    }
129
130    /**
131     * Creates a new instance of the  implementation of the peer.
132     *
133     * @return the new instance.
134     */
135    protected static TorqueDynamicUserPeerImpl createTorqueDynamicUserPeerImpl()
136    {
137        TorqueDynamicUserPeerImpl instance = new TorqueDynamicUserPeerImpl();
138        return instance;
139    }
140
141
142    /**
143     * Returns an instance of the implementation of the peer.
144     * If no instance is currently cached, a new instance is created and cached.
145     *
146     * @return an instance of the implementation of the peer, not null.
147     */
148    public static TorqueDynamicUserPeerImpl getTorqueDynamicUserPeerImpl()
149    {
150        TorqueDynamicUserPeerImpl peerImplInstance = torqueDynamicUserPeerImpl;
151        if (peerImplInstance == null)
152        {
153            peerImplInstance = TorqueDynamicUserPeer.createTorqueDynamicUserPeerImpl();
154            torqueDynamicUserPeerImpl = peerImplInstance;
155            Torque.registerPeerInstance(TorqueDynamicUser.class, peerImplInstance);
156        }
157        return peerImplInstance;
158    }
159
160
161
162    /**
163     * Sets the instance of the implementation of the peer.
164     *
165     * @param peerImplInstance an instance of the implementation of the peer, or null
166     *        if a new instance should be created automatically.
167     */
168    public static void setTorqueDynamicUserPeerImpl(TorqueDynamicUserPeerImpl peerImplInstance)
169    {
170        torqueDynamicUserPeerImpl = peerImplInstance;
171    }
172
173
174    /**
175     * Add all the columns needed to create a new object.
176     *
177     * @param criteria object containing the columns to add.
178     */
179    public static void addSelectColumns(Criteria criteria)
180    {
181        getTorqueDynamicUserPeerImpl().addSelectColumns(criteria);
182    }
183
184    /**
185     * changes the boolean values in the criteria to the appropriate type,
186     * whenever a booleanchar or booleanint column is involved.
187     * This enables the user to create criteria using Boolean values
188     * for booleanchar or booleanint columns.
189     *
190     * @param criteria the criteria in which the boolean values
191     *        should be corrected.
192     *
193     * @throws TorqueException if the database map for the criteria cannot be 
194               obtained.
195     */
196    public static void correctBooleans(Criteria criteria) throws TorqueException
197    {
198        getTorqueDynamicUserPeerImpl().correctBooleans(criteria);
199    }
200
201    /**
202     * Checks all columns in the criteria to see whether
203     * booleanchar and booleanint columns are queried with a boolean.
204     * If yes, the query values are mapped onto values the database
205     * does understand, i.e. 0 and 1 for booleanints and N and Y for
206     * booleanchar columns.
207     *
208     * @param columnValues The value to be checked for booleanint
209     *        and booleanchar columns.
210     * @throws TorqueException if the database map for the criteria cannot be
211     *         retrieved.
212     */
213    public static void correctBooleans(
214            ColumnValues columnValues)
215        throws TorqueException
216    {
217        getTorqueDynamicUserPeerImpl().correctBooleans(columnValues);
218    }
219    
220    /**
221     * Selects TorqueDynamicUser objects from a database.
222     *
223     * @param criteria object used to create the SELECT statement.
224     *
225     * @return the list of selected objects, not null.
226     *
227     * @throws TorqueException Any exceptions caught during processing will be
228     *         rethrown wrapped into a TorqueException.
229     */
230    public static List<TorqueDynamicUser> doSelect(Criteria criteria)
231            throws TorqueException
232    {
233        return getTorqueDynamicUserPeerImpl().doSelect(criteria);
234    }
235
236    /**
237     * Selects TorqueDynamicUser objects from a database
238     * within a transaction.
239     *
240     * @param criteria object used to create the SELECT statement.
241     * @param connection the connection holding the transaction, not null.
242     *
243     * @return The list of selected objects, not null.
244     *
245     * @throws TorqueException Any exceptions caught during processing will be
246     *         rethrown wrapped into a TorqueException.
247     */
248    public static List<TorqueDynamicUser> doSelect(
249                Criteria criteria,
250                Connection connection)
251            throws TorqueException
252    {
253        return getTorqueDynamicUserPeerImpl().doSelect(criteria, connection);
254    }
255
256    /**
257     * Selects TorqueDynamicUser objects from a database
258     * within a transaction.
259     *
260     * This method returns a stream that <b>must</b> be closed after use.
261     * All resources used by this method will be closed when the stream is
262     * closed.
263     *
264     * @param criteria object used to create the SELECT statement.
265     * @param connection the connection holding the transaction, not null.
266     *
267     * @return The results of the query as a Stream, not null.
268     *
269     * @throws TorqueException Any exceptions caught during processing will be
270     *         rethrown wrapped into a TorqueException.
271     */
272    public static Stream<TorqueDynamicUser> doSelectAsStream(
273                Criteria criteria,
274                Connection connection)
275            throws TorqueException
276    {
277        return getTorqueDynamicUserPeerImpl().doSelectAsStream(criteria, connection);
278    }
279
280    /**
281     * Selects rows from a database an maps them to objects.
282     *
283     * @param criteria A Criteria specifying the records to select, not null.
284     * @param mapper The mapper creating the objects from the resultSet,
285     *        not null.
286     *
287     * @return The results of the query, not null.
288     *
289     * @throws TorqueException if querying the database fails.
290     */
291    public static <T> List<T> doSelect(
292                Criteria criteria,
293                RecordMapper<T> mapper)
294            throws TorqueException
295    {
296        return getTorqueDynamicUserPeerImpl().doSelect(criteria, mapper);
297    }
298
299    /**
300     * Selects rows from a database an maps them to objects.
301     *
302     * @param criteria A Criteria specifying the records to select, not null.
303     * @param mapper The mapper creating the objects from the resultSet,
304     *        not null.
305     * @param connection the database connection for selecting records,
306     *        not null.
307     *
308     * @return The results of the query, not null.
309     *
310     * @throws TorqueException Error performing database query.
311     */
312    public static <T> List<T> doSelect(
313            Criteria criteria,
314            RecordMapper<T> mapper,
315            Connection connection)
316        throws TorqueException
317    {
318        return getTorqueDynamicUserPeerImpl().doSelect(
319                criteria,
320                mapper,
321                connection);
322    }
323
324    /**
325     * Selects rows from a database an maps them to objects.
326     *
327     * This method returns a stream that <b>must</b> be closed after use.
328     * All resources used by this method will be closed when the stream is
329     * closed.
330     *
331     * @param criteria A Criteria specifying the records to select, not null.
332     * @param mapper The mapper creating the objects from the resultSet,
333     *        not null.
334     * @param connection the database connection for selecting records,
335     *        not null.
336     *
337     * @return The results of the query as a Stream, not null.
338     *
339     * @throws TorqueException Error performing database query.
340     */
341    public static <T> Stream<T> doSelectAsStream(
342            Criteria criteria,
343            RecordMapper<T> mapper,
344            Connection connection)
345        throws TorqueException
346    {
347        return getTorqueDynamicUserPeerImpl().doSelectAsStream(
348                criteria,
349                mapper,
350                connection);
351    }
352
353    /**
354     * Selects rows from a database an maps them to objects.
355     *
356     * @param query the sql query to execute, not null.
357     * @param mapper The mapper creating the objects from the resultSet,
358     *        not null.
359     * @param dbName The name of the database to create the connection for,
360     *        or null for the default SDB.
361     *
362     * @return The results of the query, not null.
363     *
364     * @throws TorqueException if querying the database fails.
365     */
366    public static <T> List<T> doSelect(
367                String query,
368                RecordMapper<T> mapper,
369                String dbName)
370            throws TorqueException
371    {
372        return getTorqueDynamicUserPeerImpl().doSelect(
373                query,
374                mapper,
375                dbName);
376    }
377
378    /**
379     * Selects rows from a database an maps them to objects.
380     *
381     * @param query the SQL Query to execute, not null.
382     * @param mapper The mapper creating the objects from the resultSet,
383     *        not null.
384     * @param connection the database connection, not null.
385     *
386     * @return The results of the query, not null.
387     *
388     * @throws TorqueException if querying the database fails.
389     */
390    public static <T> List<T> doSelect(
391                String query,
392                RecordMapper<T> mapper,
393                Connection connection)
394            throws TorqueException
395    {
396        return getTorqueDynamicUserPeerImpl().doSelect(
397                query,
398                mapper,
399                connection);
400    }
401
402    /**
403     * Selects rows from a database an maps them to objects.
404     *
405     * This method returns a stream that <b>must</b> be closed after use.
406     * All resources used by this method will be closed when the stream is
407     * closed.
408     *
409     * @param query the SQL Query to execute, not null.
410     * @param mapper The mapper creating the objects from the resultSet,
411     *        not null.
412     * @param connection the database connection, not null.
413     *
414     * @return The results of the query as a Stream, not null.
415     *
416     * @throws TorqueException if querying the database fails.
417     */
418    public static <T> Stream<T> doSelectAsStream(
419                String query,
420                RecordMapper<T> mapper,
421                Connection connection)
422            throws TorqueException
423    {
424        return getTorqueDynamicUserPeerImpl().doSelectAsStream(
425                query,
426                mapper,
427                connection);
428    }
429
430    /**
431     * Selects TorqueDynamicUser objects from the database which have
432     * the same content as the passed object.
433     *
434     * @return The list of selected objects, not null.
435     *
436     * @throws TorqueException Any exceptions caught during processing will be
437     *         rethrown wrapped into a TorqueException.
438     */
439    public static List<TorqueDynamicUser> doSelect(TorqueDynamicUser obj)
440            throws TorqueException
441    {
442        return getTorqueDynamicUserPeerImpl().doSelect(obj);
443    }
444
445    /**
446     * Selects at most one TorqueDynamicUser object from a database.
447     *
448     * @param criteria object used to create the SELECT statement.
449     *
450     * @return the selected Object, or null if no object was selected.
451     *
452     * @throws TorqueException If more than one record is selected or if
453     *         an error occurs when processing the query.
454     */
455    public static TorqueDynamicUser doSelectSingleRecord(
456                Criteria criteria)
457            throws TorqueException
458    {
459        return getTorqueDynamicUserPeerImpl().doSelectSingleRecord(criteria);
460    }
461
462    /**
463     * Selects at most one TorqueDynamicUser object from a database
464     * within a transaction.
465     *
466     * @param criteria object used to create the SELECT statement.
467     * @param connection the connection holding the transaction, not null.
468     *
469     * @return the selected Object, or null if no object was selected.
470     *
471     * @throws TorqueException If more than one record is selected or if
472     *         an error occurs when processing the query.
473     */
474    public static TorqueDynamicUser doSelectSingleRecord(
475                Criteria criteria,
476                Connection connection)
477            throws TorqueException
478    {
479        return getTorqueDynamicUserPeerImpl().doSelectSingleRecord(criteria, connection);
480    }
481
482    /**
483     * Selects at most a single row from a database an maps them to objects.
484     *
485     * @param criteria A Criteria specifying the records to select, not null.
486     * @param mapper The mapper creating the objects from the resultSet,
487     *        not null.
488     *
489     * @return The selected row, or null if no records was selected.
490     *
491     * @throws TorqueException if querying the database fails.
492     */
493    public static <T> T doSelectSingleRecord(
494                org.apache.torque.criteria.Criteria criteria,
495                RecordMapper<T> mapper)
496            throws TorqueException
497    {
498        return getTorqueDynamicUserPeerImpl().doSelectSingleRecord(
499                criteria,
500                mapper);
501    }
502
503    /**
504     * Selects at most a single row from a database an maps them to objects.
505     *
506     * @param criteria A Criteria specifying the records to select, not null.
507     * @param mapper The mapper creating the objects from the resultSet,
508     *        not null.
509     * @param connection the database connection, not null.
510     *
511     * @return The selected row, or null if no records was selected.
512     *
513     * @throws TorqueException if querying the database fails.
514     */
515    public static <T> T doSelectSingleRecord(
516                org.apache.torque.criteria.Criteria criteria,
517                RecordMapper<T> mapper,
518                Connection connection)
519            throws TorqueException
520    {
521        return getTorqueDynamicUserPeerImpl().doSelectSingleRecord(
522                criteria,
523                mapper,
524                connection);
525    }
526
527    /**
528     * Selects at most one TorqueDynamicUser object from the database
529     * which has the same content as the passed object.
530     *
531     * @return the selected Object, or null if no object was selected.
532     *
533     * @throws TorqueException If more than one record is selected or if
534     *         an error occurs when processing the query.
535     */
536    public static TorqueDynamicUser doSelectSingleRecord(
537                TorqueDynamicUser obj)
538            throws TorqueException
539    {
540        return getTorqueDynamicUserPeerImpl().doSelectSingleRecord(obj);
541    }
542
543
544    /**
545     * Returns a new instance of the Data object class
546     */
547    public static TorqueDynamicUser getDbObjectInstance()
548    {
549        return getTorqueDynamicUserPeerImpl().getDbObjectInstance();
550    }
551
552
553    /**
554     * Method to do inserts.
555     *
556     * @param columnValues the values to insert.
557     *
558     * @return the primary key of the inserted row.
559     *
560     * @throws TorqueException Any exceptions caught during processing will be
561     *         rethrown wrapped into a TorqueException.
562     */
563    public static ObjectKey<?> doInsert(ColumnValues columnValues) 
564            throws TorqueException
565    {
566        return getTorqueDynamicUserPeerImpl().doInsert(columnValues);
567    }
568
569    /**
570     * Method to do inserts.  This method is to be used during a transaction,
571     * otherwise use the doInsert(Criteria) method.
572     *
573     * @param columnValues the values to insert.
574     * @param con the connection to use, not null.
575     *
576     * @return the primary key of the inserted row.
577     *
578     * @throws TorqueException Any exceptions caught during processing will be
579     *         rethrown wrapped into a TorqueException.
580     */
581    public static ObjectKey<?> doInsert(ColumnValues columnValues, Connection con)
582            throws TorqueException
583    {
584        return getTorqueDynamicUserPeerImpl().doInsert(columnValues, con);
585    }
586    /**
587     * Method to do inserts
588     *
589     * @throws TorqueException Any exceptions caught during processing will be
590     *         rethrown wrapped into a TorqueException.
591     */
592    public static void doInsert(TorqueDynamicUser obj)
593            throws TorqueException
594    {
595        getTorqueDynamicUserPeerImpl().doInsert(obj);
596    }
597
598    /**
599     * Method to do inserts.  This method is to be used during a transaction,
600     * otherwise use the doInsert(TorqueDynamicUser) method.  It will take
601     * care of the connection details internally.
602     *
603     * @param obj the data object to insert into the database.
604     * @param con the connection to use
605     * @throws TorqueException Any exceptions caught during processing will be
606     *         rethrown wrapped into a TorqueException.
607     */
608    public static void doInsert(TorqueDynamicUser obj, Connection con)
609            throws TorqueException
610    {
611        getTorqueDynamicUserPeerImpl().doInsert(obj, con);
612    }
613
614    /**
615     * Executes a insert into...select statement.
616     *
617     * @param toInsertInto the columns in which to insert, not null.
618     * @param criteria the criteria which selects the values to insert,
619     *        not null.
620     *
621     * @return the number of inserted rows.
622     *
623     * @throws TorqueException if a database error occurs.
624     */
625    public static int doInsert(
626                final Column[] toInsertInto,
627                final Criteria criteria)
628            throws TorqueException
629    {
630        return getTorqueDynamicUserPeerImpl().doInsert(toInsertInto, criteria);
631    }
632
633    /**
634     * Executes a insert into...select statement.
635     *
636     * @param toInsertInto the columns in which to insert, not null.
637     * @param criteria the criteria which selects the values to insert,
638     *        not null.
639     * @param dbName the database name, or null to take the database name
640     *        from getDatabaseName().
641     *
642     * @return the number of inserted rows.
643     *
644     * @throws TorqueException if a database error occurs.
645     */
646    public static int doInsert(
647                final Column[] toInsertInto,
648                final Criteria criteria,
649                final String dbName)
650            throws TorqueException
651    {
652        return getTorqueDynamicUserPeerImpl().doInsert(toInsertInto, criteria, dbName);
653    }
654
655    /**
656     * Executes a insert into...select statement.
657     *
658     * @param toInsertInto the columns in which to insert, not null.
659     * @param criteria the criteria which selects the values to insert,
660     *        not null.
661     * @param connection the database connection to use, not null.
662     *
663     * @return the number of inserted rows.
664     *
665     * @throws TorqueException if a database error occurs.
666     */
667    public static int doInsert(
668                final Column[] toInsertInto,
669                final Criteria criteria,
670                final Connection connection)
671            throws TorqueException
672    {
673        return getTorqueDynamicUserPeerImpl().doInsert(toInsertInto, criteria, connection);
674    }
675
676    /**
677     * Executes a insert into...select statement.
678     *
679     * @param toInsertInto the columns in which to insert, not null.
680     * @param criteria the criteria which selects the values to insert,
681     *        not null.
682     * @param dbName the database name, or null to take the database name
683     *        from getDatabaseName().
684     * @param connection the database connection to use, not null.
685     *
686     * @return the number of inserted rows.
687     *
688     * @throws TorqueException if a database error occurs.
689     */
690    public static int doInsert(
691                final Column[] toInsertInto,
692                final Criteria criteria,
693                String dbName,
694                final Connection connection)
695            throws TorqueException
696    {
697        return getTorqueDynamicUserPeerImpl().doInsert(
698                 toInsertInto,
699                 criteria,
700                 dbName,
701                 connection);
702    }
703
704    /**
705     * Method to do updates.
706     *
707     * @param columnValues the values to update plus the primary key
708     *        identifying the row to update.
709     *
710     * @throws TorqueException Any exceptions caught during processing will be
711     *         rethrown wrapped into a TorqueException.
712     */
713    public static int doUpdate(ColumnValues columnValues) throws TorqueException
714    {
715        return getTorqueDynamicUserPeerImpl().doUpdate(columnValues);
716    }
717
718    /**
719     * Method to do updates.  This method is to be used during a transaction,
720     * otherwise use the doUpdate(Criteria) method.  It will take care of
721     * the connection details internally.
722     *
723     * @param columnValues the values to update plus the primary key
724     *        identifying the row to update.
725     * @param con the connection to use, not null.
726     *
727     * @return the number of affected rows.
728     *
729     * @throws TorqueException Any exceptions caught during processing will be
730     *         rethrown wrapped into a TorqueException.
731     */
732    public static int doUpdate(ColumnValues columnValues, Connection con)
733        throws TorqueException
734    {
735        return getTorqueDynamicUserPeerImpl().doUpdate(columnValues, con);
736    }
737
738    /**
739     * Executes an update against the database. The rows to be updated
740     * are selected using <code>criteria</code> and updated using the values
741     * in <code>updateValues</code>.
742     *
743     * @param selectCriteria selects which rows of which table should be updated.
744     * @param updateValues Which columns to update with which values, not null.
745     *
746     * @return the number of affected rows.
747     *
748     * @throws TorqueException if updating fails.
749     */
750    public static int doUpdate(
751                Criteria selectCriteria,
752                ColumnValues updateValues)
753            throws TorqueException
754    {
755        return getTorqueDynamicUserPeerImpl().doUpdate(
756            selectCriteria,
757            updateValues);
758    }
759
760    /**
761     * Executes an update against the database. The rows to be updated
762     * are selected using <code>criteria</code> and updated using the values
763     * in <code>updateValues</code>.
764     *
765     * @param criteria selects which rows of which table should be updated.
766     * @param updateValues Which columns to update with which values, not null.
767     * @param connection the database connection to use, not null.
768     *
769     * @return the number of affected rows.
770     *
771     * @throws TorqueException if updating fails.
772     */
773    public static int doUpdate(
774                Criteria criteria,
775                ColumnValues updateValues,
776                Connection connection)
777            throws TorqueException
778    {
779        return getTorqueDynamicUserPeerImpl().doUpdate(
780            criteria,
781             updateValues,
782              connection);
783    }
784
785    /**
786     * Updates an TorqueDynamicUser in the database.
787     * The primary key is used to identify the object to update.
788     *
789     * @param obj the data object to update in the database.
790     *
791     * @return the number of affected rows.
792     *
793     * @throws TorqueException Any exceptions caught during processing will be
794     *         rethrown wrapped into a TorqueException.
795     */
796    public static int doUpdate(TorqueDynamicUser obj) throws TorqueException
797    {
798        return getTorqueDynamicUserPeerImpl().doUpdate(obj);
799    }
800
801    /**
802     * Updates a TorqueDynamicUser in the database.
803     * The primary key is used to identify the object to update.
804     * This method is to be used during a transaction,
805     * otherwise the doUpdate(TorqueDynamicUser) method can be used.
806     *
807     * @param obj the data object to update in the database.
808     * @param con the connection to use, not null.
809     
810     * @throws TorqueException Any exceptions caught during processing will be
811     *         rethrown wrapped into a TorqueException.
812     */
813    public static int doUpdate(TorqueDynamicUser obj, Connection con)
814        throws TorqueException
815    {
816        return getTorqueDynamicUserPeerImpl().doUpdate(obj, con);
817    }
818
819    /**
820     * Utility method which executes a given sql statement
821     * as prepared statement.
822     * This method should be used for update, insert, and delete statements.
823     * Use executeQuery() for selects.
824     *
825     * @param statementString A String with the sql statement to execute.
826     *
827     * @return The number of rows affected.
828     *
829     * @throws TorqueException if executing the statement fails
830     *         or no database connection can be established.
831     */
832    public static int executeStatement(String statementString) 
833            throws TorqueException
834    {
835        return getTorqueDynamicUserPeerImpl().executeStatement(statementString);
836    }
837
838    /**
839     * Utility method which executes a given sql statement
840     * as prepared statement.
841     * This method should be used for update, insert, and delete statements.
842     * Use executeQuery() for selects.
843     *
844     * @param statementString A String with the sql statement to execute.
845     * @param replacementValues values to use as placeholders in the query.
846     *        or null or empty if no placeholders need to be filled.
847     *
848     * @return The number of rows affected.
849     *
850     * @throws TorqueException if executing the statement fails
851     *         or no database connection can be established.
852     */
853    public static int executeStatement(
854                String statementString,
855                List<JdbcTypedValue> replacementValues)
856            throws TorqueException
857    {
858        return getTorqueDynamicUserPeerImpl().executeStatement(
859                statementString, 
860                replacementValues);
861    }
862
863    /**
864     * Utility method which executes a given sql statement
865     * as prepared statement.
866     * This method should be used for update, insert, and delete statements.
867     * Use executeQuery() for selects.
868     *
869     * @param statementString A String with the sql statement to execute.
870     * @param dbName The name of the database to execute the statement against,
871     *        or null for the default DB.
872     * @param replacementValues values to use as placeholders in the query.
873     *        or null or empty if no placeholders need to be filled.
874     *
875     * @return The number of rows affected.
876     *
877     * @throws TorqueException if executing the statement fails
878     *         or no database connection can be established.
879     */
880    public static int executeStatement(
881            String statementString,
882            String dbName,
883            List<JdbcTypedValue> replacementValues)
884        throws TorqueException
885    {
886        return getTorqueDynamicUserPeerImpl().executeStatement(
887                statementString, 
888                dbName,
889                replacementValues);
890    }
891
892    /**
893     * Utility method which executes a given sql statement
894     * as prepared statement.
895     * This method should be used for update, insert, and delete statements.
896     * Use executeQuery() for selects.
897     *
898     * @param statementString A String with the sql statement to execute.
899     * @param con The database connection to use.
900     * @param replacementValues values to use as placeholders in the query.
901     *        or null or empty if no placeholders need to be filled.
902     *
903     * @return The number of rows affected.
904     *
905     * @throws TorqueException if executing the statement fails.
906     */
907    public static int executeStatement(
908            String statementString,
909            Connection con,
910            List<JdbcTypedValue> replacementValues)
911        throws TorqueException
912    {
913        return getTorqueDynamicUserPeerImpl().executeStatement(
914                statementString, 
915                con,
916                replacementValues);
917    }
918
919    /**
920     * Utility method which executes a given sql statement
921     * as prepared statement.
922     * This method should be used for update, insert, and delete statements.
923     * Use executeQuery() for selects.
924     *
925     * @param statementString A String with the sql statement to execute,
926     *        containing placeholders of the form ":${placeholderName}".
927     *        ${placeholderName} must contain only letters, digits and the underscore
928     *        Each placeholder must be followed by a space, except when it is at the end of the statement.
929     * @param replacementValues a map mapping the placeholder names to values
930     *        to use as placeholders in the query.
931     *        Can be null or empty if no placeholders need to be filled.
932     *
933     * @return The number of rows affected.
934     *
935     * @throws TorqueException if executing the statement fails.
936     */
937    public static int executeStatement(
938            final String statementString,
939            final Map<String, JdbcTypedValue> replacementValues)
940        throws TorqueException
941    {
942        return getTorqueDynamicUserPeerImpl().executeStatement(
943                statementString,
944                replacementValues);
945    }
946
947    /**
948     * Utility method which executes a given sql statement
949     * as prepared statement.
950     * This method should be used for update, insert, and delete statements.
951     * Use executeQuery() for selects.
952     *
953     * @param statementString A String with the sql statement to execute,
954     *        containing placeholders of the form ":${placeholderName}".
955     *        ${placeholderName} must contain only letters, digits and the underscore
956     *        Each placeholder must be followed by a space, except when it is at the end of the statement.
957     * @param dbName The name of the database to execute the statement against,
958     *        or null for the default DB.
959     * @param replacementValues a map mapping the placeholder names to values
960     *        to use as placeholders in the query.
961     *        Can be null or empty if no placeholders need to be filled.
962     *
963     * @return The number of rows affected.
964     *
965     * @throws TorqueException if executing the statement fails.
966     */
967    public static int executeStatement(
968                final String statementString,
969                final String dbName,
970                final Map<String, JdbcTypedValue> replacementValues)
971            throws TorqueException
972        {
973        return getTorqueDynamicUserPeerImpl().executeStatement(
974                statementString,
975                dbName,
976                replacementValues);
977        }
978
979        /**
980     * Utility method which executes a given sql statement
981     * as prepared statement.
982     * This method should be used for update, insert, and delete statements.
983     * Use executeQuery() for selects.
984     *
985     * @param statementString A String with the sql statement to execute,
986     *        containing placeholders of the form ":${placeholderName}".
987     *        ${placeholderName} must contain only letters, digits and the underscore
988     *        Each placeholder must be followed by a space, except when it is at the end of the statement.
989     * @param con The database connection to use.
990     * @param replacementValues a map mapping the placeholder names (without leading colons)
991     *        to values to use as placeholders in the query.
992     *        Can be null or empty if no placeholders need to be filled.
993     *
994     * @return The number of rows affected.
995     *
996     * @throws TorqueException if executing the statement fails.
997     */
998    public static int executeStatement(
999                final String statementString,
1000                final Connection con,
1001                final Map<String, JdbcTypedValue> replacementValues)
1002            throws TorqueException
1003    {
1004        return getTorqueDynamicUserPeerImpl().executeStatement(
1005                statementString,
1006                con,
1007                replacementValues);
1008    }
1009
1010    
1011    /**
1012     * Deletes rows from a database table.
1013     *
1014     * @param criteria defines the rows to be deleted, not null.
1015     *
1016     * @return the number of deleted rows.
1017     *
1018     * @throws TorqueException Any exceptions caught during processing will be
1019     *         rethrown wrapped into a TorqueException.
1020     */
1021     public static int doDelete(Criteria criteria) throws TorqueException
1022     {
1023        return getTorqueDynamicUserPeerImpl().doDelete(criteria);
1024     }
1025
1026    /**
1027     * Deletes rows from a table.
1028     * This method uses the passed connection to delete the rows;
1029     * if a transaction is open in the connection, the deletion happens inside
1030     * this transaction.
1031    *
1032     * @param criteria defines the rows to be deleted, not null.
1033     * @param con the connection to use, not null.
1034     *
1035     * @return the number of deleted rows.
1036     *
1037     * @throws TorqueException Any exceptions caught during processing will be
1038     *         rethrown wrapped into a TorqueException.
1039     */
1040     public static int doDelete(Criteria criteria, Connection con)
1041        throws TorqueException
1042     {
1043        return getTorqueDynamicUserPeerImpl().doDelete(criteria, con);
1044     }
1045
1046    /**
1047     * Deletes a data object, i.e. a row in a table, in the database.
1048     *
1049     * @param obj the data object to delete in the database, not null.
1050     *
1051     * @return the number of deleted rows.
1052     *
1053     * @throws TorqueException Any exceptions caught during processing will be
1054     *         rethrown wrapped into a TorqueException.
1055     */
1056    public static int doDelete(TorqueDynamicUser obj) throws TorqueException
1057    {
1058        return getTorqueDynamicUserPeerImpl().doDelete(obj);
1059    }
1060
1061    /**
1062     * Deletes a data object, i.e. a row in a table, in the database.
1063     * This method uses the passed connection to delete the rows;
1064     * if a transaction is open in the connection, the deletion happens inside
1065     * this transaction.
1066     *
1067     * @param obj the data object to delete in the database, not null.
1068     * @param con the connection to use, not null.
1069     *
1070     * @return the number of deleted rows.
1071     *
1072     * @throws TorqueException Any exceptions caught during processing will be
1073     *         rethrown wrapped into a TorqueException.
1074     */
1075    public static int doDelete(TorqueDynamicUser obj, Connection con)
1076        throws TorqueException
1077    {
1078        return getTorqueDynamicUserPeerImpl().doDelete(obj, con);
1079    }
1080
1081    /**
1082     * Deletes data objects, i.e. rows in a table, in the database.
1083     *
1084     * @param objects the datas object to delete in the database, not null,
1085     *        may not contain null.
1086     *
1087     * @return the number of deleted rows.
1088     *
1089     * @throws TorqueException Any exceptions caught during processing will be
1090     *         rethrown wrapped into a TorqueException.
1091     */
1092    public static int doDelete(Collection<TorqueDynamicUser> objects)
1093            throws TorqueException
1094    {
1095        return getTorqueDynamicUserPeerImpl().doDelete(objects);
1096    }
1097
1098    /**
1099     * Deletes data objects, i.e. rows in a table, in the database.
1100     * This method uses the passed connection to delete the rows;
1101     * if a transaction is open in the connection, the deletion happens inside
1102     * this transaction.
1103     *
1104     * @param objects the datas object to delete in the database, not null,
1105     *        may not contain null.
1106     * @param con the connection to use for deleting, not null.
1107     *
1108     * @return the number of deleted rows.
1109     *
1110     * @throws TorqueException Any exceptions caught during processing will be
1111     *         rethrown wrapped into a TorqueException.
1112     */
1113    public static int doDelete(
1114            Collection<TorqueDynamicUser> objects,
1115            Connection con)
1116        throws TorqueException
1117    {
1118        return getTorqueDynamicUserPeerImpl().doDelete(objects, con);
1119    }
1120
1121    /**
1122     * Deletes a row in the database.
1123     *
1124     * @param pk the ObjectKey that identifies the row to delete.
1125     *
1126     * @return the number of deleted rows.
1127     *
1128     * @throws TorqueException Any exceptions caught during processing will be
1129     *         rethrown wrapped into a TorqueException.
1130     */
1131    public static int doDelete(ObjectKey<?> pk) throws TorqueException
1132    {
1133        return getTorqueDynamicUserPeerImpl().doDelete(pk);
1134    }
1135
1136    /**
1137     * Deletes a row in the database.
1138     * This method uses the passed connection to delete the rows;
1139     * if a transaction is open in the connection, the deletion happens inside
1140     * this transaction.
1141     *
1142     * @param pk the ObjectKey that identifies the row to delete.
1143     * @param con the connection to use for deleting, not null.
1144     *
1145     * @return the number of deleted rows.
1146     *
1147     * @throws TorqueException Any exceptions caught during processing will be
1148     *         rethrown wrapped into a TorqueException.
1149     */
1150    public static int doDelete(ObjectKey<?> pk, Connection con)
1151        throws TorqueException
1152    {
1153        return getTorqueDynamicUserPeerImpl().doDelete(pk, con);
1154    }
1155
1156    /** 
1157     * Build a Criteria object which selects all objects which have a given
1158     * primary key.
1159     *
1160     * @param pk the primary key value to build the criteria from, not null.
1161     */
1162    public static Criteria buildCriteria(ObjectKey<?> pk)
1163    {
1164        return getTorqueDynamicUserPeerImpl().buildCriteria(pk);
1165    }
1166
1167    /** 
1168     * Build a Criteria object which selects all objects which primary keys
1169     * are contained in the passed collection.
1170     *
1171     * @param pks the primary key values to build the criteria from, not null,
1172     *        may not contain null.
1173     */
1174    public static Criteria buildCriteria(Collection<ObjectKey<?>> pks)
1175    {
1176        return getTorqueDynamicUserPeerImpl().buildCriteria(pks);
1177    }
1178
1179    /** 
1180     * Build a Criteria object which selects all passed objects using their
1181     * primary key. Objects which do not yet have a primary key are ignored.
1182     *
1183     * @param objects the objects to build the criteria from, not null,
1184     *        may not contain null.
1185     */
1186    public static Criteria buildPkCriteria(
1187            Collection<TorqueDynamicUser> objects)
1188    {
1189        return getTorqueDynamicUserPeerImpl().buildPkCriteria(objects);
1190    }
1191
1192    /** 
1193     * Build a Criteria object from the data object for this peer.
1194     *
1195     * @param obj the object to build the criteria from, not null.
1196     */
1197    public static Criteria buildCriteria(TorqueDynamicUser obj)
1198    {
1199        return getTorqueDynamicUserPeerImpl().buildCriteria(obj);
1200    }
1201
1202    /** 
1203     * Build a Criteria object from the data object for this peer,
1204     * skipping all binary columns.
1205     *
1206     * @param obj the object to build the criteria from, not null.
1207     */
1208    public static Criteria buildSelectCriteria(TorqueDynamicUser obj)
1209    {
1210        return getTorqueDynamicUserPeerImpl().buildSelectCriteria(obj);
1211    }
1212
1213    /** 
1214     * Returns the contents of the object as ColumnValues object
1215     *
1216     * @throws TorqueException if the table map cannot be retrieved
1217     *         (should not happen).
1218     */
1219    public static ColumnValues buildColumnValues(TorqueDynamicUser torqueDynamicUser)
1220            throws TorqueException
1221    {
1222        
1223        return getTorqueDynamicUserPeerImpl().buildColumnValues(torqueDynamicUser);
1224    }
1225
1226    /**
1227     * Retrieve a single object by pk
1228     *
1229     * @param pk the primary key
1230     * @throws TorqueException Any exceptions caught during processing will be
1231     *         rethrown wrapped into a TorqueException.
1232     * @throws NoRowsException Primary key was not found in database.
1233     * @throws TooManyRowsException Primary key was not found in database.
1234     */
1235    public static TorqueDynamicUser retrieveByPK(Integer pk)
1236        throws TorqueException, NoRowsException, TooManyRowsException
1237    {
1238        return getTorqueDynamicUserPeerImpl().retrieveByPK(pk);
1239    }
1240
1241    /**
1242     * Retrieve a single object by pk
1243     *
1244     * @param pk the primary key
1245     * @param con the connection to use
1246     * @throws TorqueException Any exceptions caught during processing will be
1247     *         rethrown wrapped into a TorqueException.
1248     * @throws NoRowsException Primary key was not found in database.
1249     * @throws TooManyRowsException Primary key was not found in database.
1250     */
1251    public static TorqueDynamicUser retrieveByPK(Integer pk, Connection con)
1252        throws TorqueException, NoRowsException, TooManyRowsException
1253    {
1254        return getTorqueDynamicUserPeerImpl().retrieveByPK(pk, con);
1255    }
1256    
1257    
1258    
1259
1260    /**
1261     * Retrieve a single object by pk
1262     *
1263     * @param pk the primary key
1264     * @throws TorqueException Any exceptions caught during processing will be
1265     *         rethrown wrapped into a TorqueException.
1266     * @throws NoRowsException Primary key was not found in database.
1267     * @throws TooManyRowsException Primary key was not found in database.
1268     */
1269    public static TorqueDynamicUser retrieveByPK(ObjectKey<?> pk)
1270        throws TorqueException, NoRowsException, TooManyRowsException
1271    {
1272        return getTorqueDynamicUserPeerImpl().retrieveByPK(pk);
1273    }
1274
1275    /**
1276     * Retrieve a single object by pk
1277     *
1278     * @param pk the primary key
1279     * @param con the connection to use
1280     * @throws TorqueException Any exceptions caught during processing will be
1281     *         rethrown wrapped into a TorqueException.
1282     * @throws NoRowsException Primary key was not found in database.
1283     * @throws TooManyRowsException Primary key was not found in database.
1284     */
1285    public static TorqueDynamicUser retrieveByPK(ObjectKey<?> pk, Connection con)
1286        throws TorqueException, NoRowsException, TooManyRowsException
1287    {
1288        return getTorqueDynamicUserPeerImpl().retrieveByPK(pk, con);
1289    }
1290
1291
1292    /**
1293     * Retrieve multiple objects by pk.
1294     *
1295     * @param pks List of primary keys
1296     *
1297     * @return the list of matching objects, not null.
1298     *
1299     * @throws TorqueException Any exceptions caught during processing will be
1300     *         rethrown wrapped into a TorqueException.
1301     */
1302    public static List<TorqueDynamicUser> retrieveByTypedPKs(Collection<Integer> pks)
1303        throws TorqueException
1304    {
1305        return getTorqueDynamicUserPeerImpl().retrieveByTypedPKs(pks);
1306    }
1307
1308    /**
1309     * Retrieve multiple objects by pk.
1310     *
1311     * @param pks List of primary keys
1312     * @param dbcon the connection to use
1313     *
1314     * @return the list of matching objects, not null.
1315     *
1316     * @throws TorqueException Any exceptions caught during processing will be
1317     *         rethrown wrapped into a TorqueException.
1318     */
1319    public static List<TorqueDynamicUser> retrieveByTypedPKs(
1320                Collection<Integer> pks,
1321                Connection dbcon)
1322            throws TorqueException
1323    {
1324        return getTorqueDynamicUserPeerImpl().retrieveByTypedPKs(pks, dbcon);
1325    }
1326
1327    /**
1328     * Retrieve a multiple objects by pk.
1329     *
1330     * @param pks List of primary keys
1331     *
1332     * @return the list of matching objects, not null.
1333     *
1334     * @throws TorqueException Any exceptions caught during processing will be
1335     *         rethrown wrapped into a TorqueException.
1336     */
1337    public static List<TorqueDynamicUser> retrieveByObjectKeys(Collection<ObjectKey<?>> pks)
1338        throws TorqueException
1339    {
1340        return getTorqueDynamicUserPeerImpl().retrieveByObjectKeys(pks);
1341    }
1342
1343    /**
1344     * Retrieve multiple objects by pk.
1345     *
1346     * @param pks List of primary keys
1347     * @param con the connection to use
1348     *
1349     * @return the list of matching objects, not null.
1350     *
1351     * @throws TorqueException Any exceptions caught during processing will be
1352     *         rethrown wrapped into a TorqueException.
1353     */
1354    public static List<TorqueDynamicUser> retrieveByObjectKeys(Collection<ObjectKey<?>> pks, Connection con)
1355        throws TorqueException
1356    {
1357        return getTorqueDynamicUserPeerImpl().retrieveByObjectKeys(pks, con);
1358    }
1359
1360
1361
1362
1363    /** 
1364     * Saves the passed collection as linked objects.
1365     * This means the following is done:
1366     * <ul>
1367     *  <li>
1368     *    The current collection of objects which are linked to toLinkTo
1369     *    and which are also in the list toSave is read from the database
1370     *    into the list intersection.
1371     *  </li>
1372     *  <li>
1373     *    All objects in toSave which are not in intersection are inserted.
1374     *  </li>
1375     *  <li>
1376     *    All objects in intersection are updated with the 
1377     *    corresponding values in toSave and saved.
1378     *  </li>
1379     *  <li>
1380     *    All objects in the database which are linked to toLinkTo but are 
1381     *    not in toSave are deleted from the database.
1382     *  </li>
1383     * </ul>
1384     *
1385     * @param toLinkTo the object which collections should be set with the
1386     *        values in toSave.
1387     * @param toSave Contains the objects to save, not null, 
1388     *        may not contain null.
1389     *
1390     * @throws TorqueException if an error accessing the database occurs.
1391     * @throws NullPointerException if toSave is null or contains null elements.
1392     */
1393    public static void setAndSaveTorqueDynamicUserGroups(
1394            TorqueDynamicUser toLinkTo,
1395            Collection<TorqueDynamicUserGroup> toSave) 
1396        throws TorqueException
1397    {
1398        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserGroups(toLinkTo, toSave);
1399    }
1400
1401    /** 
1402     * Saves the passed collection as linked objects.
1403     * This means the following is done:
1404     * <ul>
1405     *  <li>
1406     *    The current collection of objects which are linked to toLinkTo
1407     *    and which are also in the list toSave is read from the database
1408     *    into the list intersection.
1409     *  </li>
1410     *  <li>
1411     *    All objects in toSave which are not in intersection are inserted.
1412     *  </li>
1413     *  <li>
1414     *    All objects in intersection are updated with the 
1415     *    corresponding values in toSave and saved.
1416     *  </li>
1417     *  <li>
1418     *    All objects in the database which are linked to toLinkTo but are 
1419     *    not in toSave are deleted from the database.
1420     *  </li>
1421     * </ul>
1422     *
1423     * @param toLinkTo the object which collections should be set with the
1424     *        values in toSave.
1425     * @param toSave Contains the objects to save, not null, 
1426     *        may not contain null.
1427     * @param connection the database connection to use.
1428     *
1429     * @throws TorqueException if an error accessing the database occurs.
1430     * @throws NullPointerException if toSave is null or contains null elements.
1431     */
1432    public void setAndSaveTorqueDynamicUserGroups(
1433            TorqueDynamicUser toLinkTo,
1434            Collection<TorqueDynamicUserGroup> toSave,
1435            Connection connection) 
1436        throws TorqueException
1437    {
1438        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserGroups(toLinkTo, toSave);
1439    }
1440    /** 
1441     * Saves the passed collection as linked objects.
1442     * This means the following is done:
1443     * <ul>
1444     *  <li>
1445     *    The current collection of objects which are linked to toLinkTo
1446     *    and which are also in the list toSave is read from the database
1447     *    into the list intersection.
1448     *  </li>
1449     *  <li>
1450     *    All objects in toSave which are not in intersection are inserted.
1451     *  </li>
1452     *  <li>
1453     *    All objects in intersection are updated with the 
1454     *    corresponding values in toSave and saved.
1455     *  </li>
1456     *  <li>
1457     *    All objects in the database which are linked to toLinkTo but are 
1458     *    not in toSave are deleted from the database.
1459     *  </li>
1460     * </ul>
1461     *
1462     * @param toLinkTo the object which collections should be set with the
1463     *        values in toSave.
1464     * @param toSave Contains the objects to save, not null, 
1465     *        may not contain null.
1466     *
1467     * @throws TorqueException if an error accessing the database occurs.
1468     * @throws NullPointerException if toSave is null or contains null elements.
1469     */
1470    public static void setAndSaveTorqueDynamicUserDelegatesRelatedByDelegatorUserIds(
1471            TorqueDynamicUser toLinkTo,
1472            Collection<TorqueDynamicUserDelegates> toSave) 
1473        throws TorqueException
1474    {
1475        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserDelegatesRelatedByDelegatorUserIds(toLinkTo, toSave);
1476    }
1477
1478    /** 
1479     * Saves the passed collection as linked objects.
1480     * This means the following is done:
1481     * <ul>
1482     *  <li>
1483     *    The current collection of objects which are linked to toLinkTo
1484     *    and which are also in the list toSave is read from the database
1485     *    into the list intersection.
1486     *  </li>
1487     *  <li>
1488     *    All objects in toSave which are not in intersection are inserted.
1489     *  </li>
1490     *  <li>
1491     *    All objects in intersection are updated with the 
1492     *    corresponding values in toSave and saved.
1493     *  </li>
1494     *  <li>
1495     *    All objects in the database which are linked to toLinkTo but are 
1496     *    not in toSave are deleted from the database.
1497     *  </li>
1498     * </ul>
1499     *
1500     * @param toLinkTo the object which collections should be set with the
1501     *        values in toSave.
1502     * @param toSave Contains the objects to save, not null, 
1503     *        may not contain null.
1504     * @param connection the database connection to use.
1505     *
1506     * @throws TorqueException if an error accessing the database occurs.
1507     * @throws NullPointerException if toSave is null or contains null elements.
1508     */
1509    public void setAndSaveTorqueDynamicUserDelegatesRelatedByDelegatorUserIds(
1510            TorqueDynamicUser toLinkTo,
1511            Collection<TorqueDynamicUserDelegates> toSave,
1512            Connection connection) 
1513        throws TorqueException
1514    {
1515        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserDelegatesRelatedByDelegatorUserIds(toLinkTo, toSave);
1516    }
1517    /** 
1518     * Saves the passed collection as linked objects.
1519     * This means the following is done:
1520     * <ul>
1521     *  <li>
1522     *    The current collection of objects which are linked to toLinkTo
1523     *    and which are also in the list toSave is read from the database
1524     *    into the list intersection.
1525     *  </li>
1526     *  <li>
1527     *    All objects in toSave which are not in intersection are inserted.
1528     *  </li>
1529     *  <li>
1530     *    All objects in intersection are updated with the 
1531     *    corresponding values in toSave and saved.
1532     *  </li>
1533     *  <li>
1534     *    All objects in the database which are linked to toLinkTo but are 
1535     *    not in toSave are deleted from the database.
1536     *  </li>
1537     * </ul>
1538     *
1539     * @param toLinkTo the object which collections should be set with the
1540     *        values in toSave.
1541     * @param toSave Contains the objects to save, not null, 
1542     *        may not contain null.
1543     *
1544     * @throws TorqueException if an error accessing the database occurs.
1545     * @throws NullPointerException if toSave is null or contains null elements.
1546     */
1547    public static void setAndSaveTorqueDynamicUserDelegatesRelatedByDelegateeUserIds(
1548            TorqueDynamicUser toLinkTo,
1549            Collection<TorqueDynamicUserDelegates> toSave) 
1550        throws TorqueException
1551    {
1552        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserDelegatesRelatedByDelegateeUserIds(toLinkTo, toSave);
1553    }
1554
1555    /** 
1556     * Saves the passed collection as linked objects.
1557     * This means the following is done:
1558     * <ul>
1559     *  <li>
1560     *    The current collection of objects which are linked to toLinkTo
1561     *    and which are also in the list toSave is read from the database
1562     *    into the list intersection.
1563     *  </li>
1564     *  <li>
1565     *    All objects in toSave which are not in intersection are inserted.
1566     *  </li>
1567     *  <li>
1568     *    All objects in intersection are updated with the 
1569     *    corresponding values in toSave and saved.
1570     *  </li>
1571     *  <li>
1572     *    All objects in the database which are linked to toLinkTo but are 
1573     *    not in toSave are deleted from the database.
1574     *  </li>
1575     * </ul>
1576     *
1577     * @param toLinkTo the object which collections should be set with the
1578     *        values in toSave.
1579     * @param toSave Contains the objects to save, not null, 
1580     *        may not contain null.
1581     * @param connection the database connection to use.
1582     *
1583     * @throws TorqueException if an error accessing the database occurs.
1584     * @throws NullPointerException if toSave is null or contains null elements.
1585     */
1586    public void setAndSaveTorqueDynamicUserDelegatesRelatedByDelegateeUserIds(
1587            TorqueDynamicUser toLinkTo,
1588            Collection<TorqueDynamicUserDelegates> toSave,
1589            Connection connection) 
1590        throws TorqueException
1591    {
1592        getTorqueDynamicUserPeerImpl().setAndSaveTorqueDynamicUserDelegatesRelatedByDelegateeUserIds(toLinkTo, toSave);
1593    }
1594
1595    /**
1596     * Returns the TableMap related to this peer.
1597     *
1598     * @return the table map, not null.
1599     *
1600     * @throws TorqueException if the Peer instance does not hold a Table map.
1601     */
1602    public static TableMap getTableMap()
1603        throws TorqueException
1604    {
1605        return getTorqueDynamicUserPeerImpl().getTableMap();
1606    }
1607
1608    public static void initDatabaseMap()
1609    {
1610    }
1611
1612
1613}