be.SIRAPRISE.client.jsba
Class AbstractUpdatableDBObject
java.lang.Object
be.SIRAPRISE.client.jsba.AbstractDBObject
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
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 |
AbstractUpdatableDBObject
public AbstractUpdatableDBObject()
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 name of the method is the word "get" (all lowercase), followed by the capitalized relvar name (i.e. first character of the relvar name uppercase, all remaining characters of the relvar name lowercase), followed by a capitalized attribute name (i.e. the first character of the remaining part of the method name must be uppercase and all the other remaining characters must be lowercase)
- The method is a public method that takes no arguments
- The return type of the method is java.lang.String
- The method is unique in the object's class for any given attribute name.
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 objecto
- 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 name of the method is the word "get" (all lowercase), followed by the capitalized relvar name (i.e. first character of the relvar name uppercase, all remaining characters of the relvar name lowercase), followed by a capitalized attribute name (i.e. the first character of the remaining part of the method name must be uppercase and all the other remaining characters must be lowercase)
- The method is a public method that takes no arguments
- The return type of the method is java.lang.String
- The method is unique in the object's class for any given attribute name.
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