001package org.apache.turbine.services.schedule; 002 003import java.sql.Connection; 004import java.sql.SQLException; 005import java.sql.ResultSet; 006import java.io.IOException; 007import java.io.InputStream; 008import java.util.ArrayList; 009import java.util.Collection; 010import java.util.Date; 011import java.util.Iterator; 012import java.util.List; 013 014import org.apache.commons.logging.Log; 015import org.apache.commons.logging.LogFactory; 016import org.apache.torque.NoRowsException; 017import org.apache.torque.TooManyRowsException; 018import org.apache.torque.Column; 019import org.apache.torque.Torque; 020import org.apache.torque.TorqueException; 021import org.apache.torque.TorqueRuntimeException; 022import org.apache.torque.adapter.IDMethod; 023import org.apache.torque.criteria.Criteria; 024import org.apache.torque.map.DatabaseMap; 025import org.apache.torque.map.TableMap; 026import org.apache.torque.map.ColumnMap; 027import org.apache.torque.map.ForeignKeyMap; 028import org.apache.torque.map.InheritanceMap; 029import org.apache.torque.om.mapper.RecordMapper; 030import org.apache.torque.om.mapper.CompositeMapper; 031import org.apache.torque.om.DateKey; 032import org.apache.torque.om.NumberKey; 033import org.apache.torque.om.StringKey; 034import org.apache.torque.om.ObjectKey; 035import org.apache.torque.om.SimpleKey; 036import org.apache.torque.util.Transaction; 037import org.apache.torque.util.ColumnValues; 038import org.apache.torque.util.JdbcTypedValue; 039 040 041 042/** 043 * The skeleton for this class was autogenerated by Torque on: 044 * 045 * [Mon Mar 05 12:40:05 CET 2018] 046 * 047 * You should not use this class directly. It should not even be 048 * extended; all references should be to JobEntryTorquePeer 049 */ 050 051public abstract class BaseJobEntryTorquePeer 052{ 053 /** The class log. */ 054 private static Log log = LogFactory.getLog(BaseJobEntryTorquePeerImpl.class); 055 /** The default database name for this class. */ 056 public static final String DATABASE_NAME; 057 058 /** The table name for this class. */ 059 public static final String TABLE_NAME; 060 061 /** The table map for this class. */ 062 public static final TableMap TABLE; 063 /** The column for the JOB_ID field */ 064 public static final ColumnMap JOB_ID; 065 /** The column for the SECOND field */ 066 public static final ColumnMap SECOND; 067 /** The column for the MINUTE field */ 068 public static final ColumnMap MINUTE; 069 /** The column for the HOUR field */ 070 public static final ColumnMap HOUR; 071 /** The column for the WEEK_DAY field */ 072 public static final ColumnMap WEEK_DAY; 073 /** The column for the DAY_OF_MONTH field */ 074 public static final ColumnMap DAY_OF_MONTH; 075 /** The column for the TASK field */ 076 public static final ColumnMap TASK; 077 /** The column for the EMAIL field */ 078 public static final ColumnMap EMAIL; 079 /** The column for the PROPERTY field */ 080 public static final ColumnMap PROPERTY; 081 082 /** number of columns for this peer */ 083 public static final int numColumns = 9; 084 085 086 /** The implementation of the peer. */ 087 private static JobEntryTorquePeerImpl jobEntryTorquePeerImpl; 088 089 090 static 091 { 092 DatabaseMap dbMap = Torque.getOrCreateDatabase("default") 093 .getDatabaseMap(); 094 if (dbMap.getTable("TURBINE_SCHEDULED_JOB") == null) 095 { 096 dbMap.addTable("TURBINE_SCHEDULED_JOB"); 097 } 098 DATABASE_NAME = "default"; 099 TABLE_NAME = "TURBINE_SCHEDULED_JOB"; 100 101 TABLE = dbMap.getTable("TURBINE_SCHEDULED_JOB"); 102 TABLE.setJavaName("JobEntryTorque"); 103 TABLE.setOMClass(org.apache.turbine.services.schedule.JobEntryTorque.class); 104 TABLE.setPeerClass(org.apache.turbine.services.schedule.JobEntryTorquePeer.class); 105 TABLE.setPrimaryKeyMethod(IDMethod.ID_BROKER); 106 TABLE.setPrimaryKeyMethodInfo(IDMethod.ID_BROKER, TABLE.getName()); 107 TABLE.setPrimaryKeyMethodInfo(IDMethod.SEQUENCE, "$sequenceName"); 108 TABLE.setPrimaryKeyMethodInfo(IDMethod.AUTO_INCREMENT, "TURBINE_SCHEDULED_JOB"); 109 TABLE.setUseInheritance(true); 110 111 112 // ------------- Column: JOB_ID -------------------- 113 JOB_ID = new ColumnMap("JOB_ID", TABLE); 114 JOB_ID.setType(Integer.valueOf(0)); 115 JOB_ID.setTorqueType("INTEGER"); 116 JOB_ID.setUsePrimitive(true); 117 JOB_ID.setPrimaryKey(true); 118 JOB_ID.setNotNull(true); 119 JOB_ID.setJavaName("JobId"); 120 JOB_ID.setAutoIncrement(true); 121 JOB_ID.setProtected(false); 122 JOB_ID.setJavaType( "int" ); 123 JOB_ID.setPosition(1); 124 TABLE.addColumn(JOB_ID); 125 // ------------- Column: SECOND -------------------- 126 SECOND = new ColumnMap("SECOND", TABLE); 127 SECOND.setType(Integer.valueOf(0)); 128 SECOND.setTorqueType("INTEGER"); 129 SECOND.setUsePrimitive(true); 130 SECOND.setPrimaryKey(false); 131 SECOND.setNotNull(true); 132 SECOND.setJavaName("Second"); 133 SECOND.setAutoIncrement(true); 134 SECOND.setProtected(false); 135 SECOND.setJavaType( "int" ); 136 SECOND.setDefault("-1"); 137 SECOND.setPosition(2); 138 TABLE.addColumn(SECOND); 139 // ------------- Column: MINUTE -------------------- 140 MINUTE = new ColumnMap("MINUTE", TABLE); 141 MINUTE.setType(Integer.valueOf(0)); 142 MINUTE.setTorqueType("INTEGER"); 143 MINUTE.setUsePrimitive(true); 144 MINUTE.setPrimaryKey(false); 145 MINUTE.setNotNull(true); 146 MINUTE.setJavaName("Minute"); 147 MINUTE.setAutoIncrement(true); 148 MINUTE.setProtected(false); 149 MINUTE.setJavaType( "int" ); 150 MINUTE.setDefault("-1"); 151 MINUTE.setPosition(3); 152 TABLE.addColumn(MINUTE); 153 // ------------- Column: HOUR -------------------- 154 HOUR = new ColumnMap("HOUR", TABLE); 155 HOUR.setType(Integer.valueOf(0)); 156 HOUR.setTorqueType("INTEGER"); 157 HOUR.setUsePrimitive(true); 158 HOUR.setPrimaryKey(false); 159 HOUR.setNotNull(true); 160 HOUR.setJavaName("Hour"); 161 HOUR.setAutoIncrement(true); 162 HOUR.setProtected(false); 163 HOUR.setJavaType( "int" ); 164 HOUR.setDefault("-1"); 165 HOUR.setPosition(4); 166 TABLE.addColumn(HOUR); 167 // ------------- Column: WEEK_DAY -------------------- 168 WEEK_DAY = new ColumnMap("WEEK_DAY", TABLE); 169 WEEK_DAY.setType(Integer.valueOf(0)); 170 WEEK_DAY.setTorqueType("INTEGER"); 171 WEEK_DAY.setUsePrimitive(true); 172 WEEK_DAY.setPrimaryKey(false); 173 WEEK_DAY.setNotNull(true); 174 WEEK_DAY.setJavaName("WeekDay"); 175 WEEK_DAY.setAutoIncrement(true); 176 WEEK_DAY.setProtected(false); 177 WEEK_DAY.setJavaType( "int" ); 178 WEEK_DAY.setDefault("-1"); 179 WEEK_DAY.setPosition(5); 180 TABLE.addColumn(WEEK_DAY); 181 // ------------- Column: DAY_OF_MONTH -------------------- 182 DAY_OF_MONTH = new ColumnMap("DAY_OF_MONTH", TABLE); 183 DAY_OF_MONTH.setType(Integer.valueOf(0)); 184 DAY_OF_MONTH.setTorqueType("INTEGER"); 185 DAY_OF_MONTH.setUsePrimitive(true); 186 DAY_OF_MONTH.setPrimaryKey(false); 187 DAY_OF_MONTH.setNotNull(true); 188 DAY_OF_MONTH.setJavaName("DayOfMonth"); 189 DAY_OF_MONTH.setAutoIncrement(true); 190 DAY_OF_MONTH.setProtected(false); 191 DAY_OF_MONTH.setJavaType( "int" ); 192 DAY_OF_MONTH.setDefault("-1"); 193 DAY_OF_MONTH.setPosition(6); 194 TABLE.addColumn(DAY_OF_MONTH); 195 // ------------- Column: TASK -------------------- 196 TASK = new ColumnMap("TASK", TABLE); 197 TASK.setType(""); 198 TASK.setTorqueType("VARCHAR"); 199 TASK.setUsePrimitive(false); 200 TASK.setPrimaryKey(false); 201 TASK.setNotNull(true); 202 TASK.setJavaName("Task"); 203 TASK.setAutoIncrement(true); 204 TASK.setProtected(false); 205 TASK.setJavaType( "String" ); 206 TASK.setSize(99); 207 TASK.setPosition(7); 208 TABLE.addColumn(TASK); 209 // ------------- Column: EMAIL -------------------- 210 EMAIL = new ColumnMap("EMAIL", TABLE); 211 EMAIL.setType(""); 212 EMAIL.setTorqueType("VARCHAR"); 213 EMAIL.setUsePrimitive(false); 214 EMAIL.setPrimaryKey(false); 215 EMAIL.setNotNull(false); 216 EMAIL.setJavaName("Email"); 217 EMAIL.setAutoIncrement(true); 218 EMAIL.setProtected(false); 219 EMAIL.setJavaType( "String" ); 220 EMAIL.setSize(99); 221 EMAIL.setPosition(8); 222 TABLE.addColumn(EMAIL); 223 // ------------- Column: PROPERTY -------------------- 224 PROPERTY = new ColumnMap("PROPERTY", TABLE); 225 PROPERTY.setType(new Object()); 226 PROPERTY.setTorqueType("VARBINARY"); 227 PROPERTY.setUsePrimitive(false); 228 PROPERTY.setPrimaryKey(false); 229 PROPERTY.setNotNull(false); 230 PROPERTY.setJavaName("Property"); 231 PROPERTY.setAutoIncrement(true); 232 PROPERTY.setProtected(false); 233 PROPERTY.setJavaType( "byte[]" ); 234 PROPERTY.setPosition(9); 235 TABLE.addColumn(PROPERTY); 236 237 238 239 initDatabaseMap(); 240 } 241 242 /** 243 * Creates a new instance of the implementation of the peer. 244 * 245 * @return the new instance. 246 */ 247 protected static JobEntryTorquePeerImpl createJobEntryTorquePeerImpl() 248 { 249 JobEntryTorquePeerImpl instance = new JobEntryTorquePeerImpl(); 250 return instance; 251 } 252 253 254 /** 255 * Returns an instance of the implementation of the peer. 256 * If no instance is currently cached, a new instance is created and cached. 257 * 258 * @return an instance of the implementation of the peer, not null. 259 */ 260 public static JobEntryTorquePeerImpl getJobEntryTorquePeerImpl() 261 { 262 JobEntryTorquePeerImpl peerImplInstance = jobEntryTorquePeerImpl; 263 if (peerImplInstance == null) 264 { 265 peerImplInstance = JobEntryTorquePeer.createJobEntryTorquePeerImpl(); 266 jobEntryTorquePeerImpl = peerImplInstance; 267 } 268 return peerImplInstance; 269 } 270 271 272 273 /** 274 * Sets the instance of the implementation of the peer. 275 * 276 * @param an instance of the implementation of the peer, or null 277 * if a new instance should be created automatically. 278 */ 279 public static void setJobEntryTorquePeerImpl(JobEntryTorquePeerImpl peerImplInstance) 280 { 281 jobEntryTorquePeerImpl = peerImplInstance; 282 } 283 284 285 /** 286 * Add all the columns needed to create a new object. 287 * 288 * @param criteria object containing the columns to add. 289 * @throws TorqueException Any exceptions caught during processing will be 290 * rethrown wrapped into a TorqueException. 291 */ 292 public static void addSelectColumns(Criteria criteria) 293 throws TorqueException 294 { 295 getJobEntryTorquePeerImpl().addSelectColumns(criteria); 296 } 297 298 /** 299 * changes the boolean values in the criteria to the appropriate type, 300 * whenever a booleanchar or booleanint column is involved. 301 * This enables the user to create criteria using Boolean values 302 * for booleanchar or booleanint columns. 303 * 304 * @param criteria the criteria in which the boolean values 305 * should be corrected. 306 * 307 * @throws TorqueException if the database map for the criteria cannot be 308 obtained. 309 */ 310 public static void correctBooleans(Criteria criteria) throws TorqueException 311 { 312 getJobEntryTorquePeerImpl().correctBooleans(criteria); 313 } 314 315 /** 316 * Checks all columns in the criteria to see whether 317 * booleanchar and booleanint columns are queried with a boolean. 318 * If yes, the query values are mapped onto values the database 319 * does understand, i.e. 0 and 1 for booleanints and N and Y for 320 * booleanchar columns. 321 * 322 * @param columnValues The value to be checked for booleanint 323 * and booleanchar columns. 324 * @throws TorqueException if the database map for the criteria cannot be 325 * retrieved. 326 */ 327 public static void correctBooleans( 328 ColumnValues columnValues) 329 throws TorqueException 330 { 331 getJobEntryTorquePeerImpl().correctBooleans(columnValues); 332 } 333 334 /** 335 * Selects JobEntryTorque objects from a database. 336 * 337 * @param criteria object used to create the SELECT statement. 338 * 339 * @return the list of selected objects, not null. 340 * 341 * @throws TorqueException Any exceptions caught during processing will be 342 * rethrown wrapped into a TorqueException. 343 */ 344 public static List<JobEntryTorque> doSelect(Criteria criteria) 345 throws TorqueException 346 { 347 return getJobEntryTorquePeerImpl().doSelect(criteria); 348 } 349 350 /** 351 * Selects JobEntryTorque objects from a database 352 * within a transaction. 353 * 354 * @param criteria object used to create the SELECT statement. 355 * @param connection the connection holding the transaction, not null. 356 * 357 * @return The list of selected objects, not null. 358 * 359 * @throws TorqueException Any exceptions caught during processing will be 360 * rethrown wrapped into a TorqueException. 361 */ 362 public static List<JobEntryTorque> doSelect( 363 Criteria criteria, 364 Connection connection) 365 throws TorqueException 366 { 367 return getJobEntryTorquePeerImpl().doSelect(criteria, connection); 368 } 369 370 /** 371 * Selects rows from a database an maps them to objects. 372 * 373 * @param criteria A Criteria specifying the records to select, not null. 374 * @param mapper The mapper creating the objects from the resultSet, 375 * not null. 376 * 377 * @return The results of the query, not null. 378 * 379 * @throws TorqueException if querying the database fails. 380 */ 381 public static <T> List<T> doSelect( 382 Criteria criteria, 383 RecordMapper<T> mapper) 384 throws TorqueException 385 { 386 return getJobEntryTorquePeerImpl().doSelect(criteria, mapper); 387 } 388 389 /** 390 * Selects rows from a database an maps them to objects. 391 * 392 * @param criteria A Criteria specifying the records to select, not null. 393 * @param mapper The mapper creating the objects from the resultSet, 394 * not null. 395 * @param connection the database connection for selecting records, 396 * not null. 397 * 398 * @return The results of the query, not null. 399 * @throws TorqueException Error performing database query. 400 */ 401 public static <T> List<T> doSelect( 402 Criteria criteria, 403 RecordMapper<T> mapper, 404 Connection connection) 405 throws TorqueException 406 { 407 return getJobEntryTorquePeerImpl().doSelect( 408 criteria, 409 mapper, 410 connection); 411 } 412 413 /** 414 * Selects rows from a database an maps them to objects. 415 * 416 * @param query the sql query to execute, not null. 417 * @param mapper The mapper creating the objects from the resultSet, 418 * not null. 419 * @param dbName The name of the database to create the connection for, 420 * or null for the default SDB. 421 * 422 * @return The results of the query, not null. 423 * 424 * @throws TorqueException if querying the database fails. 425 */ 426 public static <T> List<T> doSelect( 427 String query, 428 RecordMapper<T> mapper, 429 String dbName) 430 throws TorqueException 431 { 432 return getJobEntryTorquePeerImpl().doSelect( 433 query, 434 mapper, 435 dbName); 436 } 437 438 /** 439 * Selects rows from a database an maps them to objects. 440 * 441 * @param query the SQL Query to execute, not null. 442 * @param mapper The mapper creating the objects from the resultSet, 443 * not null. 444 * @param connection the database connection, not null. 445 * 446 * @return The results of the query, not null. 447 * 448 * @throws TorqueException if querying the database fails. 449 */ 450 public static <T> List<T> doSelect( 451 String query, 452 RecordMapper<T> mapper, 453 Connection connection) 454 throws TorqueException 455 { 456 return getJobEntryTorquePeerImpl().doSelect( 457 query, 458 mapper, 459 connection); 460 } 461 462 /** 463 * Selects JobEntryTorque objects from the database which have 464 * the same content as the passed object. 465 * 466 * @return The list of selected objects, not null. 467 * 468 * @throws TorqueException Any exceptions caught during processing will be 469 * rethrown wrapped into a TorqueException. 470 */ 471 public static List<JobEntryTorque> doSelect(JobEntryTorque obj) 472 throws TorqueException 473 { 474 return getJobEntryTorquePeerImpl().doSelect(obj); 475 } 476 477 /** 478 * Selects at most one JobEntryTorque object from a database. 479 * 480 * @param criteria object used to create the SELECT statement. 481 * 482 * @return the selected Object, or null if no object was selected. 483 * 484 * @throws TorqueException If more than one record is selected or if 485 * an error occurs when processing the query. 486 */ 487 public static JobEntryTorque doSelectSingleRecord( 488 Criteria criteria) 489 throws TorqueException 490 { 491 return getJobEntryTorquePeerImpl().doSelectSingleRecord(criteria); 492 } 493 494 /** 495 * Selects at most one JobEntryTorque object from a database 496 * within a transaction. 497 * 498 * @param criteria object used to create the SELECT statement. 499 * @param connection the connection holding the transaction, not null. 500 * 501 * @return the selected Object, or null if no object was selected. 502 * 503 * @throws TorqueException If more than one record is selected or if 504 * an error occurs when processing the query. 505 */ 506 public static JobEntryTorque doSelectSingleRecord( 507 Criteria criteria, 508 Connection connection) 509 throws TorqueException 510 { 511 return getJobEntryTorquePeerImpl().doSelectSingleRecord(criteria, connection); 512 } 513 514 /** 515 * Selects at most a single row from a database an maps them to objects. 516 * 517 * @param criteria A Criteria specifying the records to select, not null. 518 * @param mapper The mapper creating the objects from the resultSet, 519 * not null. 520 * 521 * @return The selected row, or null if no records was selected. 522 * 523 * @throws TorqueException if querying the database fails. 524 */ 525 public static <T> T doSelectSingleRecord( 526 org.apache.torque.criteria.Criteria criteria, 527 RecordMapper<T> mapper) 528 throws TorqueException 529 { 530 return getJobEntryTorquePeerImpl().doSelectSingleRecord( 531 criteria, 532 mapper); 533 } 534 535 /** 536 * Selects at most a single row from a database an maps them to objects. 537 * 538 * @param criteria A Criteria specifying the records to select, not null. 539 * @param mapper The mapper creating the objects from the resultSet, 540 * not null. 541 * @param connection the database connection, not null. 542 * 543 * @return The selected row, or null if no records was selected. 544 * 545 * @throws TorqueException if querying the database fails. 546 */ 547 public static <T> T doSelectSingleRecord( 548 org.apache.torque.criteria.Criteria criteria, 549 RecordMapper<T> mapper, 550 Connection connection) 551 throws TorqueException 552 { 553 return getJobEntryTorquePeerImpl().doSelectSingleRecord( 554 criteria, 555 mapper, 556 connection); 557 } 558 559 /** 560 * Selects at most one JobEntryTorque object from the database 561 * which has the same content as the passed object. 562 * 563 * @return the selected Object, or null if no object was selected. 564 * 565 * @throws TorqueException If more than one record is selected or if 566 * an error occurs when processing the query. 567 */ 568 public static JobEntryTorque doSelectSingleRecord( 569 JobEntryTorque obj) 570 throws TorqueException 571 { 572 return getJobEntryTorquePeerImpl().doSelectSingleRecord(obj); 573 } 574 575 576 /** 577 * Returns a new instance of the Data object class 578 */ 579 public static JobEntryTorque getDbObjectInstance() 580 { 581 return getJobEntryTorquePeerImpl().getDbObjectInstance(); 582 } 583 584 585 /** 586 * Method to do inserts. 587 * 588 * @param columnValues the values to insert. 589 * 590 * @return the primary key of the inserted row. 591 * 592 * @throws TorqueException Any exceptions caught during processing will be 593 * rethrown wrapped into a TorqueException. 594 */ 595 public static ObjectKey doInsert(ColumnValues columnValues) 596 throws TorqueException 597 { 598 return getJobEntryTorquePeerImpl().doInsert(columnValues); 599 } 600 601 /** 602 * Method to do inserts. This method is to be used during a transaction, 603 * otherwise use the doInsert(Criteria) method. 604 * 605 * @param columnValues the values to insert. 606 * @param con the connection to use, not null. 607 * 608 * @return the primary key of the inserted row. 609 * 610 * @throws TorqueException Any exceptions caught during processing will be 611 * rethrown wrapped into a TorqueException. 612 */ 613 public static ObjectKey doInsert(ColumnValues columnValues, Connection con) 614 throws TorqueException 615 { 616 return getJobEntryTorquePeerImpl().doInsert(columnValues, con); 617 } 618 /** 619 * Method to do inserts 620 * 621 * @throws TorqueException Any exceptions caught during processing will be 622 * rethrown wrapped into a TorqueException. 623 */ 624 public static void doInsert(JobEntryTorque obj) 625 throws TorqueException 626 { 627 getJobEntryTorquePeerImpl().doInsert(obj); 628 } 629 630 /** 631 * Method to do inserts. This method is to be used during a transaction, 632 * otherwise use the doInsert(JobEntryTorque) method. It will take 633 * care of the connection details internally. 634 * 635 * @param obj the data object to insert into the database. 636 * @param con the connection to use 637 * @throws TorqueException Any exceptions caught during processing will be 638 * rethrown wrapped into a TorqueException. 639 */ 640 public static void doInsert(JobEntryTorque obj, Connection con) 641 throws TorqueException 642 { 643 getJobEntryTorquePeerImpl().doInsert(obj, con); 644 } 645 646 /** 647 * Method to do updates. 648 * 649 * @param columnValues the values to update plus the primary key 650 * identifying the row to update. 651 * @throws TorqueException Any exceptions caught during processing will be 652 * rethrown wrapped into a TorqueException. 653 */ 654 public static int doUpdate(ColumnValues columnValues) throws TorqueException 655 { 656 return getJobEntryTorquePeerImpl().doUpdate(columnValues); 657 } 658 659 /** 660 * Method to do updates. This method is to be used during a transaction, 661 * otherwise use the doUpdate(Criteria) method. It will take care of 662 * the connection details internally. 663 * 664 * @param columnValues the values to update plus the primary key 665 * identifying the row to update. 666 * @param con the connection to use, not null. 667 * 668 * @return the number of affected rows. 669 * 670 * @throws TorqueException Any exceptions caught during processing will be 671 * rethrown wrapped into a TorqueException. 672 */ 673 public static int doUpdate(ColumnValues columnValues, Connection con) 674 throws TorqueException 675 { 676 return getJobEntryTorquePeerImpl().doUpdate(columnValues, con); 677 } 678 679 /** 680 * Executes an update against the database. The rows to be updated 681 * are selected using <code>criteria</code> and updated using the values 682 * in <code>updateValues</code>. 683 * 684 * @param criteria selects which rows of which table should be updated. 685 * @param updateValues Which columns to update with which values, not null. 686 * 687 * @return the number of affected rows. 688 * 689 * @throws TorqueException if updating fails. 690 */ 691 public static int doUpdate( 692 Criteria selectCriteria, 693 ColumnValues updateValues) 694 throws TorqueException 695 { 696 return getJobEntryTorquePeerImpl().doUpdate( 697 selectCriteria, 698 updateValues); 699 } 700 701 /** 702 * Executes an update against the database. The rows to be updated 703 * are selected using <code>criteria</code> and updated using the values 704 * in <code>updateValues</code>. 705 * 706 * @param criteria selects which rows of which table should be updated. 707 * @param updateValues Which columns to update with which values, not null. 708 * @param connection the database connection to use, not null. 709 * 710 * @return the number of affected rows. 711 * 712 * @throws TorqueException if updating fails. 713 */ 714 public static int doUpdate( 715 Criteria criteria, 716 ColumnValues updateValues, 717 Connection connection) 718 throws TorqueException 719 { 720 return getJobEntryTorquePeerImpl().doUpdate( 721 criteria, 722 updateValues, 723 connection); 724 } 725 726 /** 727 * Updates an JobEntryTorque in the database. 728 * The primary key is used to identify the object to update. 729 * 730 * @param obj the data object to update in the database. 731 * 732 * @return the number of affected rows. 733 * 734 * @throws TorqueException Any exceptions caught during processing will be 735 * rethrown wrapped into a TorqueException. 736 */ 737 public static int doUpdate(JobEntryTorque obj) throws TorqueException 738 { 739 return getJobEntryTorquePeerImpl().doUpdate(obj); 740 } 741 742 /** 743 * Updates a JobEntryTorque in the database. 744 * The primary key is used to identify the object to update. 745 * This method is to be used during a transaction, 746 * otherwise the doUpdate(JobEntryTorque) method can be used. 747 * 748 * @param obj the data object to update in the database. 749 * @param con the connection to use, not null. 750 751 * @throws TorqueException Any exceptions caught during processing will be 752 * rethrown wrapped into a TorqueException. 753 */ 754 public static int doUpdate(JobEntryTorque obj, Connection con) 755 throws TorqueException 756 { 757 return getJobEntryTorquePeerImpl().doUpdate(obj, con); 758 } 759 760 /** 761 * Utility method which executes a given sql statement 762 * as prepared statement. 763 * This method should be used for update, insert, and delete statements. 764 * Use executeQuery() for selects. 765 * 766 * @param statementString A String with the sql statement to execute. 767 * 768 * @return The number of rows affected. 769 * 770 * @throws TorqueException if executing the statement fails 771 * or no database connection can be established. 772 */ 773 public static int executeStatement(String statementString) 774 throws TorqueException 775 { 776 return getJobEntryTorquePeerImpl().executeStatement(statementString); 777 } 778 779 /** 780 * Utility method which executes a given sql statement 781 * as prepared statement. 782 * This method should be used for update, insert, and delete statements. 783 * Use executeQuery() for selects. 784 * 785 * @param statementString A String with the sql statement to execute. 786 * @param replacementValues values to use as placeholders in the query. 787 * or null or empty if no placeholders need to be filled. 788 * 789 * @return The number of rows affected. 790 * 791 * @throws TorqueException if executing the statement fails 792 * or no database connection can be established. 793 */ 794 public static int executeStatement( 795 String statementString, 796 List<JdbcTypedValue> replacementValues) 797 throws TorqueException 798 { 799 return getJobEntryTorquePeerImpl().executeStatement( 800 statementString, 801 replacementValues); 802 } 803 804 /** 805 * Utility method which executes a given sql statement 806 * as prepared statement. 807 * This method should be used for update, insert, and delete statements. 808 * Use executeQuery() for selects. 809 * 810 * @param statementString A String with the sql statement to execute. 811 * @param dbName The name of the database to execute the statement against, 812 * or null for the default DB. 813 * @param replacementValues values to use as placeholders in the query. 814 * or null or empty if no placeholders need to be filled. 815 * 816 * @return The number of rows affected. 817 * 818 * @throws TorqueException if executing the statement fails 819 * or no database connection can be established. 820 */ 821 public static int executeStatement( 822 String statementString, 823 String dbName, 824 List<JdbcTypedValue> replacementValues) 825 throws TorqueException 826 { 827 return getJobEntryTorquePeerImpl().executeStatement( 828 statementString, 829 dbName, 830 replacementValues); 831 } 832 833 /** 834 * Utility method which executes a given sql statement 835 * as prepared statement. 836 * This method should be used for update, insert, and delete statements. 837 * Use executeQuery() for selects. 838 * 839 * @param statementString A String with the sql statement to execute. 840 * @param con The database connection to use. 841 * @param replacementValues values to use as placeholders in the query. 842 * or null or empty if no placeholders need to be filled. 843 * 844 * @return The number of rows affected. 845 * 846 * @throws TorqueException if executing the statement fails. 847 */ 848 public static int executeStatement( 849 String statementString, 850 Connection con, 851 List<JdbcTypedValue> replacementValues) 852 throws TorqueException 853 { 854 return getJobEntryTorquePeerImpl().executeStatement( 855 statementString, 856 con, 857 replacementValues); 858 } 859 860 /** 861 * Deletes rows from a database table. 862 * 863 * @param criteria defines the rows to be deleted, not null. 864 * 865 * @return the number of deleted rows. 866 * 867 * @throws TorqueException Any exceptions caught during processing will be 868 * rethrown wrapped into a TorqueException. 869 */ 870 public static int doDelete(Criteria criteria) throws TorqueException 871 { 872 return getJobEntryTorquePeerImpl().doDelete(criteria); 873 } 874 875 /** 876 * Deletes rows from a table. 877 * This method uses the passed connection to delete the rows; 878 * if a transaction is open in the connection, the deletion happens inside 879 * this transaction. 880 * 881 * @param criteria defines the rows to be deleted, not null. 882 * @param con the connection to use, not null. 883 * 884 * @return the number of deleted rows. 885 * 886 * @throws TorqueException Any exceptions caught during processing will be 887 * rethrown wrapped into a TorqueException. 888 */ 889 public static int doDelete(Criteria criteria, Connection con) 890 throws TorqueException 891 { 892 return getJobEntryTorquePeerImpl().doDelete(criteria, con); 893 } 894 895 /** 896 * Deletes a data object, i.e. a row in a table, in the database. 897 * 898 * @param obj the data object to delete in the database, not null. 899 * 900 * @return the number of deleted rows. 901 * 902 * @throws TorqueException Any exceptions caught during processing will be 903 * rethrown wrapped into a TorqueException. 904 */ 905 public static int doDelete(JobEntryTorque obj) throws TorqueException 906 { 907 return getJobEntryTorquePeerImpl().doDelete(obj); 908 } 909 910 /** 911 * Deletes a data object, i.e. a row in a table, in the database. 912 * This method uses the passed connection to delete the rows; 913 * if a transaction is open in the connection, the deletion happens inside 914 * this transaction. 915 * 916 * @param obj the data object to delete in the database, not null. 917 * @param con the connection to use, not null. 918 * 919 * @return the number of deleted rows. 920 * 921 * @throws TorqueException Any exceptions caught during processing will be 922 * rethrown wrapped into a TorqueException. 923 */ 924 public static int doDelete(JobEntryTorque obj, Connection con) 925 throws TorqueException 926 { 927 return getJobEntryTorquePeerImpl().doDelete(obj, con); 928 } 929 930 /** 931 * Deletes data objects, i.e. rows in a table, in the database. 932 * 933 * @param objects the datas object to delete in the database, not null, 934 * may not contain null. 935 * 936 * @return the number of deleted rows. 937 * 938 * @throws TorqueException Any exceptions caught during processing will be 939 * rethrown wrapped into a TorqueException. 940 */ 941 public static int doDelete(Collection<JobEntryTorque> objects) 942 throws TorqueException 943 { 944 return getJobEntryTorquePeerImpl().doDelete(objects); 945 } 946 947 /** 948 * Deletes data objects, i.e. rows in a table, in the database. 949 * This method uses the passed connection to delete the rows; 950 * if a transaction is open in the connection, the deletion happens inside 951 * this transaction. 952 * 953 * @param objects the datas object to delete in the database, not null, 954 * may not contain null. 955 * @param con the connection to use for deleting, not null. 956 * 957 * @return the number of deleted rows. 958 * 959 * @throws TorqueException Any exceptions caught during processing will be 960 * rethrown wrapped into a TorqueException. 961 */ 962 public static int doDelete( 963 Collection<JobEntryTorque> objects, 964 Connection con) 965 throws TorqueException 966 { 967 return getJobEntryTorquePeerImpl().doDelete(objects, con); 968 } 969 970 /** 971 * Deletes a row in the database. 972 * 973 * @param pk the ObjectKey that identifies the row to delete. 974 * 975 * @return the number of deleted rows. 976 * 977 * @throws TorqueException Any exceptions caught during processing will be 978 * rethrown wrapped into a TorqueException. 979 */ 980 public static int doDelete(ObjectKey pk) throws TorqueException 981 { 982 return getJobEntryTorquePeerImpl().doDelete(pk); 983 } 984 985 /** 986 * Deletes a row in the database. 987 * This method uses the passed connection to delete the rows; 988 * if a transaction is open in the connection, the deletion happens inside 989 * this transaction. 990 * 991 * @param pk the ObjectKey that identifies the row to delete. 992 * @param con the connection to use for deleting, not null. 993 * 994 * @return the number of deleted rows. 995 * 996 * @throws TorqueException Any exceptions caught during processing will be 997 * rethrown wrapped into a TorqueException. 998 */ 999 public static int doDelete(ObjectKey pk, Connection con) 1000 throws TorqueException 1001 { 1002 return getJobEntryTorquePeerImpl().doDelete(pk, con); 1003 } 1004 1005 /** 1006 * Build a Criteria object which selects all objects which have a given 1007 * primary key. 1008 * 1009 * @param pk the primary key value to build the criteria from, not null. 1010 */ 1011 public static Criteria buildCriteria(ObjectKey pk) 1012 { 1013 return getJobEntryTorquePeerImpl().buildCriteria(pk); 1014 } 1015 1016 /** 1017 * Build a Criteria object which selects all objects which primary keys 1018 * are contained in the passed collection. 1019 * 1020 * @param pks the primary key values to build the criteria from, not null, 1021 * may not contain null. 1022 */ 1023 public static Criteria buildCriteria(Collection<ObjectKey> pks) 1024 { 1025 return getJobEntryTorquePeerImpl().buildCriteria(pks); 1026 } 1027 1028 /** 1029 * Build a Criteria object which selects all passed objects using their 1030 * primary key. Objects which do not yet have a primary key are ignored. 1031 * 1032 * @param objects the objects to build the criteria from, not null, 1033 * may not contain null. 1034 */ 1035 public static Criteria buildPkCriteria( 1036 Collection<JobEntryTorque> objects) 1037 { 1038 return getJobEntryTorquePeerImpl().buildPkCriteria(objects); 1039 } 1040 1041 /** 1042 * Build a Criteria object from the data object for this peer. 1043 * 1044 * @param obj the object to build the criteria from, not null. 1045 */ 1046 public static Criteria buildCriteria(JobEntryTorque obj) 1047 { 1048 return getJobEntryTorquePeerImpl().buildCriteria(obj); 1049 } 1050 1051 /** 1052 * Build a Criteria object from the data object for this peer, 1053 * skipping all binary columns. 1054 * 1055 * @param obj the object to build the criteria from, not null. 1056 */ 1057 public static Criteria buildSelectCriteria(JobEntryTorque obj) 1058 { 1059 return getJobEntryTorquePeerImpl().buildSelectCriteria(obj); 1060 } 1061 1062 /** 1063 * Returns the contents of the object as ColumnValues object 1064 * 1065 * @throws TorqueException if the table map cannot be retrieved 1066 * (should not happen). 1067 */ 1068 public static ColumnValues buildColumnValues(JobEntryTorque jobEntryTorque) 1069 throws TorqueException 1070 { 1071 1072 return getJobEntryTorquePeerImpl().buildColumnValues(jobEntryTorque); 1073 } 1074 1075 /** 1076 * Retrieve a single object by pk 1077 * 1078 * @param pk the primary key 1079 * @throws TorqueException Any exceptions caught during processing will be 1080 * rethrown wrapped into a TorqueException. 1081 * @throws NoRowsException Primary key was not found in database. 1082 * @throws TooManyRowsException Primary key was not found in database. 1083 */ 1084 public static JobEntryTorque retrieveByPK(int pk) 1085 throws TorqueException, NoRowsException, TooManyRowsException 1086 { 1087 return getJobEntryTorquePeerImpl().retrieveByPK(pk); 1088 } 1089 1090 /** 1091 * Retrieve a single object by pk 1092 * 1093 * @param pk the primary key 1094 * @param con the connection to use 1095 * @throws TorqueException Any exceptions caught during processing will be 1096 * rethrown wrapped into a TorqueException. 1097 * @throws NoRowsException Primary key was not found in database. 1098 * @throws TooManyRowsException Primary key was not found in database. 1099 */ 1100 public static JobEntryTorque retrieveByPK(int pk, Connection con) 1101 throws TorqueException, NoRowsException, TooManyRowsException 1102 { 1103 return getJobEntryTorquePeerImpl().retrieveByPK(pk, con); 1104 } 1105 1106 1107 1108 1109 /** 1110 * Retrieve a single object by pk 1111 * 1112 * @param pk the primary key 1113 * @throws TorqueException Any exceptions caught during processing will be 1114 * rethrown wrapped into a TorqueException. 1115 * @throws NoRowsException Primary key was not found in database. 1116 * @throws TooManyRowsException Primary key was not found in database. 1117 */ 1118 public static JobEntryTorque retrieveByPK(ObjectKey pk) 1119 throws TorqueException, NoRowsException, TooManyRowsException 1120 { 1121 return getJobEntryTorquePeerImpl().retrieveByPK(pk); 1122 } 1123 1124 /** 1125 * Retrieve a single object by pk 1126 * 1127 * @param pk the primary key 1128 * @param con the connection to use 1129 * @throws TorqueException Any exceptions caught during processing will be 1130 * rethrown wrapped into a TorqueException. 1131 * @throws NoRowsException Primary key was not found in database. 1132 * @throws TooManyRowsException Primary key was not found in database. 1133 */ 1134 public static JobEntryTorque retrieveByPK(ObjectKey pk, Connection con) 1135 throws TorqueException, NoRowsException, TooManyRowsException 1136 { 1137 return getJobEntryTorquePeerImpl().retrieveByPK(pk, con); 1138 } 1139 1140 1141 /** 1142 * Retrieve a multiple objects by pk 1143 * 1144 * @param pks List of primary keys 1145 * @throws TorqueException Any exceptions caught during processing will be 1146 * rethrown wrapped into a TorqueException. 1147 */ 1148 public static List<JobEntryTorque> retrieveByPKs(Collection<ObjectKey> pks) 1149 throws TorqueException 1150 { 1151 return getJobEntryTorquePeerImpl().retrieveByPKs(pks); 1152 } 1153 1154 /** 1155 * Retrieve multiple objects by pk 1156 * 1157 * @param pks List of primary keys 1158 * @param con the connection to use 1159 * @throws TorqueException Any exceptions caught during processing will be 1160 * rethrown wrapped into a TorqueException. 1161 */ 1162 public static List<JobEntryTorque> retrieveByPKs(Collection<ObjectKey> pks, Connection con) 1163 throws TorqueException 1164 { 1165 return getJobEntryTorquePeerImpl().retrieveByPKs(pks,con); 1166 } 1167 1168 1169 1170 1171 1172 /** 1173 * Returns the TableMap related to this peer. 1174 * 1175 * @return the table map, not null. 1176 * 1177 * @throws TorqueException if the Peer instance does not hold a Table map. 1178 */ 1179 public static TableMap getTableMap() 1180 throws TorqueException 1181 { 1182 return getJobEntryTorquePeerImpl().getTableMap(); 1183 } 1184 1185 public static void initDatabaseMap() 1186 { 1187 } 1188 1189 1190}