be.SIRAPRISE.client.jsba
Class AbstractUpdatableDBObject

java.lang.Object
  extended by be.SIRAPRISE.client.jsba.AbstractDBObject
      extended by be.SIRAPRISE.client.jsba.AbstractUpdatableDBObject
All Implemented Interfaces:
DBObject, UpdatableDBObject
Direct Known Subclasses:
AssignmentConstraint, AssignmentConstraintCheck, Attribute, AttributeValueDistribution, Client, ConstrainedType, DatabaseConstraint, DataSpace, DbmsFile, HashingIndexSpace, Index, IndexComponent, JavaBackedType, Key, KeyAttribute, MultiHashingIndexSpace, NewAttributeDefaultValue, RecordAttribute, RecordType, Relvar, RelvarAttribute, StorageSpace, TransactionConstraint, TreeIndexSpace, TriggeredDataAction, TupleConstraint, TupleIndex, User, VirtualRelvar

public abstract class AbstractUpdatableDBObject
extends AbstractDBObject
implements UpdatableDBObject

An abstract class that can be inherited from by classes that need to implement UpdatableDBObject, providing default implementations for the Java/SIRA_PRISE bridge methods

Author:
Erwin Smout

Constructor Summary
AbstractUpdatableDBObject()
           
 
Method Summary
 DmlUpdateCommand dbUpdateCommand(java.lang.String relvarName)
          Gets the command for Updating an entry in the named relvar (in the database the transaction is connected to), for this DBObject.
static DmlUpdateCommand dbUpdateCommand(java.lang.String relvarName, UpdatableDBObject o)
          Gets the command for Updating an entry in the named relvar (in the database the transaction is connected to), for the given object.
 
Methods inherited from class be.SIRAPRISE.client.jsba.AbstractDBObject
dbAddCommand, dbAddCommand, dbAddCommand, dbAddCommandAll, dbAssertCommand, dbAssertCommand, dbAssertCommand, dbAssertCommandAll, dbDeleteCommand, dbDeleteCommand, dbDeleteCommand, dbDeleteCommandAll, dbUnAssertCommand, dbUnAssertCommand, dbUnAssertCommand, dbUnAssertCommandAll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface be.SIRAPRISE.client.jsba.UpdatableDBObject
getPreUpdateState, setPreUpdateState
 

Constructor Detail

AbstractUpdatableDBObject

public AbstractUpdatableDBObject()
Method Detail

dbUpdateCommand

public static DmlUpdateCommand dbUpdateCommand(java.lang.String relvarName,
                                               UpdatableDBObject o)
                                        throws NoUpdatesException
Gets the command for Updating an entry in the named relvar (in the database the transaction is connected to), for the given object. The tuple that is updated in the database is constructed by invoking all the object's methods that satisfy the following properties : The updates carried out are determined as follows : For each attribute in the tuple, the value for that attribute (obtained through invoking its getter method on the object) is compared to the pre-update value of that attribute (this value is obtained by invoking the same getter method on the result of the getPreUpdateState() method invocation on the object). If those are equal, nothing is done. If those values are unequal, then an entry is inserted in the update command to make sure the update for that attribute value will happen.

Parameters:
relvarName - The name of the relvar into which a tuple is to be added for the given object
o - The object from which the tuple to be registered in the named relvar is to be drawn.
Returns:
the command for Updating an entry in the named relvar (in the database the transaction is connected to), for the given object.
Throws:
NoUpdatesException - if no attribute value changes at all are detected

dbUpdateCommand

public final DmlUpdateCommand dbUpdateCommand(java.lang.String relvarName)
                                       throws NoUpdatesException
Gets the command for Updating an entry in the named relvar (in the database the transaction is connected to), for this DBObject. The tuple that is updated in the database is constructed by invoking all the object's methods that satisfy the following properties : The updates carried out are determined as follows : For each attribute in the tuple, the value for that attribute (obtained through invoking its getter method on the object) is compared to the pre-update value of that attribute (this value is obtained by invoking the same getter method on the result of the getPreUpdateState() method invocation on the object). If those are equal, nothing is done. If those values are unequal, then an entry is inserted in the update command to make sure the update for that attribute value will happen.

Parameters:
relvarName - The name of the relvar into which a tuple is to be added for the given object
Returns:
the command for Updating an entry in the named relvar (in the database the transaction is connected to), for this DBObject.
Throws:
NoUpdatesException - if no attribute value changes at all are detected