com.bristle.javalib.sql.bristle
Class AbstractStandardTableBackedObject

java.lang.Object
  extended by com.bristle.javalib.sql.bristle.AbstractStandardTableBackedObject
Direct Known Subclasses:
AbstractDictionaryEntry, AbstractSecurableStandardTableBackedObject

public abstract class AbstractStandardTableBackedObject
extends Object

This abstract class carries data for a single object that is backed by a table in a database, including all of the fields that are required to exist in all database tables according to the Bristle Software database standards.

Usage:

   - The typical scenarios for using this class are:

Assumptions:
Effects:
       - None.
Anticipated Changes:
Notes:
Implementation Notes:
Portability Issues:
Revision History:
   $Log$


Field Summary
private  int m_intId
           
private  AbstractDictionaryEntry m_status
           
private  String m_strCreateDT
           
private  String m_strCreateUser
           
private  String m_strUpdateDT
           
private  String m_strUpdateUser
           
private static long serialVersionUID
          This number identifies the version of the class definition, used for serialized instances.
private static int st_intDefaultNullClassId
           
private static int st_intDefaultNullId
           
 
Constructor Summary
AbstractStandardTableBackedObject()
           
 
Method Summary
abstract  AbstractStandardTableBackedObject getCLASS_OF_OBJECTS()
          Get the special instance that indicates the class of objects instead of any one particular instance.
abstract  int getClassId()
          Get the id of the class of objects.
 String getCreateDT()
          Get the date and time at which it was created.
 String getCreateUser()
          Get the username of the user who created it.
static int getDefaultNullClassId()
          Get the default the value that indicates a null id of the class of objects.
static int getDefaultNullId()
          Get the default for the value that indicates a null id.
 int getId()
          Get the id.
 int getNullClassId()
          Get the value that indicates a null id of the class of objects.
 int getNullId()
          Get the value that indicates a null id.
 AbstractDictionaryEntry getStatus()
          Get the status.
abstract  String getTableName()
          Get the name of the database table that holds the class of objects.
 String getUpdateDT()
          Get the date and time at which it was last updated.
 String getUpdateUser()
          Get the username of the user who last updated it.
protected  void setAll(int intId, String strCreateUser, String strCreateDT, String strUpdateUser, String strUpdateDT, AbstractDictionaryEntry status)
          Set all properties.
 void setCreateDT(String strVal)
          Set the date and time at which it was created.
 void setCreateUser(String strVal)
          Set the username of the user who created it.
 void setId(int intVal)
          Set the id.
 void setStatus(AbstractDictionaryEntry objVal)
          Set the status.
 void setUpdateDT(String strVal)
          Set the date and time at which it was last updated.
 void setUpdateUser(String strVal)
          Set the username of the user who last updated it.
protected  void shallowCopyFrom(AbstractStandardTableBackedObject objFrom)
          Do a shallow copy of all properties from the specified object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

st_intDefaultNullClassId

private static final int st_intDefaultNullClassId
See Also:
Constant Field Values

st_intDefaultNullId

private static final int st_intDefaultNullId
See Also:
Constant Field Values

m_intId

private int m_intId

m_strCreateUser

private String m_strCreateUser

m_strCreateDT

private String m_strCreateDT

m_strUpdateUser

private String m_strUpdateUser

m_strUpdateDT

private String m_strUpdateDT

m_status

private AbstractDictionaryEntry m_status

serialVersionUID

private static final long serialVersionUID
This number identifies the version of the class definition, used for serialized instances. Be sure to increment it when adding/modifying instance variable definitions or making any other change to the class definition. Omitting this declaration causes a compiler warning for any class that implements java.io.Serializable.

See Also:
Constant Field Values
Constructor Detail

AbstractStandardTableBackedObject

public AbstractStandardTableBackedObject()
Method Detail

setAll

protected void setAll(int intId,
                      String strCreateUser,
                      String strCreateDT,
                      String strUpdateUser,
                      String strUpdateDT,
                      AbstractDictionaryEntry status)
Set all properties. Use this whenever you want to be sure that properties added in the future are also set. Once this method is updated to include a new property, all calls will fail to compile unless they are also updated.

Parameters:
intId - The property value.
strCreateUser - The property value.
strCreateDT - The property value.
strUpdateUser - The property value.
strUpdateDT - The property value.
status - The property value.

shallowCopyFrom

protected void shallowCopyFrom(AbstractStandardTableBackedObject objFrom)
Do a shallow copy of all properties from the specified object.

Parameters:
objFrom - The object to copy from.

getId

public int getId()
Get the id.

Returns:
The id.

setId

public void setId(int intVal)
Set the id.

Parameters:
intVal - The value to set.

getCreateUser

public String getCreateUser()
Get the username of the user who created it.

Returns:
The username.

setCreateUser

public void setCreateUser(String strVal)
Set the username of the user who created it.

Parameters:
strVal - The value to set.

getCreateDT

public String getCreateDT()
Get the date and time at which it was created.

Returns:
The date/time.

setCreateDT

public void setCreateDT(String strVal)
Set the date and time at which it was created.

Parameters:
strVal - The value to set.

getUpdateUser

public String getUpdateUser()
Get the username of the user who last updated it.

Returns:
The username.

setUpdateUser

public void setUpdateUser(String strVal)
Set the username of the user who last updated it.

Parameters:
strVal - The value to set.

getUpdateDT

public String getUpdateDT()
Get the date and time at which it was last updated.

Returns:
The date/time.

setUpdateDT

public void setUpdateDT(String strVal)
Set the date and time at which it was last updated.

Parameters:
strVal - The value to set.

getStatus

public AbstractDictionaryEntry getStatus()
Get the status.

Returns:
The status.

setStatus

public void setStatus(AbstractDictionaryEntry objVal)
Set the status.

Parameters:
objVal - The value to set.

getNullId

public int getNullId()
Get the value that indicates a null id.
 Implementation Note:
   Not abstract, so subclasses can implicitly use the default value for 
   null id.

Returns:
The null id.

getDefaultNullId

public static int getDefaultNullId()
Get the default for the value that indicates a null id.
 Implementation Note:
   Not abstract, so subclasses can explicitly choose if and when to use 
   the default value for null id.

Returns:
The default value.

getClassId

public abstract int getClassId()
Get the id of the class of objects.
 Implementation Note:
   Abstract to force each subclass to explicitly specify its class id.
   If a subclass doesn't care about class id, it can call getNullClassId() 
   from its override.

Returns:
The class id.

getNullClassId

public int getNullClassId()
Get the value that indicates a null id of the class of objects.
 Implementation Note:
   Not abstract, so subclasses can implicitly use the default value for 
   null class id.

Returns:
The null class id.

getDefaultNullClassId

public static int getDefaultNullClassId()
Get the default the value that indicates a null id of the class of objects.
 Implementation Note:
   Not abstract, so subclasses can explicitly choose if and when to use 
   the default value for null class id.

Returns:
The default value.

getTableName

public abstract String getTableName()
Get the name of the database table that holds the class of objects.
 Implementation Note:
   Abstract to force each subclass to explicitly specify its table name.

Returns:
The table name.

getCLASS_OF_OBJECTS

public abstract AbstractStandardTableBackedObject getCLASS_OF_OBJECTS()
Get the special instance that indicates the class of objects instead of any one particular instance.
 Implementation Note:
   Abstract to force each subclass to explicitly specify an instance of 
   itself to represent its entire class.

Returns:
The special instance.