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