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