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