org.opensubsystems.core.data
Class BasicDataObject

java.lang.Object
  extended by org.opensubsystems.core.data.DataObject
      extended by org.opensubsystems.core.data.BasicDataObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ModifiableDataObject

public abstract class BasicDataObject
extends DataObject

Base class for all data objects, which want to track when they were created and which belongs to some partition (called domain).

Version:
$Id: BasicDataObject.java,v 1.8 2007/01/07 06:14:17 bastafidli Exp $
Author:
Miro Halas
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.6 2005/08/22 06:29:10 bastafidli

Field Summary
protected  java.sql.Timestamp m_creationTimestamp
          Creation timestamp when the data object was created.
protected  int m_iDomainId
          Id of the domain this data object belongs to.
 
Fields inherited from class org.opensubsystems.core.data.DataObject
NEW_ID, NEW_ID_OBJ, NEW_ID_STR
 
Constructor Summary
BasicDataObject()
          Default constructor.
BasicDataObject(int iDomainId)
          Simple constructor creating new data object in particular domain.
BasicDataObject(int iId, int iDomainId, java.sql.Timestamp creationTimestamp)
          Full constructor.
 
Method Summary
 boolean equals(java.lang.Object oObject)
          
 java.sql.Timestamp getCreationTimestamp()
          Creation timestamp is timestamp when the data object was created.
 int getDomainId()
           
 int getId()
          Get the id uniquely identifying the object.
 java.lang.Integer getIdAsObject()
          Get the id as object uniquely identifying the object.
 int hashCode()
          
protected  void restore(int iId, int iDomainId, java.sql.Timestamp creationTimestamp)
          Restore all values from specified values.
 void setCreationTimestamp(java.sql.Timestamp creationTimestamp)
          Creation timestamp is timestamp when the data object was created.
 void setId(int iNewId)
           
 
Methods inherited from class org.opensubsystems.core.data.DataObject
isFromPersistenceStore, isSame, setFromPersistenceStore
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_iDomainId

protected int m_iDomainId
Id of the domain this data object belongs to. Domain represents default partition where the data object belongs to (since it is pressumed that each data object belongs to some partitions).


m_creationTimestamp

protected java.sql.Timestamp m_creationTimestamp
Creation timestamp when the data object was created.

Constructor Detail

BasicDataObject

public BasicDataObject()
Default constructor.


BasicDataObject

public BasicDataObject(int iDomainId)
Simple constructor creating new data object in particular domain.

Parameters:
iDomainId - - domain this data object belongs to

BasicDataObject

public BasicDataObject(int iId,
                       int iDomainId,
                       java.sql.Timestamp creationTimestamp)
Full constructor.

Parameters:
iId - - id of this data object
iDomainId - - domain this data object belongs to
creationTimestamp - - timestamp when the data object was created.
Method Detail

getDomainId

public int getDomainId()
Returns:
int

getId

public int getId()
Get the id uniquely identifying the object.

Specified by:
getId in class DataObject
Returns:
int

getIdAsObject

public java.lang.Integer getIdAsObject()
Get the id as object uniquely identifying the object. This method allows to the implementing class to cache this object if desired to improve performance.

Specified by:
getIdAsObject in class DataObject
Returns:
Integer

setId

public void setId(int iNewId)
Parameters:
iNewId - - new id of the data object

getCreationTimestamp

public java.sql.Timestamp getCreationTimestamp()
Creation timestamp is timestamp when the data object was created.

Returns:
Timestamp

setCreationTimestamp

public void setCreationTimestamp(java.sql.Timestamp creationTimestamp)
Creation timestamp is timestamp when the data object was created.

Parameters:
creationTimestamp - - new creation timestamp

equals

public boolean equals(java.lang.Object oObject)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

restore

protected void restore(int iId,
                       int iDomainId,
                       java.sql.Timestamp creationTimestamp)
Restore all values from specified values. This is here to reinitialize object in case it needs to be reused or reconstructed (e.g. when rollback is issued).

Parameters:
iId - - id of this data object
iDomainId - - domain this data object belongs to
creationTimestamp - - timestamp when the data object was created.


Copyright © 2003 - 2006 OpenSubsystems s.r.o.