com.ebmwebsourcing.webcommons.persistence.bo
Class BaseObject

java.lang.Object
  extended by com.ebmwebsourcing.webcommons.persistence.bo.BaseObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LongIdBaseObject, StringIdBaseObject, StringIdSearchableBaseObject, TimestampBaseObject

public abstract class BaseObject
extends java.lang.Object
implements java.io.Serializable

Base class for Model objects. Child objects should implement toString(), equals() and hashCode().

Author:
Olivier Fabre
See Also:
Serialized Form

Constructor Summary
BaseObject()
           
 
Method Summary
abstract  boolean equals(java.lang.Object o)
          Compares object equality.
abstract  java.lang.Object getId()
           
abstract  int hashCode()
          When you override equals, you should override hashCode.
abstract  java.lang.String toString()
          Returns a multi-line String with key=value pairs.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseObject

public BaseObject()
Method Detail

toString

public abstract java.lang.String toString()
Returns a multi-line String with key=value pairs.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this class.

equals

public abstract boolean equals(java.lang.Object o)
Compares object equality. When using Hibernate, the primary key should not be a part of this comparison.

Overrides:
equals in class java.lang.Object
Parameters:
o - object to compare to
Returns:
true/false based on equality tests

hashCode

public abstract int hashCode()
When you override equals, you should override hashCode. See "Why are equals() and hashCode() importation" for more information: http://www.hibernate.org/109.html

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

getId

public abstract java.lang.Object getId()


Copyright © 2010 eBM WebSourcing. All Rights Reserved.