DODS 5.1 API

com.lutris.dods.builder.generator.dataobject
Class GenericDO

java.lang.Object
  |
  +--com.lutris.appserver.server.sql.CoreDO
        |
        +--com.lutris.appserver.server.sql.CloneableDO
              |
              +--com.lutris.dods.builder.generator.dataobject.GenericDO
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable, Transaction
Direct Known Subclasses:
SecureDO

public abstract class GenericDO
extends CloneableDO

See Also:
Serialized Form

Field Summary
protected  boolean dirty
           
 
Fields inherited from class com.lutris.appserver.server.sql.CoreDO
persistent, versioning
 
Constructor Summary
GenericDO()
          Public constructor.
GenericDO(boolean notUsingOId)
          Public constructor.
GenericDO(ObjectId id)
          Public constructor.
GenericDO(java.sql.ResultSet rs)
          Public constructor.
GenericDO(java.lang.String dbName)
          Public constructor.
GenericDO(java.lang.String dbName, boolean notUsingOId)
          Public constructor.
GenericDO(java.lang.String dbName, ObjectId id)
          Public constructor.
GenericDO(java.lang.String dbName, java.sql.ResultSet rs)
          Public constructor.
 
Method Summary
 java.lang.Object cloneUnique()
          Creates a clone of the object, but ensures that a new and unique object id is created for the object and that the version number is set to zero.
 boolean compareCond(Condition cond)
          Subclass should override this method if wants to use it.
static java.math.BigDecimal copyBigDecimal(java.math.BigDecimal source)
           
static byte[] copyByteArray(byte[] source)
           
static java.sql.Date copyDate(java.sql.Date source)
           
static java.lang.String copyString(java.lang.String source)
           
static java.sql.Time copyTime(java.sql.Time source)
           
static java.sql.Timestamp copyTimestamp(java.sql.Timestamp source)
           
 GenericDO createDO(GenericDO obj)
          Subclass should override this method if wants to use it.
 void delete()
           
 void executeDelete(DBConnection conn)
          Deletes this object from the database.
 void executeInsert(DBConnection conn)
          Updates the contents of this object in the database but only if the datab object is dirty.
 void executeUpdate(DBConnection conn)
          Updates the contents of this object in the database but only if the datab object is dirty.
 void finalizeInsert(boolean success)
          If transaction succeeded marks this object as clean.
 void finalizeUpdate(boolean success)
          If transaction succeeded marks this object as clean.
 java.lang.String getCacheHandle()
          Subclass should override this method if wants to use it.
 java.lang.Object getData()
          Subclass should override this method if wants to use it.
 java.lang.String getHandle()
          Subclass should override this method if wants to use it.
 java.lang.String getOriginDatabase()
          Subclass should override this method if wants to use it.
protected static java.lang.String getPrimaryKeyName()
          Return the name of the primary key column.
 boolean isDirty()
          isDirty() returns true if this object has been modified (needs to be updated to the database).
protected  void makeIdentical(GenericDO obj)
          makeIdentical() Used by subclasses to assign any data members to this data object.
protected  void markClean()
          markClean() with no arguments is used to indicate that this object is marked as "clean" (it does not need to be updated to the database).
protected  void markNewValue()
          markNewValue() with no arguments is used to indicate that this object is marked as "dirty" (in need of an update to the database).
protected  java.math.BigDecimal markNewValue(java.math.BigDecimal current_bd, java.math.BigDecimal new_bd)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  boolean markNewValue(boolean current_boolean, boolean new_boolean)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  byte[] markNewValue(byte[] current_val, byte[] new_val)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  byte markNewValue(byte current_byte, byte new_byte)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  char markNewValue(char current_char, char new_char)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.util.Date markNewValue(java.util.Date current_date, java.util.Date new_date)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.sql.Date markNewValue(java.sql.Date current_val, java.sql.Date new_val)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  double markNewValue(double current_double, double new_double)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  float markNewValue(float current_float, float new_float)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  GenericDO markNewValue(GenericDO current_DO, GenericDO new_DO)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  int markNewValue(int current_int, int new_int)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  long markNewValue(long current_long, long new_long)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  ObjectId markNewValue(ObjectId current_OId, ObjectId new_OId)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  short markNewValue(short current_short, short new_short)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.lang.String markNewValue(java.lang.String current_string, java.lang.String new_string, int max_length, boolean nullOK)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.lang.String markNewValue(java.lang.String current_string, java.lang.String new_string, int min_length, int max_length, boolean nullOK)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.sql.Timestamp markNewValue(java.sql.Timestamp current_val, java.sql.Timestamp new_val)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  java.sql.Time markNewValue(java.sql.Time current_val, java.sql.Time new_val)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
static void printMsg(org.apache.log4j.Level level, java.lang.String s)
           
 void setData(java.lang.Object data)
          Subclass should override this method if wants to use it.
protected  void setOId(ObjectId oId)
          Sets this object's identifier.
protected  void setPrepStmtParam_BigDecimal(java.sql.PreparedStatement stmt, int[] paramIndex, java.math.BigDecimal value)
           
protected  void setPrepStmtParam_boolean(java.sql.PreparedStatement stmt, int[] paramIndex, boolean value)
           
protected  void setPrepStmtParam_byte(java.sql.PreparedStatement stmt, int[] paramIndex, byte value)
           
protected  void setPrepStmtParam_bytes(java.sql.PreparedStatement stmt, int[] paramIndex, byte[] value)
           
protected  void setPrepStmtParam_DO(java.sql.PreparedStatement stmt, int[] paramIndex, GenericDO value)
          If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database).
protected  void setPrepStmtParam_double(java.sql.PreparedStatement stmt, int[] paramIndex, double value)
           
protected  void setPrepStmtParam_float(java.sql.PreparedStatement stmt, int[] paramIndex, float value)
           
protected  void setPrepStmtParam_int(java.sql.PreparedStatement stmt, int[] paramIndex, int value)
           
protected  void setPrepStmtParam_java_math_BigDecimal(java.sql.PreparedStatement stmt, int[] paramIndex, java.math.BigDecimal value)
           
protected  void setPrepStmtParam_java_sql_Date(java.sql.PreparedStatement stmt, int[] paramIndex, java.sql.Date value)
           
protected  void setPrepStmtParam_java_sql_Time(java.sql.PreparedStatement stmt, int[] paramIndex, java.sql.Time value)
           
protected  void setPrepStmtParam_java_sql_Timestamp(java.sql.PreparedStatement stmt, int[] paramIndex, java.sql.Timestamp value)
           
protected  void setPrepStmtParam_long(java.sql.PreparedStatement stmt, int[] paramIndex, long value)
           
protected  void setPrepStmtParam_short(java.sql.PreparedStatement stmt, int[] paramIndex, short value)
           
protected  void setPrepStmtParam_String(java.sql.PreparedStatement stmt, int[] paramIndex, java.lang.String value)
           
 java.lang.String toString(int x)
           
 
Methods inherited from class com.lutris.appserver.server.sql.CloneableDO
clone
 
Methods inherited from class com.lutris.appserver.server.sql.CoreDO
addToCache, deleteFromCache, disableVersioning, evict, finalizeDelete, getDeleteStatement, getInsertStatement, getNewVersion, getOId, getOIdColumnName, getTableName, getUpdateStatement, getVersion, getVersionColumnName, isPersistent, refresh, setNewVersion, setOIdColumnName, setPersistent, setVersion, setVersionColumnName, updateCache
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dirty

protected boolean dirty
Constructor Detail

GenericDO

public GenericDO()
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(java.lang.String dbName)
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(boolean notUsingOId)
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(java.lang.String dbName,
                 boolean notUsingOId)
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(ObjectId id)
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(java.lang.String dbName,
                 ObjectId id)
          throws ObjectIdException,
                 DatabaseManagerException
Public constructor.


GenericDO

public GenericDO(java.sql.ResultSet rs)
          throws java.sql.SQLException,
                 ObjectIdException,
                 DatabaseManagerException
Public constructor.

Parameters:
rs - a result set.
Throws:
java.sql.SQLException - if an error occurs while instantiating this object from the result set.
ObjectIdException - if the object id for this object is invalid.
DatabaseManagerException - If a nonexistent default logical database has been set.

GenericDO

public GenericDO(java.lang.String dbName,
                 java.sql.ResultSet rs)
          throws java.sql.SQLException,
                 ObjectIdException,
                 DatabaseManagerException
Public constructor.

Parameters:
rs - a result set.
Throws:
java.sql.SQLException - if an error occurs while instantiating this object from the result set.
ObjectIdException - if the object id for this object is invalid.
DatabaseManagerException - If a nonexistent logical database name is supplied.
Method Detail

printMsg

public static void printMsg(org.apache.log4j.Level level,
                            java.lang.String s)

cloneUnique

public java.lang.Object cloneUnique()
                             throws DatabaseManagerException,
                                    ObjectIdException
Creates a clone of the object, but ensures that a new and unique object id is created for the object and that the version number is set to zero.

Overrides:
cloneUnique in class CloneableDO
Throws:
DatabaseManagerException - if an error occurs while allocation a new object id from the default logical database.
ObjectIdException - if a new object id could not be allocated.

makeIdentical

protected void makeIdentical(GenericDO obj)
makeIdentical() Used by subclasses to assign any data members to this data object. Does not duplicate data. Just assigns references.


executeUpdate

public void executeUpdate(DBConnection conn)
                   throws java.sql.SQLException,
                          DBRowUpdateException
Updates the contents of this object in the database but only if the datab object is dirty. This requires that all set methods in the data objects keep track if a value has changed.

Specified by:
executeUpdate in interface Transaction
Overrides:
executeUpdate in class CoreDO
Parameters:
conn - the database connection.
Throws:
java.sql.SQLException - If a database access error occurs.
DBRowUpdateException - If a version error occurs.

executeInsert

public void executeInsert(DBConnection conn)
                   throws java.sql.SQLException,
                          DBRowUpdateException
Updates the contents of this object in the database but only if the datab object is dirty. This requires that all set methods in the data objects keep track if a value has changed.

Specified by:
executeInsert in interface Transaction
Overrides:
executeInsert in class CoreDO
Parameters:
conn - the database connection.
Throws:
java.sql.SQLException - If a database access error occurs.
DBRowUpdateException - If a version error occurs.

executeDelete

public void executeDelete(DBConnection conn)
                   throws java.sql.SQLException
Deletes this object from the database.

Specified by:
executeDelete in interface Transaction
Overrides:
executeDelete in class CoreDO
Parameters:
conn - Database connection.
Throws:
java.sql.SQLException - If a database access error occurs.

finalizeInsert

public void finalizeInsert(boolean success)
If transaction succeeded marks this object as clean.

Specified by:
finalizeInsert in interface Transaction
Overrides:
finalizeInsert in class CoreDO
Parameters:
success - true if the transaction succeeded and this object was successfully inserted into the database.

finalizeUpdate

public void finalizeUpdate(boolean success)
If transaction succeeded marks this object as clean.

Specified by:
finalizeUpdate in interface Transaction
Overrides:
finalizeUpdate in class CoreDO
Parameters:
success - true if the transaction succeeded and this object was successfully updated in the database.
See Also:
CoreDO.getNewVersion()

getPrimaryKeyName

protected static java.lang.String getPrimaryKeyName()
Return the name of the primary key column. FIX to get name from conf file (or via CoreDO?)

Returns:
the name of the primary key column.
See Also:
CoreDO

setOId

protected void setOId(ObjectId oId)
Sets this object's identifier.

Overrides:
setOId in class CoreDO
Parameters:
oId - this object's identifier.

isDirty

public boolean isDirty()
isDirty() returns true if this object has been modified (needs to be updated to the database).


markClean

protected void markClean()
markClean() with no arguments is used to indicate that this object is marked as "clean" (it does not need to be updated to the database).

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.


markNewValue

protected void markNewValue()
markNewValue() with no arguments is used to indicate that this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.


markNewValue

protected java.lang.String markNewValue(java.lang.String current_string,
                                        java.lang.String new_string,
                                        int max_length,
                                        boolean nullOK)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value, max_length, nullOK ) If nullOK is false and new_field_value is null, this.field is set to "".

Parameters:
current_string - The current value of the String data member.
new_string - The new value of the String data member.
max_length - The maximum allowed length of the String value. If the new_string is longer than max_length, new_string is truncated. If max_length is less than 1, no maximum is imposed.
Returns:
new_string if it is not null, otherwise "".

markNewValue

protected java.lang.String markNewValue(java.lang.String current_string,
                                        java.lang.String new_string,
                                        int min_length,
                                        int max_length,
                                        boolean nullOK)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value, min_length, max_length, nullOK ) If min_length > 0 and nullOK is false and new_field_value is null, this.field is returned (the new_field_value is ignored.)

Parameters:
current_string - The current value of the String data member.
new_string - The new value of the String data member.
min_length - The minimum allowed length of the String value. If the new_string is shorter than min_length, new_string is ignored. If min_length is less than 0, no minimum is imposed.
max_length - The maximum allowed length of the String value. If the new_string is longer than max_length, new_string is truncated. If max_length is less than 1, no maximum is imposed.
Returns:
new_string if it is not null, otherwise "".

markNewValue

protected ObjectId markNewValue(ObjectId current_OId,
                                ObjectId new_OId)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_OId - The current value of the ObjectId data member.
new_OId - The new value of the ObjectId data member.
Returns:
new_OId

markNewValue

protected java.util.Date markNewValue(java.util.Date current_date,
                                      java.util.Date new_date)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_date - The current value of the Date data member.
new_date - The new value of the Date data member.
Returns:
new_date

markNewValue

protected java.math.BigDecimal markNewValue(java.math.BigDecimal current_bd,
                                            java.math.BigDecimal new_bd)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_bd - The current value of the BigDecimal data member.
new_bd - The new value of the BigDecimal data member.
Returns:
new_bd

markNewValue

protected byte[] markNewValue(byte[] current_val,
                              byte[] new_val)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
new_val - The new value of the byte array data member.
Returns:
new_val

markNewValue

protected java.sql.Date markNewValue(java.sql.Date current_val,
                                     java.sql.Date new_val)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_val - The current value of the java.sql.Date data member.
new_val - The new value of the java.sql.Date data member.
Returns:
new_val

markNewValue

protected java.sql.Time markNewValue(java.sql.Time current_val,
                                     java.sql.Time new_val)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_val - The current value of the java.sql.Time data member.
new_val - The new value of the java.sql.Time data member.
Returns:
new_val

markNewValue

protected java.sql.Timestamp markNewValue(java.sql.Timestamp current_val,
                                          java.sql.Timestamp new_val)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_val - The current value of the java.sql.Timestamp data member.
new_val - The new value of the java.sql.Timestamp data member.
Returns:
new_val

markNewValue

protected int markNewValue(int current_int,
                           int new_int)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_int - The current value of the int data member.
new_int - The new value of the int data member.
Returns:
new_int

markNewValue

protected float markNewValue(float current_float,
                             float new_float)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_float - The current value of the float data member.
new_float - The new value of the float data member.
Returns:
new_float

markNewValue

protected double markNewValue(double current_double,
                              double new_double)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_double - The current value of the double data member.
new_double - The new value of the double data member.
Returns:
new_double

markNewValue

protected boolean markNewValue(boolean current_boolean,
                               boolean new_boolean)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_boolean - The current value of the boolean data member.
new_boolean - The new value of the boolean data member.
Returns:
new_boolean

markNewValue

protected char markNewValue(char current_char,
                            char new_char)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_char - The current value of the char data member.
new_char - The new value of the char data member.
Returns:
new_char

markNewValue

protected byte markNewValue(byte current_byte,
                            byte new_byte)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_byte - The current value of the byte data member.
new_byte - The new value of the byte data member.
Returns:
new_byte

markNewValue

protected short markNewValue(short current_short,
                             short new_short)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_short - The current value of the short data member.
new_short - The new value of the short data member.
Returns:
new_short

markNewValue

protected long markNewValue(long current_long,
                            long new_long)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Parameters:
current_long - The current value of the long data member.
new_long - The new value of the long data member.
Returns:
new_long

markNewValue

protected GenericDO markNewValue(GenericDO current_DO,
                                 GenericDO new_DO)
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Returns:
new_long

setPrepStmtParam_DO

protected void setPrepStmtParam_DO(java.sql.PreparedStatement stmt,
                                   int[] paramIndex,
                                   GenericDO value)
                            throws java.sql.SQLException
If the current data member value differs from the new value, this object is marked as "dirty" (in need of an update to the database). There is no way to mark this object as "clean";
only the executeInsert() and executeUpdate() methods can make that so.

This method is protected since only derived Data Objects (DO's) "set" methods will be calling it.

This method returns the new value as a convenience to the calling "set" method. The usage is: this.field = markNewValue( this.field, new_field_value )

Returns:
new_ts
java.sql.SQLException

setPrepStmtParam_String

protected void setPrepStmtParam_String(java.sql.PreparedStatement stmt,
                                       int[] paramIndex,
                                       java.lang.String value)
                                throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_float

protected void setPrepStmtParam_float(java.sql.PreparedStatement stmt,
                                      int[] paramIndex,
                                      float value)
                               throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_int

protected void setPrepStmtParam_int(java.sql.PreparedStatement stmt,
                                    int[] paramIndex,
                                    int value)
                             throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_java_math_BigDecimal

protected void setPrepStmtParam_java_math_BigDecimal(java.sql.PreparedStatement stmt,
                                                     int[] paramIndex,
                                                     java.math.BigDecimal value)
                                              throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_BigDecimal

protected void setPrepStmtParam_BigDecimal(java.sql.PreparedStatement stmt,
                                           int[] paramIndex,
                                           java.math.BigDecimal value)
                                    throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_java_sql_Date

protected void setPrepStmtParam_java_sql_Date(java.sql.PreparedStatement stmt,
                                              int[] paramIndex,
                                              java.sql.Date value)
                                       throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_java_sql_Time

protected void setPrepStmtParam_java_sql_Time(java.sql.PreparedStatement stmt,
                                              int[] paramIndex,
                                              java.sql.Time value)
                                       throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_java_sql_Timestamp

protected void setPrepStmtParam_java_sql_Timestamp(java.sql.PreparedStatement stmt,
                                                   int[] paramIndex,
                                                   java.sql.Timestamp value)
                                            throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_bytes

protected void setPrepStmtParam_bytes(java.sql.PreparedStatement stmt,
                                      int[] paramIndex,
                                      byte[] value)
                               throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_double

protected void setPrepStmtParam_double(java.sql.PreparedStatement stmt,
                                       int[] paramIndex,
                                       double value)
                                throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_long

protected void setPrepStmtParam_long(java.sql.PreparedStatement stmt,
                                     int[] paramIndex,
                                     long value)
                              throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_short

protected void setPrepStmtParam_short(java.sql.PreparedStatement stmt,
                                      int[] paramIndex,
                                      short value)
                               throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_byte

protected void setPrepStmtParam_byte(java.sql.PreparedStatement stmt,
                                     int[] paramIndex,
                                     byte value)
                              throws java.sql.SQLException
java.sql.SQLException

setPrepStmtParam_boolean

protected void setPrepStmtParam_boolean(java.sql.PreparedStatement stmt,
                                        int[] paramIndex,
                                        boolean value)
                                 throws java.sql.SQLException
java.sql.SQLException

toString

public java.lang.String toString(int x)

delete

public void delete()
            throws java.sql.SQLException,
                   DatabaseManagerException,
                   DataObjectException,
                   RefAssertionException,
                   DBRowUpdateException,
                   QueryException
java.sql.SQLException
DatabaseManagerException
DataObjectException
RefAssertionException
DBRowUpdateException
QueryException

copyByteArray

public static byte[] copyByteArray(byte[] source)

copyString

public static java.lang.String copyString(java.lang.String source)

copyBigDecimal

public static java.math.BigDecimal copyBigDecimal(java.math.BigDecimal source)

copyDate

public static java.sql.Date copyDate(java.sql.Date source)

copyTime

public static java.sql.Time copyTime(java.sql.Time source)

copyTimestamp

public static java.sql.Timestamp copyTimestamp(java.sql.Timestamp source)

compareCond

public boolean compareCond(Condition cond)
Subclass should override this method if wants to use it. This method checks if this data object satisfies query conditions cond.

Parameters:
cond - conditions of the query.
Returns:
true if this data object satisfies conditions of this query, otherwise false.

setData

public void setData(java.lang.Object data)
Subclass should override this method if wants to use it. Sets DO's data.

Parameters:
data - DO's data.

getData

public java.lang.Object getData()
Subclass should override this method if wants to use it. Returns DO's data.

Returns:
DO's data.

getHandle

public java.lang.String getHandle()
                           throws DatabaseManagerException
Subclass should override this method if wants to use it. Returns DO's handle.

Returns:
DO's handle.
DatabaseManagerException

getCacheHandle

public java.lang.String getCacheHandle()
                                throws DatabaseManagerException
Subclass should override this method if wants to use it. Returns DO's cache handle.

Returns:
DO's cache handle.
DatabaseManagerException

createDO

public GenericDO createDO(GenericDO obj)
Subclass should override this method if wants to use it. Returns copy of DO (with the same id).

Parameters:
obj - DO which will be copied.
Returns:
copy of DO (with the same id).

getOriginDatabase

public java.lang.String getOriginDatabase()
Subclass should override this method if wants to use it. Returns the name of the logical database for which DO was created.

Returns:
origin logical database name.

DODS 5.1 API