DODS 6.5 API

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

java.lang.Object
  extended bycom.lutris.appserver.server.sql.CoreDO
      extended bycom.lutris.appserver.server.sql.CloneableDO
          extended bycom.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 colChanged
           
protected  boolean dirty
           
 
Fields inherited from class com.lutris.appserver.server.sql.CoreDO
originalData, 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.
static GenericDO createDO(ObjectId oid)
          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 get_CacheHandle()
          Subclass should override this method if wants to use it.
 java.lang.Object get_Data()
          Subclass should override this method if wants to use it.
 java.lang.String get_Handle()
          Subclass should override this method if wants to use it.
 java.lang.String get_OriginDatabase()
          Subclass should override this method if wants to use it.
protected static java.lang.String get_primaryKeyName()
          Return the name of the primary key column.
 java.lang.Object getData()
          Deprecated. Use get_Data()
 java.lang.String getHandle()
          Deprecated. Use get_Handle() instead.
 java.lang.String getOriginDatabase()
          Deprecated. Use get_OriginDatabase()
protected static java.lang.String getPrimaryKeyName()
          Deprecated. use get_primaryKeyName()
 boolean isDirty()
          isDirty() returns true if this object has been modified (needs to be updated to the database).
 boolean isExecutePartially()
           
protected static boolean isNewDataDifferent_BigDecimal(java.math.BigDecimal oldData, java.math.BigDecimal newData)
           
protected static boolean isNewDataDifferent_boolean(boolean oldData, boolean newData)
           
protected static boolean isNewDataDifferent_byte(byte oldData, byte newData)
           
protected static boolean isNewDataDifferent_bytes(byte[] oldData, byte[] newData)
           
protected static boolean isNewDataDifferent_DO(GenericDO oldData, GenericDO newData)
           
protected static boolean isNewDataDifferent_double(double oldData, double newData)
           
protected static boolean isNewDataDifferent_float(float oldData, float newData)
           
protected static boolean isNewDataDifferent_int(int oldData, int newData)
           
protected static boolean isNewDataDifferent_java_math_BigDecimal(java.math.BigDecimal oldData, java.math.BigDecimal newData)
           
protected static boolean isNewDataDifferent_java_sql_Date(java.sql.Date oldData, java.sql.Date newData)
           
protected static boolean isNewDataDifferent_java_sql_Time(java.sql.Time oldData, java.sql.Time newData)
           
protected static boolean isNewDataDifferent_java_sql_Timestamp(java.sql.Timestamp oldData, java.sql.Timestamp newData)
           
protected static boolean isNewDataDifferent_long(long oldData, long newData)
           
protected static boolean isNewDataDifferent_short(short oldData, short newData)
           
protected static boolean isNewDataDifferent_String(java.lang.String oldData, java.lang.String newData)
           
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).
 void originalData_set(java.lang.Object data)
          Subclass should override this method if wants to use it.
static void printMsg(int level, java.lang.String s)
           
 void set_Data(java.lang.Object data)
          Subclass should override this method if wants to use it.
protected  void set_OId(ObjectId oId)
          Sets this object's identifier.
 void setData(java.lang.Object data)
          Deprecated. Use set_Data()
 void setExecutePartially(boolean _ep)
           
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, dumpData, evict, executeLockingStatement, finalizeDelete, get_NewVersion, get_OId, get_OIdColumnName, get_Version, get_versionColumnName, getDeleteStatement, getInsertStatement, getNewVersion, getOId, getOIdColumnName, getOriginalVersion, getTableName, getUpdateStatement, getVersion, getVersionColumnName, isPersistent, makeInvisible, makeVisible, originalData_get, refresh, set_NewVersion, set_OIdColumnName, set_Version, set_versionColumnName, 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

colChanged

protected boolean colChanged
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(int 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.

Parameters:
obj - The original DO.

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.get_NewVersion()

get_primaryKeyName

protected static java.lang.String get_primaryKeyName()
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:
author Jay Gunter

getPrimaryKeyName

protected static java.lang.String getPrimaryKeyName()
Deprecated. use get_primaryKeyName()

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:
author Jay Gunter

setOId

protected void setOId(ObjectId oId)
Deprecated. Use set_OId()

Description copied from class: CoreDO
Sets this object's identifier.

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

set_OId

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

Overrides:
set_OId 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:
current_val - The current value of the byte array data member.
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 )

Parameters:
current_DO - Curent data object.
new_DO - New data object.
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
Throws:
java.sql.SQLException

isNewDataDifferent_DO

protected static boolean isNewDataDifferent_DO(GenericDO oldData,
                                               GenericDO newData)

setPrepStmtParam_String

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

isNewDataDifferent_String

protected static boolean isNewDataDifferent_String(java.lang.String oldData,
                                                   java.lang.String newData)

setPrepStmtParam_float

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

isNewDataDifferent_float

protected static boolean isNewDataDifferent_float(float oldData,
                                                  float newData)

setPrepStmtParam_int

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

isNewDataDifferent_int

protected static boolean isNewDataDifferent_int(int oldData,
                                                int newData)

setPrepStmtParam_java_math_BigDecimal

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

isNewDataDifferent_java_math_BigDecimal

protected static boolean isNewDataDifferent_java_math_BigDecimal(java.math.BigDecimal oldData,
                                                                 java.math.BigDecimal newData)

setPrepStmtParam_BigDecimal

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

isNewDataDifferent_BigDecimal

protected static boolean isNewDataDifferent_BigDecimal(java.math.BigDecimal oldData,
                                                       java.math.BigDecimal newData)

setPrepStmtParam_java_sql_Date

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

isNewDataDifferent_java_sql_Date

protected static boolean isNewDataDifferent_java_sql_Date(java.sql.Date oldData,
                                                          java.sql.Date newData)

setPrepStmtParam_java_sql_Time

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

isNewDataDifferent_java_sql_Time

protected static boolean isNewDataDifferent_java_sql_Time(java.sql.Time oldData,
                                                          java.sql.Time newData)

setPrepStmtParam_java_sql_Timestamp

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

isNewDataDifferent_java_sql_Timestamp

protected static boolean isNewDataDifferent_java_sql_Timestamp(java.sql.Timestamp oldData,
                                                               java.sql.Timestamp newData)

setPrepStmtParam_bytes

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

isNewDataDifferent_bytes

protected static boolean isNewDataDifferent_bytes(byte[] oldData,
                                                  byte[] newData)

setPrepStmtParam_double

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

isNewDataDifferent_double

protected static boolean isNewDataDifferent_double(double oldData,
                                                   double newData)

setPrepStmtParam_long

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

isNewDataDifferent_long

protected static boolean isNewDataDifferent_long(long oldData,
                                                 long newData)

setPrepStmtParam_short

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

isNewDataDifferent_short

protected static boolean isNewDataDifferent_short(short oldData,
                                                  short newData)

setPrepStmtParam_byte

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

isNewDataDifferent_byte

protected static boolean isNewDataDifferent_byte(byte oldData,
                                                 byte newData)

setPrepStmtParam_boolean

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

isNewDataDifferent_boolean

protected static boolean isNewDataDifferent_boolean(boolean oldData,
                                                    boolean newData)

toString

public java.lang.String toString(int x)

delete

public void delete()
            throws java.sql.SQLException,
                   DatabaseManagerException,
                   DataObjectException,
                   RefAssertionException,
                   DBRowUpdateException,
                   QueryException
Throws:
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)
Deprecated. Use set_Data()

Subclass should override this method if wants to use it. Sets DO's data.

Parameters:
data - DO's data.

set_Data

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

Parameters:
data - DO's data.

originalData_set

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


getData

public java.lang.Object getData()
Deprecated. Use get_Data()

Returns:
DO's data.

get_Data

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

Returns:
DO's data.

get_Handle

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

Returns:
DO's handle.
Throws:
DatabaseManagerException

getHandle

public java.lang.String getHandle()
                           throws DatabaseManagerException
Deprecated. Use get_Handle() instead.

Subclass should override this method if wants to use it. Returns DO's handle.

Returns:
DO's handle.
Throws:
DatabaseManagerException

get_CacheHandle

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

Returns:
DO's cache handle.
Throws:
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).

createDO

public static GenericDO createDO(ObjectId oid)
                          throws java.sql.SQLException,
                                 ObjectIdException,
                                 DataObjectException,
                                 DatabaseManagerException
Subclass should override this method if wants to use it. Created DO with specified OID.

Parameters:
oid - DO(by oid) which will be copied.
Returns:
copy of DO (with the same id).
Throws:
java.sql.SQLException
ObjectIdException
DataObjectException
DatabaseManagerException

getOriginDatabase

public java.lang.String getOriginDatabase()
Deprecated. Use get_OriginDatabase()

Returns:
origin logical database name.

get_OriginDatabase

public java.lang.String get_OriginDatabase()
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.

setExecutePartially

public void setExecutePartially(boolean _ep)

isExecutePartially

public boolean isExecutePartially()

DODS 6.5 API