org.archiviststoolkit.mydomain
Class DomainObject

java.lang.Object
  extended by com.jgoodies.binding.beans.Model
      extended by org.archiviststoolkit.mydomain.DomainObject
All Implemented Interfaces:
com.jgoodies.binding.beans.Observable, java.io.Serializable, java.lang.Comparable, Auditable, org.hibernate.classic.Lifecycle
Direct Known Subclasses:
AccessionsLocations, AccessionsResources, ArchDescription, ArchDescriptionInstances, ArchDescriptionNames, ArchDescriptionSubjects, BasicNames, Constants, DatabaseFields, DatabaseTables, Deaccessions, DefaultValues, InLineTagAttributes, InLineTags, Locations, LookupList, LookupListItems, NotesEtcTypes, Repositories, RepositoryNotesDefaultValues, RepositoryStatistics, SequencedObject, Sessions, Subjects, Users

public abstract class DomainObject
extends com.jgoodies.binding.beans.Model
implements org.hibernate.classic.Lifecycle, java.lang.Comparable, Auditable

The DomainObject should be the base class of all data types which we wish to store in our hibernate based database. TODO: Integer should be a Long identifier within hibernate

See Also:
Serialized Form

Field Summary
static java.lang.String CREATED
           
static java.lang.String CREATED_BY
           
static java.lang.String LAST_UPDATED
           
static java.lang.String LAST_UPDATED_BY
           
 
Fields inherited from interface org.hibernate.classic.Lifecycle
NO_VETO, VETO
 
Constructor Summary
protected DomainObject()
           
 
Method Summary
 void addRelatedObject(DomainObject domainObject)
          A dummy place holder to be overridden by classes that have related objects
 int compareTo(java.lang.Object object)
          Compares this object to another.
 java.util.Date creationDate()
           
 boolean equals(java.lang.Object object)
          Tests objects for equality.
 AuditInfo getAuditInfo()
          Instances must always return a non-null instance of AuditInfo
 java.util.Date getCreated()
           
 java.lang.String getCreatedBy()
           
abstract  java.lang.Long getIdentifier()
           
 java.util.Date getLastUpdated()
           
 java.lang.String getLastUpdatedBy()
           
 java.util.Collection getRelatedCollection(DomainObject domainObject)
          A dummy place holder to be overridden by classes that have related objects
 DomainObject getRelatedObject(DomainObject domainObject, int rowNumber)
          A dummy place holder to be overridden by classes that have related objects
 java.lang.String getUniqueConstraintKey()
          A dummy place holder to be overridden by classes that have unique keys other than the id
 java.lang.Long getVersion()
           
 int hashCode()
          Returns the hashcode for this object.
 java.lang.Boolean isNewRecord()
           
 java.util.Date lastUpdated()
           
 boolean onDelete(org.hibernate.Session session)
          Called when an entity is deleted.
 void onLoad(org.hibernate.Session session, java.io.Serializable serialid)
          Called after an entity is loaded.
 boolean onSave(org.hibernate.Session session)
          Called when an entity is saved.
 boolean onUpdate(org.hibernate.Session session)
          Called when an entity is updated.
 void removeIdAndAuditInfo()
           
 void removeRelatedObject(DomainObject domainObject)
          A dummy place holder to be overridden by classes that have related objects
 void setAuditInfo(AuditInfo auditInfo)
           
abstract  void setIdentifier(java.lang.Long identifier)
           
 void setVersion(java.lang.Long version)
           
 void testDeleteRules()
           
 boolean validateAndDisplayDialog(java.util.EventObject ae)
           
 
Methods inherited from class com.jgoodies.binding.beans.Model
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, equals, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, fireMultiplePropertiesChanged, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, getVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATED_BY

public static final java.lang.String CREATED_BY
See Also:
Constant Field Values

CREATED

public static final java.lang.String CREATED
See Also:
Constant Field Values

LAST_UPDATED

public static final java.lang.String LAST_UPDATED
See Also:
Constant Field Values

LAST_UPDATED_BY

public static final java.lang.String LAST_UPDATED_BY
See Also:
Constant Field Values
Constructor Detail

DomainObject

protected DomainObject()
Method Detail

creationDate

public final java.util.Date creationDate()
Returns:
Returns the creationdate.

getIdentifier

public abstract java.lang.Long getIdentifier()
Returns:
Returns the identifier.

setIdentifier

public abstract void setIdentifier(java.lang.Long identifier)
Parameters:
identifier - The identifier to set.

lastUpdated

public java.util.Date lastUpdated()
Returns:
Returns the modifieddate.

getVersion

public java.lang.Long getVersion()
Returns:
Returns the version.

setVersion

public void setVersion(java.lang.Long version)
Parameters:
version - The version to set.

isNewRecord

public java.lang.Boolean isNewRecord()

equals

public boolean equals(java.lang.Object object)
Tests objects for equality.

Overrides:
equals in class java.lang.Object
Parameters:
object - the object to test against
Returns:
true if the object equals this object

hashCode

public int hashCode()
Returns the hashcode for this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode

onDelete

public final boolean onDelete(org.hibernate.Session session)
Called when an entity is deleted.

Specified by:
onDelete in interface org.hibernate.classic.Lifecycle
Parameters:
session - the session to delete on
Returns:
true to veto delete

onLoad

public void onLoad(org.hibernate.Session session,
                   java.io.Serializable serialid)
Called after an entity is loaded.

Specified by:
onLoad in interface org.hibernate.classic.Lifecycle
Parameters:
session - the session which loaded the entity
serialid - the identifier of the entity

onSave

public boolean onSave(org.hibernate.Session session)
Called when an entity is saved.

Specified by:
onSave in interface org.hibernate.classic.Lifecycle
Parameters:
session - the session to save on
Returns:
true to veto save

onUpdate

public boolean onUpdate(org.hibernate.Session session)
Called when an entity is updated.

Specified by:
onUpdate in interface org.hibernate.classic.Lifecycle
Parameters:
session - the session to update on
Returns:
true to veto update

compareTo

public int compareTo(java.lang.Object object)
Compares this object to another.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
object - the object to compare this to.
Returns:
a integer result of the comparison.

getAuditInfo

public AuditInfo getAuditInfo()
Instances must always return a non-null instance of AuditInfo

Specified by:
getAuditInfo in interface Auditable

setAuditInfo

public void setAuditInfo(AuditInfo auditInfo)

getCreatedBy

public java.lang.String getCreatedBy()

getLastUpdatedBy

public java.lang.String getLastUpdatedBy()

getCreated

public java.util.Date getCreated()

getLastUpdated

public java.util.Date getLastUpdated()

removeRelatedObject

public void removeRelatedObject(DomainObject domainObject)
A dummy place holder to be overridden by classes that have related objects

Parameters:
domainObject - the domain object to be removed

addRelatedObject

public void addRelatedObject(DomainObject domainObject)
                      throws AddRelatedObjectException,
                             DuplicateLinkException
A dummy place holder to be overridden by classes that have related objects

Parameters:
domainObject - the domain object to be removed
Throws:
AddRelatedObjectException
DuplicateLinkException

getRelatedCollection

public java.util.Collection getRelatedCollection(DomainObject domainObject)
A dummy place holder to be overridden by classes that have related objects

Parameters:
domainObject - the domain object to be removed

getRelatedObject

public DomainObject getRelatedObject(DomainObject domainObject,
                                     int rowNumber)
A dummy place holder to be overridden by classes that have related objects

Parameters:
rowNumber - the row of the object to retrieve

getUniqueConstraintKey

public java.lang.String getUniqueConstraintKey()
A dummy place holder to be overridden by classes that have unique keys other than the id


removeIdAndAuditInfo

public void removeIdAndAuditInfo()

validateAndDisplayDialog

public boolean validateAndDisplayDialog(java.util.EventObject ae)

testDeleteRules

public void testDeleteRules()
                     throws DeleteException,
                            PersistenceException
Throws:
DeleteException
PersistenceException