org.davesag.generica.core
Class AbstractDateStamped

java.lang.Object
  extended byorg.davesag.generica.core.AbstractDateStamped
All Implemented Interfaces:
DateStamped, Persistable, Serializable
Direct Known Subclasses:
AbstractContent

public abstract class AbstractDateStamped
extends Object
implements Persistable, DateStamped, Serializable

This AbstractDateStamped bean is an abstract Persitable DateStamped item with created and lastModified dates.

Since:
Generica 1.0
Version:
CVS Revision $Id: AbstractDateStamped.java,v 1.13 2004/04/08 13:19:07 davesag Exp $
Author:
Dave Sag http://www.davesag.com
See Also:
Serialized Form
Peristable via Hibernate:
table = "contents"

Field Summary
protected  Date theCreated
          the date the content was created
protected  Long theId
          content's id used as a key by hibernate
protected  Date theLastModified
          the date the content was last modified
 
Constructor Summary
AbstractDateStamped()
          default constructor
 
Method Summary
 boolean equals(Object o)
          Tests if the supplied object is equal to this AbstractDateStamped, ie do they have the same Id?
 Date getCreated()
          Get the date that this AbstractDateStamped was created.
 Long getId()
          Get the AbstractDateStamped's ID number.
 Date getLastModified()
          Get the date that this AbstractDateStamped was last modified.
abstract  int hashcode()
          Objects must override the hashcode if they override the equals method.
 void setCreated(Date date)
          Set this AbstractDateStamped's creation date.
protected  void setId(Long id)
          Sets the The AbstractDateStamped's ID number.
 void setLastModified(Date date)
          Set this AbstractDateStamped's last modified date.
 void setTemplateId(Long id)
          Sets the The AbstractDateStamped's ID number directly.
abstract  String toString()
          Override this to be useful to you.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

theId

protected Long theId
content's id used as a key by hibernate


theCreated

protected Date theCreated
the date the content was created


theLastModified

protected Date theLastModified
the date the content was last modified

Constructor Detail

AbstractDateStamped

public AbstractDateStamped()
default constructor

Method Detail

getId

public Long getId()
Get the AbstractDateStamped's ID number.

Specified by:
getId in interface Persistable
Returns:
The AbstractDateStamped's ID number.
Hibernate Unique ID Property:
generator-class = "identity"

setId

protected void setId(Long id)
Sets the The AbstractDateStamped's ID number.

Parameters:
id - The ID number to set.

setTemplateId

public void setTemplateId(Long id)
Sets the The AbstractDateStamped's ID number directly. This is only to be used when creating a template object, and is not to be used when creating actual objects that will be persisted.

Specified by:
setTemplateId in interface Persistable
Parameters:
id - The ID number to set.

getCreated

public Date getCreated()
Get the date that this AbstractDateStamped was created.

Specified by:
getCreated in interface DateStamped
Returns:
The Date this AbstractDateStamped was created.
Hibernate Property:

setCreated

public void setCreated(Date date)
Set this AbstractDateStamped's creation date.

Specified by:
setCreated in interface DateStamped
Parameters:
date - The Date that this AbstractDateStamped was created.

getLastModified

public Date getLastModified()
Get the date that this AbstractDateStamped was last modified.

Specified by:
getLastModified in interface DateStamped
Returns:
The Date this AbstractDateStamped was last modified.
Hibernate Property:

setLastModified

public void setLastModified(Date date)
Set this AbstractDateStamped's last modified date.

Specified by:
setLastModified in interface DateStamped
Parameters:
date - The date this content was last modified.

toString

public abstract String toString()
Override this to be useful to you.

Returns:
the content title. useful for debugging.

equals

public boolean equals(Object o)
Tests if the supplied object is equal to this AbstractDateStamped, ie do they have the same Id?

Parameters:
o - The object to test against this AbstractDateStamped. Must also be a AbstractDateStamped to make sense.
Returns:
true if the two users have the same id.

hashcode

public abstract int hashcode()
Objects must override the hashcode if they override the equals method.

Returns:
a valid hashcode for this content.


Dave Sag Generica API version 0.5.9 - (prerelease) Copyright 2003 - 2004 Dave Sag.