org.bejug.javacareers.jobs.model
Class AbstractPersistableObject

java.lang.Object
  extended byorg.bejug.javacareers.jobs.model.AbstractPersistableObject
All Implemented Interfaces:
java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
AbstractParameter, Address, Comment, Contact, Country, Item, Organisation, Person, QAndA, Region

public abstract class AbstractPersistableObject
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

The abstract persistable object contains the id, version, creation and modification fields for all persistable objects.

Version:
$Revision$ - $Date$
Author:
bme (Last modified by $Author$)
See Also:
Serialized Form

Constructor Summary
AbstractPersistableObject()
          default constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          
 boolean equals(java.lang.Object o)
          
 java.sql.Timestamp getCreationDate()
          If we have a new object, then we have to create the creationDate and modificationDate.
 java.lang.Integer getId()
          Gets the id.
 java.sql.Timestamp getModificationDate()
           
 java.lang.Integer getVersion()
          Gets the version.
 int hashCode()
          
 boolean isEditable()
           
 boolean isNew()
          Indicates wether this is a transient object.
 void setCreationDate(java.sql.Timestamp creationDate)
           
 void setEditable(boolean newValue)
          convenience method to flag this object as editable
 void setId(java.lang.Integer id)
          Sets the id.
 void setModificationDate(java.sql.Timestamp modificationDate)
           
 void setVersion(java.lang.Integer version)
          Sets the version.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractPersistableObject

public AbstractPersistableObject()
default constructor.

Method Detail

equals

public boolean equals(java.lang.Object o)


hashCode

public int hashCode()


compareTo

public int compareTo(java.lang.Object o)

Specified by:
compareTo in interface java.lang.Comparable

toString

public java.lang.String toString()


isNew

public boolean isNew()
Indicates wether this is a transient object.

Returns:
true if this object has not been persisted yet; false otherwise

getId

public java.lang.Integer getId()
Gets the id.

Returns:
the id

setId

public void setId(java.lang.Integer id)
Sets the id.

Parameters:
id - the id

getVersion

public java.lang.Integer getVersion()
Gets the version.

Returns:
the version

setVersion

public void setVersion(java.lang.Integer version)
Sets the version.

Parameters:
version - the version

getCreationDate

public java.sql.Timestamp getCreationDate()
If we have a new object, then we have to create the creationDate and modificationDate.

Returns:
Returns the creation date.

setCreationDate

public void setCreationDate(java.sql.Timestamp creationDate)
Parameters:
creationDate - Timestamp

getModificationDate

public java.sql.Timestamp getModificationDate()
Returns:
modificationDate Timestamp

setModificationDate

public void setModificationDate(java.sql.Timestamp modificationDate)
Parameters:
modificationDate - Timestamp

isEditable

public boolean isEditable()
Returns:
editable boolean

setEditable

public void setEditable(boolean newValue)
convenience method to flag this object as editable

Parameters:
newValue - the bolean value to set


Copyright © 2005-2006 BeJUG. All Rights Reserved.