| 1 | |
package org.apache.turbine.services.schedule; |
| 2 | |
|
| 3 | |
import java.sql.Blob; |
| 4 | |
import java.sql.Clob; |
| 5 | |
import java.sql.Connection; |
| 6 | |
import java.sql.SQLException; |
| 7 | |
import java.sql.ResultSet; |
| 8 | |
import java.sql.PreparedStatement; |
| 9 | |
import java.sql.Types; |
| 10 | |
import java.io.IOException; |
| 11 | |
import java.io.InputStream; |
| 12 | |
import java.io.ByteArrayInputStream; |
| 13 | |
import java.io.ByteArrayOutputStream; |
| 14 | |
import java.io.Reader; |
| 15 | |
import java.io.StringReader; |
| 16 | |
import java.io.StringWriter; |
| 17 | |
import java.util.ArrayList; |
| 18 | |
import java.util.Collection; |
| 19 | |
import java.util.Date; |
| 20 | |
import java.util.Iterator; |
| 21 | |
import java.util.LinkedList; |
| 22 | |
import java.util.List; |
| 23 | |
import java.util.Map; |
| 24 | |
import java.util.HashMap; |
| 25 | |
import java.util.Set; |
| 26 | |
import java.util.HashSet; |
| 27 | |
|
| 28 | |
import org.apache.commons.lang.ObjectUtils; |
| 29 | |
import org.apache.commons.logging.Log; |
| 30 | |
import org.apache.commons.logging.LogFactory; |
| 31 | |
import org.apache.torque.NoRowsException; |
| 32 | |
import org.apache.torque.OptimisticLockingFailedException; |
| 33 | |
import org.apache.torque.TooManyRowsException; |
| 34 | |
import org.apache.torque.Torque; |
| 35 | |
import org.apache.torque.TorqueException; |
| 36 | |
import org.apache.torque.TorqueRuntimeException; |
| 37 | |
import org.apache.torque.criteria.Criteria; |
| 38 | |
import org.apache.torque.criteria.Criterion; |
| 39 | |
import org.apache.torque.om.mapper.RecordMapper; |
| 40 | |
import org.apache.torque.om.mapper.CompositeMapper; |
| 41 | |
import org.apache.torque.om.DateKey; |
| 42 | |
import org.apache.torque.om.NumberKey; |
| 43 | |
import org.apache.torque.om.StringKey; |
| 44 | |
import org.apache.torque.om.ObjectKey; |
| 45 | |
import org.apache.torque.om.SimpleKey; |
| 46 | |
import org.apache.torque.om.ComboKey; |
| 47 | |
import org.apache.torque.map.TableMap; |
| 48 | |
import org.apache.torque.util.Transaction; |
| 49 | |
import org.apache.torque.util.ColumnValues; |
| 50 | |
import org.apache.torque.util.JdbcTypedValue; |
| 51 | |
|
| 52 | |
|
| 53 | |
|
| 54 | |
|
| 55 | |
|
| 56 | |
|
| 57 | |
|
| 58 | |
|
| 59 | |
|
| 60 | |
|
| 61 | |
|
| 62 | |
|
| 63 | |
public abstract class BaseJobEntryTorquePeerImpl |
| 64 | |
extends org.apache.torque.util.BasePeerImpl<JobEntryTorque> |
| 65 | |
{ |
| 66 | |
|
| 67 | 0 | private static Log log = LogFactory.getLog(BaseJobEntryTorquePeerImpl.class); |
| 68 | |
|
| 69 | |
|
| 70 | |
private static final long serialVersionUID = 1450726821151L; |
| 71 | |
|
| 72 | |
|
| 73 | |
|
| 74 | |
|
| 75 | |
|
| 76 | |
|
| 77 | |
|
| 78 | |
|
| 79 | |
public BaseJobEntryTorquePeerImpl() |
| 80 | |
{ |
| 81 | 0 | this(new JobEntryTorqueRecordMapper(), |
| 82 | |
JobEntryTorquePeer.TABLE, |
| 83 | |
JobEntryTorquePeer.DATABASE_NAME); |
| 84 | 0 | } |
| 85 | |
|
| 86 | |
|
| 87 | |
|
| 88 | |
|
| 89 | |
|
| 90 | |
|
| 91 | |
|
| 92 | |
|
| 93 | |
public BaseJobEntryTorquePeerImpl( |
| 94 | |
RecordMapper<JobEntryTorque> recordMapper, |
| 95 | |
TableMap tableMap, |
| 96 | |
String databaseName) |
| 97 | |
{ |
| 98 | 0 | super(recordMapper, tableMap, databaseName); |
| 99 | 0 | } |
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
|
| 105 | |
|
| 106 | |
|
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
public List<JobEntryTorque> doSelect(JobEntryTorque obj) |
| 112 | |
throws TorqueException |
| 113 | |
{ |
| 114 | 0 | return doSelect(buildSelectCriteria(obj)); |
| 115 | |
} |
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
|
| 120 | |
|
| 121 | |
|
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
|
| 126 | |
public JobEntryTorque doSelectSingleRecord( |
| 127 | |
JobEntryTorque obj) |
| 128 | |
throws TorqueException |
| 129 | |
{ |
| 130 | 0 | List<JobEntryTorque> jobEntryTorqueList = doSelect(obj); |
| 131 | 0 | JobEntryTorque jobEntryTorque = null; |
| 132 | 0 | if (jobEntryTorqueList.size() > 1) |
| 133 | |
{ |
| 134 | 0 | throw new TooManyRowsException("Object " + obj |
| 135 | |
+ " matched more than one record"); |
| 136 | |
} |
| 137 | 0 | if (!jobEntryTorqueList.isEmpty()) |
| 138 | |
{ |
| 139 | 0 | jobEntryTorque = jobEntryTorqueList.get(0); |
| 140 | |
} |
| 141 | 0 | return jobEntryTorque; |
| 142 | |
} |
| 143 | |
|
| 144 | |
|
| 145 | |
|
| 146 | |
|
| 147 | |
public JobEntryTorque getDbObjectInstance() |
| 148 | |
{ |
| 149 | 0 | return new JobEntryTorque(); |
| 150 | |
} |
| 151 | |
|
| 152 | |
|
| 153 | |
|
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
|
| 159 | |
|
| 160 | |
|
| 161 | |
|
| 162 | |
|
| 163 | |
public ObjectKey doInsert(ColumnValues columnValues) throws TorqueException |
| 164 | |
{ |
| 165 | 0 | Connection connection = null; |
| 166 | |
try |
| 167 | |
{ |
| 168 | 0 | connection = Transaction.begin( |
| 169 | |
JobEntryTorquePeer.DATABASE_NAME); |
| 170 | 0 | ObjectKey result = doInsert(columnValues, connection); |
| 171 | 0 | Transaction.commit(connection); |
| 172 | 0 | connection = null; |
| 173 | 0 | return result; |
| 174 | |
} |
| 175 | |
finally |
| 176 | |
{ |
| 177 | 0 | if (connection != null) |
| 178 | |
{ |
| 179 | 0 | Transaction.safeRollback(connection); |
| 180 | |
} |
| 181 | |
} |
| 182 | |
} |
| 183 | |
|
| 184 | |
|
| 185 | |
|
| 186 | |
|
| 187 | |
|
| 188 | |
|
| 189 | |
|
| 190 | |
|
| 191 | |
|
| 192 | |
|
| 193 | |
|
| 194 | |
|
| 195 | |
|
| 196 | |
public ObjectKey doInsert(ColumnValues columnValues, Connection con) |
| 197 | |
throws TorqueException |
| 198 | |
{ |
| 199 | 0 | correctBooleans(columnValues); |
| 200 | 0 | return super.doInsert(columnValues, con); |
| 201 | |
} |
| 202 | |
|
| 203 | |
|
| 204 | |
|
| 205 | |
|
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | |
public void doInsert(JobEntryTorque obj) throws TorqueException |
| 210 | |
{ |
| 211 | 0 | obj.setPrimaryKey(doInsert(buildColumnValues(obj))); |
| 212 | 0 | obj.setNew(false); |
| 213 | 0 | obj.setModified(false); |
| 214 | 0 | } |
| 215 | |
|
| 216 | |
|
| 217 | |
|
| 218 | |
|
| 219 | |
|
| 220 | |
|
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
|
| 225 | |
|
| 226 | |
public void doInsert(JobEntryTorque obj, Connection con) |
| 227 | |
throws TorqueException |
| 228 | |
{ |
| 229 | 0 | ObjectKey primaryKey = doInsert(buildColumnValues(obj), con); |
| 230 | 0 | if (primaryKey != null) |
| 231 | |
{ |
| 232 | 0 | obj.setPrimaryKey(primaryKey); |
| 233 | |
} |
| 234 | 0 | obj.setNew(false); |
| 235 | 0 | obj.setModified(false); |
| 236 | 0 | } |
| 237 | |
|
| 238 | |
|
| 239 | |
|
| 240 | |
|
| 241 | |
|
| 242 | |
|
| 243 | |
|
| 244 | |
|
| 245 | |
|
| 246 | |
|
| 247 | |
|
| 248 | |
|
| 249 | |
public int doUpdate(ColumnValues columnValues) throws TorqueException |
| 250 | |
{ |
| 251 | 0 | Connection connection = null; |
| 252 | |
try |
| 253 | |
{ |
| 254 | 0 | connection = Transaction.begin( |
| 255 | |
JobEntryTorquePeer.DATABASE_NAME); |
| 256 | 0 | int result = doUpdate(columnValues, connection); |
| 257 | 0 | Transaction.commit(connection); |
| 258 | 0 | connection = null; |
| 259 | 0 | return result; |
| 260 | |
} |
| 261 | |
finally |
| 262 | |
{ |
| 263 | 0 | if (connection != null) |
| 264 | |
{ |
| 265 | 0 | Transaction.safeRollback(connection); |
| 266 | |
} |
| 267 | |
} |
| 268 | |
} |
| 269 | |
|
| 270 | |
|
| 271 | |
|
| 272 | |
|
| 273 | |
|
| 274 | |
|
| 275 | |
|
| 276 | |
|
| 277 | |
|
| 278 | |
|
| 279 | |
|
| 280 | |
|
| 281 | |
|
| 282 | |
|
| 283 | |
public int doUpdate(ColumnValues columnValues, Connection con) |
| 284 | |
throws TorqueException |
| 285 | |
{ |
| 286 | 0 | Criteria selectCriteria |
| 287 | |
= new Criteria(JobEntryTorquePeer.DATABASE_NAME); |
| 288 | 0 | correctBooleans(columnValues); |
| 289 | |
|
| 290 | 0 | selectCriteria.where( |
| 291 | |
JobEntryTorquePeer.JOB_ID, |
| 292 | |
columnValues.remove(JobEntryTorquePeer.JOB_ID).getValue()); |
| 293 | |
|
| 294 | |
|
| 295 | 0 | int rowCount = doUpdate(selectCriteria, columnValues, con); |
| 296 | 0 | return rowCount; |
| 297 | |
} |
| 298 | |
|
| 299 | |
|
| 300 | |
|
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
|
| 306 | |
|
| 307 | |
|
| 308 | |
|
| 309 | |
|
| 310 | |
public int doUpdate(JobEntryTorque obj) throws TorqueException |
| 311 | |
{ |
| 312 | 0 | ColumnValues columnValues = buildColumnValues(obj); |
| 313 | 0 | int result = doUpdate(columnValues); |
| 314 | 0 | obj.setModified(false); |
| 315 | 0 | return result; |
| 316 | |
} |
| 317 | |
|
| 318 | |
|
| 319 | |
|
| 320 | |
|
| 321 | |
|
| 322 | |
|
| 323 | |
|
| 324 | |
|
| 325 | |
|
| 326 | |
|
| 327 | |
|
| 328 | |
|
| 329 | |
|
| 330 | |
|
| 331 | |
|
| 332 | |
public int doUpdate(JobEntryTorque obj, Connection con) |
| 333 | |
throws TorqueException |
| 334 | |
{ |
| 335 | 0 | ColumnValues columnValues = buildColumnValues(obj); |
| 336 | 0 | int result = doUpdate(columnValues, con); |
| 337 | 0 | obj.setModified(false); |
| 338 | 0 | return result; |
| 339 | |
} |
| 340 | |
|
| 341 | |
|
| 342 | |
|
| 343 | |
|
| 344 | |
|
| 345 | |
|
| 346 | |
|
| 347 | |
|
| 348 | |
|
| 349 | |
|
| 350 | |
|
| 351 | |
public int doDelete(JobEntryTorque obj) throws TorqueException |
| 352 | |
{ |
| 353 | 0 | int result = doDelete(buildCriteria(obj.getPrimaryKey())); |
| 354 | 0 | obj.setDeleted(true); |
| 355 | 0 | return result; |
| 356 | |
} |
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
|
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
|
| 370 | |
|
| 371 | |
public int doDelete(JobEntryTorque obj, Connection con) |
| 372 | |
throws TorqueException |
| 373 | |
{ |
| 374 | 0 | int result = doDelete(buildCriteria(obj.getPrimaryKey()), con); |
| 375 | 0 | obj.setDeleted(true); |
| 376 | 0 | return result; |
| 377 | |
} |
| 378 | |
|
| 379 | |
|
| 380 | |
|
| 381 | |
|
| 382 | |
|
| 383 | |
|
| 384 | |
|
| 385 | |
|
| 386 | |
|
| 387 | |
|
| 388 | |
|
| 389 | |
|
| 390 | |
public int doDelete(Collection<JobEntryTorque> objects) |
| 391 | |
throws TorqueException |
| 392 | |
{ |
| 393 | 0 | int result = doDelete(buildPkCriteria(objects)); |
| 394 | 0 | for (JobEntryTorque object : objects) |
| 395 | |
{ |
| 396 | 0 | object.setDeleted(true); |
| 397 | 0 | } |
| 398 | 0 | return result; |
| 399 | |
} |
| 400 | |
|
| 401 | |
|
| 402 | |
|
| 403 | |
|
| 404 | |
|
| 405 | |
|
| 406 | |
|
| 407 | |
|
| 408 | |
|
| 409 | |
|
| 410 | |
|
| 411 | |
|
| 412 | |
|
| 413 | |
|
| 414 | |
|
| 415 | |
|
| 416 | |
public int doDelete( |
| 417 | |
Collection<JobEntryTorque> objects, |
| 418 | |
Connection con) |
| 419 | |
throws TorqueException |
| 420 | |
{ |
| 421 | 0 | int result = doDelete(buildPkCriteria(objects), con); |
| 422 | 0 | for (JobEntryTorque object : objects) |
| 423 | |
{ |
| 424 | 0 | object.setDeleted(true); |
| 425 | 0 | } |
| 426 | 0 | return result; |
| 427 | |
} |
| 428 | |
|
| 429 | |
|
| 430 | |
|
| 431 | |
|
| 432 | |
|
| 433 | |
|
| 434 | |
|
| 435 | |
|
| 436 | |
|
| 437 | |
|
| 438 | |
|
| 439 | |
public int doDelete(ObjectKey pk) throws TorqueException |
| 440 | |
{ |
| 441 | 0 | Connection connection = null; |
| 442 | |
try |
| 443 | |
{ |
| 444 | 0 | connection = Transaction.begin( |
| 445 | |
JobEntryTorquePeer.DATABASE_NAME); |
| 446 | 0 | int deletedRows = doDelete(pk, connection); |
| 447 | 0 | Transaction.commit(connection); |
| 448 | 0 | connection = null; |
| 449 | 0 | return deletedRows; |
| 450 | |
} |
| 451 | |
finally |
| 452 | |
{ |
| 453 | 0 | if (connection != null) |
| 454 | |
{ |
| 455 | 0 | Transaction.safeRollback(connection); |
| 456 | |
} |
| 457 | |
} |
| 458 | |
} |
| 459 | |
|
| 460 | |
|
| 461 | |
|
| 462 | |
|
| 463 | |
|
| 464 | |
|
| 465 | |
|
| 466 | |
|
| 467 | |
|
| 468 | |
|
| 469 | |
|
| 470 | |
|
| 471 | |
|
| 472 | |
|
| 473 | |
public int doDelete(ObjectKey pk, Connection con) |
| 474 | |
throws TorqueException |
| 475 | |
{ |
| 476 | 0 | return doDelete(buildCriteria(pk), con); |
| 477 | |
} |
| 478 | |
|
| 479 | |
|
| 480 | |
|
| 481 | |
|
| 482 | |
|
| 483 | |
|
| 484 | |
|
| 485 | |
public Criteria buildCriteria(ObjectKey pk) |
| 486 | |
{ |
| 487 | 0 | Criteria criteria = new Criteria(); |
| 488 | 0 | criteria.and(JobEntryTorquePeer.JOB_ID, pk); |
| 489 | 0 | return criteria; |
| 490 | |
} |
| 491 | |
|
| 492 | |
|
| 493 | |
|
| 494 | |
|
| 495 | |
|
| 496 | |
|
| 497 | |
|
| 498 | |
|
| 499 | |
public Criteria buildCriteria(Collection<ObjectKey> pks) |
| 500 | |
{ |
| 501 | 0 | Criteria criteria = new Criteria(); |
| 502 | 0 | criteria.andIn(JobEntryTorquePeer.JOB_ID, pks); |
| 503 | 0 | return criteria; |
| 504 | |
} |
| 505 | |
|
| 506 | |
|
| 507 | |
|
| 508 | |
|
| 509 | |
|
| 510 | |
|
| 511 | |
|
| 512 | |
|
| 513 | |
|
| 514 | |
public Criteria buildPkCriteria( |
| 515 | |
Collection<JobEntryTorque> objects) |
| 516 | |
{ |
| 517 | 0 | List<ObjectKey> pks = new ArrayList<ObjectKey>(objects.size()); |
| 518 | 0 | for (JobEntryTorque object : objects) |
| 519 | |
{ |
| 520 | 0 | ObjectKey pk = object.getPrimaryKey(); |
| 521 | 0 | if (pk != null) |
| 522 | |
{ |
| 523 | 0 | pks.add(pk); |
| 524 | |
} |
| 525 | 0 | } |
| 526 | 0 | return buildCriteria(pks); |
| 527 | |
} |
| 528 | |
|
| 529 | |
|
| 530 | |
|
| 531 | |
|
| 532 | |
|
| 533 | |
|
| 534 | |
|
| 535 | |
public Criteria buildCriteria(JobEntryTorque obj) |
| 536 | |
{ |
| 537 | 0 | Criteria criteria = new Criteria(JobEntryTorquePeer.DATABASE_NAME); |
| 538 | 0 | if (!obj.isNew()) |
| 539 | |
{ |
| 540 | 0 | criteria.and(JobEntryTorquePeer.JOB_ID, obj.getJobId()); |
| 541 | |
} |
| 542 | 0 | criteria.and(JobEntryTorquePeer.SECOND, obj.getSecond()); |
| 543 | 0 | criteria.and(JobEntryTorquePeer.MINUTE, obj.getMinute()); |
| 544 | 0 | criteria.and(JobEntryTorquePeer.HOUR, obj.getHour()); |
| 545 | 0 | criteria.and(JobEntryTorquePeer.WEEK_DAY, obj.getWeekDay()); |
| 546 | 0 | criteria.and(JobEntryTorquePeer.DAY_OF_MONTH, obj.getDayOfMonth()); |
| 547 | 0 | criteria.and(JobEntryTorquePeer.TASK, obj.getTask()); |
| 548 | 0 | criteria.and(JobEntryTorquePeer.EMAIL, obj.getEmail()); |
| 549 | 0 | criteria.and(JobEntryTorquePeer.PROPERTY, obj.getProperty()); |
| 550 | 0 | return criteria; |
| 551 | |
} |
| 552 | |
|
| 553 | |
|
| 554 | |
|
| 555 | |
|
| 556 | |
|
| 557 | |
|
| 558 | |
|
| 559 | |
public Criteria buildSelectCriteria(JobEntryTorque obj) |
| 560 | |
{ |
| 561 | 0 | Criteria criteria = new Criteria(JobEntryTorquePeer.DATABASE_NAME); |
| 562 | 0 | if (!obj.isNew()) |
| 563 | |
{ |
| 564 | 0 | criteria.and(JobEntryTorquePeer.JOB_ID, obj.getJobId()); |
| 565 | |
} |
| 566 | 0 | criteria.and(JobEntryTorquePeer.SECOND, obj.getSecond()); |
| 567 | 0 | criteria.and(JobEntryTorquePeer.MINUTE, obj.getMinute()); |
| 568 | 0 | criteria.and(JobEntryTorquePeer.HOUR, obj.getHour()); |
| 569 | 0 | criteria.and(JobEntryTorquePeer.WEEK_DAY, obj.getWeekDay()); |
| 570 | 0 | criteria.and(JobEntryTorquePeer.DAY_OF_MONTH, obj.getDayOfMonth()); |
| 571 | 0 | criteria.and(JobEntryTorquePeer.TASK, obj.getTask()); |
| 572 | 0 | criteria.and(JobEntryTorquePeer.EMAIL, obj.getEmail()); |
| 573 | 0 | return criteria; |
| 574 | |
} |
| 575 | |
|
| 576 | |
|
| 577 | |
|
| 578 | |
|
| 579 | |
|
| 580 | |
|
| 581 | |
|
| 582 | |
|
| 583 | |
|
| 584 | |
|
| 585 | |
|
| 586 | |
|
| 587 | |
public ColumnValues buildColumnValues(JobEntryTorque jobEntryTorque) |
| 588 | |
throws TorqueException |
| 589 | |
{ |
| 590 | 0 | ColumnValues columnValues = new ColumnValues(); |
| 591 | 0 | if (!jobEntryTorque.isNew() |
| 592 | |
|| jobEntryTorque.getJobId() != 0) |
| 593 | |
{ |
| 594 | 0 | columnValues.put( |
| 595 | |
JobEntryTorquePeer.JOB_ID, |
| 596 | |
new JdbcTypedValue( |
| 597 | |
jobEntryTorque.getJobId(), |
| 598 | |
4)); |
| 599 | |
} |
| 600 | 0 | columnValues.put( |
| 601 | |
JobEntryTorquePeer.SECOND, |
| 602 | |
new JdbcTypedValue( |
| 603 | |
jobEntryTorque.getSecond(), |
| 604 | |
4)); |
| 605 | 0 | columnValues.put( |
| 606 | |
JobEntryTorquePeer.MINUTE, |
| 607 | |
new JdbcTypedValue( |
| 608 | |
jobEntryTorque.getMinute(), |
| 609 | |
4)); |
| 610 | 0 | columnValues.put( |
| 611 | |
JobEntryTorquePeer.HOUR, |
| 612 | |
new JdbcTypedValue( |
| 613 | |
jobEntryTorque.getHour(), |
| 614 | |
4)); |
| 615 | 0 | columnValues.put( |
| 616 | |
JobEntryTorquePeer.WEEK_DAY, |
| 617 | |
new JdbcTypedValue( |
| 618 | |
jobEntryTorque.getWeekDay(), |
| 619 | |
4)); |
| 620 | 0 | columnValues.put( |
| 621 | |
JobEntryTorquePeer.DAY_OF_MONTH, |
| 622 | |
new JdbcTypedValue( |
| 623 | |
jobEntryTorque.getDayOfMonth(), |
| 624 | |
4)); |
| 625 | 0 | columnValues.put( |
| 626 | |
JobEntryTorquePeer.TASK, |
| 627 | |
new JdbcTypedValue( |
| 628 | |
jobEntryTorque.getTask(), |
| 629 | |
12)); |
| 630 | 0 | columnValues.put( |
| 631 | |
JobEntryTorquePeer.EMAIL, |
| 632 | |
new JdbcTypedValue( |
| 633 | |
jobEntryTorque.getEmail(), |
| 634 | |
12)); |
| 635 | 0 | columnValues.put( |
| 636 | |
JobEntryTorquePeer.PROPERTY, |
| 637 | |
new JdbcTypedValue( |
| 638 | |
jobEntryTorque.getProperty(), |
| 639 | |
-3)); |
| 640 | 0 | return columnValues; |
| 641 | |
} |
| 642 | |
|
| 643 | |
|
| 644 | |
|
| 645 | |
|
| 646 | |
|
| 647 | |
|
| 648 | |
|
| 649 | |
|
| 650 | |
|
| 651 | |
|
| 652 | |
public JobEntryTorque retrieveByPK(int pk) |
| 653 | |
throws TorqueException, NoRowsException, TooManyRowsException |
| 654 | |
{ |
| 655 | 0 | return retrieveByPK(SimpleKey.keyFor(pk)); |
| 656 | |
} |
| 657 | |
|
| 658 | |
|
| 659 | |
|
| 660 | |
|
| 661 | |
|
| 662 | |
|
| 663 | |
|
| 664 | |
|
| 665 | |
|
| 666 | |
|
| 667 | |
|
| 668 | |
public JobEntryTorque retrieveByPK(int pk, Connection con) |
| 669 | |
throws TorqueException, NoRowsException, TooManyRowsException |
| 670 | |
{ |
| 671 | 0 | return retrieveByPK(SimpleKey.keyFor(pk), con); |
| 672 | |
} |
| 673 | |
|
| 674 | |
|
| 675 | |
|
| 676 | |
|
| 677 | |
|
| 678 | |
|
| 679 | |
|
| 680 | |
|
| 681 | |
|
| 682 | |
|
| 683 | |
|
| 684 | |
|
| 685 | |
|
| 686 | |
public JobEntryTorque retrieveByPK(ObjectKey pk) |
| 687 | |
throws TorqueException, NoRowsException, TooManyRowsException |
| 688 | |
{ |
| 689 | 0 | Connection connection = null; |
| 690 | |
try |
| 691 | |
{ |
| 692 | 0 | connection = Transaction.begin(JobEntryTorquePeer.DATABASE_NAME); |
| 693 | 0 | JobEntryTorque result = retrieveByPK(pk, connection); |
| 694 | 0 | Transaction.commit(connection); |
| 695 | 0 | connection = null; |
| 696 | 0 | return result; |
| 697 | |
} |
| 698 | |
finally |
| 699 | |
{ |
| 700 | 0 | if (connection != null) |
| 701 | |
{ |
| 702 | 0 | Transaction.safeRollback(connection); |
| 703 | |
} |
| 704 | |
} |
| 705 | |
} |
| 706 | |
|
| 707 | |
|
| 708 | |
|
| 709 | |
|
| 710 | |
|
| 711 | |
|
| 712 | |
|
| 713 | |
|
| 714 | |
|
| 715 | |
|
| 716 | |
|
| 717 | |
public JobEntryTorque retrieveByPK(ObjectKey pk, Connection con) |
| 718 | |
throws TorqueException, NoRowsException, TooManyRowsException |
| 719 | |
{ |
| 720 | 0 | Criteria criteria = buildCriteria(pk); |
| 721 | 0 | List<JobEntryTorque> v = doSelect(criteria, con); |
| 722 | 0 | if (v.size() == 0) |
| 723 | |
{ |
| 724 | 0 | throw new NoRowsException("Failed to select a row."); |
| 725 | |
} |
| 726 | 0 | else if (v.size() > 1) |
| 727 | |
{ |
| 728 | 0 | throw new TooManyRowsException("Failed to select only one row."); |
| 729 | |
} |
| 730 | |
else |
| 731 | |
{ |
| 732 | 0 | return (JobEntryTorque)v.get(0); |
| 733 | |
} |
| 734 | |
} |
| 735 | |
|
| 736 | |
|
| 737 | |
|
| 738 | |
|
| 739 | |
|
| 740 | |
|
| 741 | |
|
| 742 | |
|
| 743 | |
|
| 744 | |
public List<JobEntryTorque> retrieveByPKs(Collection<ObjectKey> pks) |
| 745 | |
throws TorqueException |
| 746 | |
{ |
| 747 | 0 | Connection connection = null; |
| 748 | |
try |
| 749 | |
{ |
| 750 | 0 | connection = Transaction.begin(JobEntryTorquePeer.DATABASE_NAME); |
| 751 | 0 | List<JobEntryTorque> result = retrieveByPKs(pks, connection); |
| 752 | 0 | Transaction.commit(connection); |
| 753 | 0 | connection = null; |
| 754 | 0 | return result; |
| 755 | |
} |
| 756 | |
finally |
| 757 | |
{ |
| 758 | 0 | if (connection != null) |
| 759 | |
{ |
| 760 | 0 | Transaction.safeRollback(connection); |
| 761 | |
} |
| 762 | |
} |
| 763 | |
} |
| 764 | |
|
| 765 | |
|
| 766 | |
|
| 767 | |
|
| 768 | |
|
| 769 | |
|
| 770 | |
|
| 771 | |
|
| 772 | |
|
| 773 | |
public List<JobEntryTorque> retrieveByPKs( |
| 774 | |
Collection<ObjectKey> pks, |
| 775 | |
Connection dbcon) |
| 776 | |
throws TorqueException |
| 777 | |
{ |
| 778 | 0 | if (pks == null || pks.size() == 0) |
| 779 | |
{ |
| 780 | 0 | return new ArrayList<JobEntryTorque>(); |
| 781 | |
} |
| 782 | 0 | Criteria criteria = buildCriteria(pks); |
| 783 | 0 | List<JobEntryTorque> result = doSelect(criteria, dbcon); |
| 784 | 0 | return result; |
| 785 | |
} |
| 786 | |
|
| 787 | |
|
| 788 | |
|
| 789 | |
|
| 790 | |
|
| 791 | |
|
| 792 | |
} |