net.sf.persism
Class Command

java.lang.Object
  extended by net.sf.persism.Command

public class Command
extends java.lang.Object

The Command object is used to perform updates in the databases with data objects.

Since:
4/4/12 6:42 PM
Author:
Dan Howard

Constructor Summary
Command(java.sql.Connection connection)
           
 
Method Summary
 int delete(java.lang.Object object)
          Deletes the data object object from the database.
protected  java.sql.ResultSet executeQuery(java.lang.String sql, java.lang.Object... parameters)
           
 void executeSQL(java.lang.String sql, java.lang.Object... parameters)
          Execute an arbitrary SQL statement.
 int insert(java.lang.Object object)
          Inserts the data object in the database.
 int update(java.lang.Object object)
          Updates the data object in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Command

public Command(java.sql.Connection connection)
Method Detail

update

public int update(java.lang.Object object)
           throws PersismException
Updates the data object in the database.

Parameters:
object - data object to update.
Returns:
usually 1 to indicate rows changed via JDBC.
Throws:
PersismException - Indicating the upcoming robot uprising.

insert

public int insert(java.lang.Object object)
           throws PersismException
Inserts the data object in the database.

Parameters:
object - the data object to insert.
Returns:
usually 1 to indicate rows changed via JDBC.
Throws:
PersismException - When planet of the apes starts happening.

delete

public int delete(java.lang.Object object)
           throws PersismException
Deletes the data object object from the database.

Parameters:
object - data object to delete
Returns:
usually 1 to indicate rows changed via JDBC.
Throws:
PersismException - Perhaps when asteroid 1999 RQ36 hits us?

executeSQL

public void executeSQL(java.lang.String sql,
                       java.lang.Object... parameters)
Execute an arbitrary SQL statement.

Parameters:
sql -
parameters -

executeQuery

protected final java.sql.ResultSet executeQuery(java.lang.String sql,
                                                java.lang.Object... parameters)