be.SIRAPRISE.client.jsba
Class UpdatableDBObjectTemplate

java.lang.Object
  extended by be.SIRAPRISE.client.jsba.UpdatableDBObjectTemplate
All Implemented Interfaces:
DBObject, UpdatableDBObject

public class UpdatableDBObjectTemplate
extends java.lang.Object
implements UpdatableDBObject

Class provided for purposes of documenting the methods involved in the SIRA_PRISE/Java bridge.

Author:
Erwin Smout

Constructor Summary
UpdatableDBObjectTemplate()
          The public no-arg constructor is required in any (class that implements) DBObject.
UpdatableDBObjectTemplate(int attribute1, java.lang.String attribute2)
          Other constructors may exist to serve the application programs
 
Method Summary
 int getAttribute1()
          Gets some attribute of this class
 java.lang.String getAttribute2()
          Gets some other attribute of this class
 UpdatableDBObject getPreUpdateState()
          Gets The state of the object as it was built by the J/R bridging engine immediately after the object was created from a database tuple (and which should have been set by/using the setPreUpdateState() method.
 java.lang.String getRelvar1Attribute1()
          Gets the value of some attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge.
 java.lang.String getRelvar1Attribute2()
          Gets the value of some other attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge.
 java.lang.String getRelvar2Attribute1()
          Gets the value of some attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge.
 void setAttribute1(int attribute1)
          Sets some attribute of this class
 void setAttribute1FromDB(java.lang.String attribute1)
          Sets some attribute of this class, given a SIRA_PRISE string representation of the value to set.
 void setAttribute2(java.lang.String attribute2)
          Sets some other attribute of this class
 void setAttribute2FromDB(java.lang.String attribute2)
          Sets some other attribute of this class, given a SIRA_PRISE string representation of the value to set.
 void setPreUpdateState()
          This method is called by the J/R bridging engine after an object has been setup from some tuple retrieved from the database.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdatableDBObjectTemplate

public UpdatableDBObjectTemplate()
The public no-arg constructor is required in any (class that implements) DBObject.


UpdatableDBObjectTemplate

public UpdatableDBObjectTemplate(int attribute1,
                                 java.lang.String attribute2)
Other constructors may exist to serve the application programs

Parameters:
attribute1 - some attribute of this class
attribute2 - some other attribute of this class
Method Detail

getAttribute1

public final int getAttribute1()
Gets some attribute of this class

Returns:
some attribute of this class

getAttribute2

public final java.lang.String getAttribute2()
Gets some other attribute of this class

Returns:
some other attribute of this class

getRelvar1Attribute1

public final java.lang.String getRelvar1Attribute1()
Gets the value of some attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge.

Returns:
some attribute of this class. The return type of the getter methods that form the java-to-SIRA_PRISE part of the bridge must always be java.lang.String.

getRelvar1Attribute2

public final java.lang.String getRelvar1Attribute2()
Gets the value of some other attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge. Note the call to BracketParser.meta(). This call is needed in the case that the value of the attribute can itself contain characters that are part of the SIRA_PRISE language, notably '(', ')' and '\' characters.

Returns:
some other attribute of this class

getRelvar2Attribute1

public final java.lang.String getRelvar2Attribute1()
Gets the value of some attribute of this class for use in the Java-to-SIRA_PRISE part of the bridge.

Returns:
some attribute of this class.

setAttribute1

public final void setAttribute1(int attribute1)
Sets some attribute of this class

Parameters:
attribute1 - some attribute of this class

setAttribute1FromDB

public final void setAttribute1FromDB(java.lang.String attribute1)
Sets some attribute of this class, given a SIRA_PRISE string representation of the value to set.

Parameters:
attribute1 - The SIRA_PRISE string representation of a value for some attribute of this class

setAttribute2

public final void setAttribute2(java.lang.String attribute2)
Sets some other attribute of this class

Parameters:
attribute2 - some other attribute of this class

setAttribute2FromDB

public final void setAttribute2FromDB(java.lang.String attribute2)
Sets some other attribute of this class, given a SIRA_PRISE string representation of the value to set.

Parameters:
attribute2 - The SIRA_PRISE string representation of a value for some other attribute of this class. Note in particular the call to BracketParser.unMeta(). This is because the String values that are passed to these setter methods are always in 'escaped' format, i.e. if one of the characters '(', ')' or '\' is part of the actual value of the attribute, then any appearance of these characters is represented by the character sequences '\(', '\)' or '\\' respectively (note that in a java source, the latter is actually written as four consecutive backslashes, because java itself also 'escapes' backslash characters). This allows in particular to correctly treat values that contain opening and closing parentheses to denote component values of the value. E.g. a date value could be passed to this setter method as the String "D(31)M(12)Y(1999)". Thus, string values that represent filenames or directory names can also be dealt with appropriately : the set...FromDB() method will be invoked with a String value of, e.g. "directory\\filename", and the "regular" setter method available to the application could be invoked with a string value of "directory\filename", as the application is likely to want to have it.

setPreUpdateState

public final void setPreUpdateState()
Description copied from interface: UpdatableDBObject
This method is called by the J/R bridging engine after an object has been setup from some tuple retrieved from the database. The method must cause the object to save a copy (/clone) of all the fields that are pertinent to the database. This copy will be retrieved by the J/R bridging engine using the getPreUpdateState() method call, and will subsequently be used by the J/R bridging engine to determine which fields have changed value, and thus to determine which attributes need to be updated in the database.

Specified by:
setPreUpdateState in interface UpdatableDBObject

getPreUpdateState

public final UpdatableDBObject getPreUpdateState()
Description copied from interface: UpdatableDBObject
Gets The state of the object as it was built by the J/R bridging engine immediately after the object was created from a database tuple (and which should have been set by/using the setPreUpdateState() method.

Specified by:
getPreUpdateState in interface UpdatableDBObject
Returns:
The state of the object as it was built by the J/R bridging engine immediately after the object was created from a database tuple (and which should have been set by/using the setPreUpdateState() method.