agonism.dovetail.site
Class UpdateRecord

java.lang.Object
  |
  +--agonism.dovetail.site.UpdateRecord

public class UpdateRecord
extends java.lang.Object


Field Summary
static org.log4j.Category C
           
 
Constructor Summary
UpdateRecord(java.lang.String tableName)
          Updated a record in a table.
UpdateRecord(Table table)
          Update a record in table.
 
Method Summary
 boolean execute(java.sql.Connection c, Form form, agonism.dovetail.db.IParameterSource source, int id)
          Update the record.
 boolean execute(java.sql.Connection c, Form form, agonism.dovetail.db.IParameterSource source, int id, Column[] columns)
          Update the record.
 boolean execute(Form form, int id)
          Update the record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

C

public static final org.log4j.Category C
Constructor Detail

UpdateRecord

public UpdateRecord(java.lang.String tableName)
Updated a record in a table.
Parameters:
tableName - must be the name of a table in the current schema
See Also:
Schema.getSchema(), Schema.getTable(java.lang.String)

UpdateRecord

public UpdateRecord(Table table)
Update a record in table.
Method Detail

execute

public boolean execute(Form form,
                       int id)
Update the record. The form's IRequestContext will be used to report any exceptions which occur while inserting the record. This method uses the Connection and IParameterSource provided by the Form. All columns for which a value is present in source will be updated.
Parameters:
id - should be the primary key of the record to be updated
Returns:
whether the creation of the new record was successful

execute

public boolean execute(java.sql.Connection c,
                       Form form,
                       agonism.dovetail.db.IParameterSource source,
                       int id)
Update the record. The form's IRequestContext will be used to report any exceptions which occur while inserting the record. All columns for which a value is present in source will be updated.
Parameters:
source - should contain a value for all columns which are required by the table specified in the constructor.
id - should be the primary key of the record to be updated
Returns:
whether the creation of the new record was successful

execute

public boolean execute(java.sql.Connection c,
                       Form form,
                       agonism.dovetail.db.IParameterSource source,
                       int id,
                       Column[] columns)
Update the record. The form's IRequestContext will be used to report any exceptions which occur while inserting the record.
Parameters:
source - should contain a value for all columns which are required by the table specified in the constructor.
id - should be the primary key of the record to be updated
columns - an array of columns whose values should be update from source. If this parameter is null, then all columns for which a value is present in the source will be updated.
Returns:
whether the creation of the new record was successful