org.opensubsystems.core.persist.db.postgresql
Class PostgreSQLDataUtils

java.lang.Object
  extended by org.opensubsystems.core.persist.db.postgresql.PostgreSQLDataUtils

public final class PostgreSQLDataUtils
extends java.lang.Object

This class collects code fragments which are reusable for managing data objects in Postgre SQL.

Version:
$Id: PostgreSQLDataUtils.java,v 1.3 2007/01/07 06:14:43 bastafidli Exp $
Author:
Julo Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.1 2005/08/20 21:17:01 bastafidli

Method Summary
static void insertAndFetchGeneratedValues(java.sql.PreparedStatement insertStatement, BasicDataObject data)
          Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object.
static void updateAndFetchGeneratedValues(java.sql.PreparedStatement updateStatement, ModifiableDataObject data)
          Update the data, fetch from the database id and generated modification timestamps for the newly created data object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

insertAndFetchGeneratedValues

public static void insertAndFetchGeneratedValues(java.sql.PreparedStatement insertStatement,
                                                 BasicDataObject data)
                                          throws java.sql.SQLException,
                                                 OSSException
Insert the data, fetch from the database id and generated creation and modification timestamps for the newly created data object. Note: Since the caller created the prepared statement, the caller is responsible for its closing.

Parameters:
insertStatement - - statement used to insert the data
data - - data object to insert
Throws:
java.sql.SQLException - - an error has occured
OSSException - - an error has occured

updateAndFetchGeneratedValues

public static void updateAndFetchGeneratedValues(java.sql.PreparedStatement updateStatement,
                                                 ModifiableDataObject data)
                                          throws java.sql.SQLException,
                                                 OSSException
Update the data, fetch from the database id and generated modification timestamps for the newly created data object. Note: Since the caller created the prepared statement, the caller is responsible for its closing.

Parameters:
updateStatement - - statement used to update the data
data - - data object to update
Throws:
java.sql.SQLException - - an error has occured
OSSException - - an error has occured


Copyright © 2003 - 2006 OpenSubsystems s.r.o.