|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jzeno.model.AbstractEntity
net.sf.jzeno.hibernate.PersistentEnum
public abstract class PersistentEnum
Provides a base class for implementations of persistable, type-safe, comparable and serializable enums with a custom persisted representation.
The subclass must provide a compareTo(Object) and getNullableType() implementation.
| Field Summary |
|---|
| Fields inherited from class net.sf.jzeno.model.AbstractEntity |
|---|
serialVersionUID |
| Constructor Summary | |
|---|---|
protected |
PersistentEnum()
Default constructor. |
| Method Summary | |
|---|---|
java.lang.Object |
assemble(java.io.Serializable cached,
java.lang.Object owner)
|
int |
compareTo(java.lang.Object other)
define the natural ordering of abstract entities |
java.lang.Object |
deepCopy(java.lang.Object value)
|
java.io.Serializable |
disassemble(java.lang.Object value)
|
boolean |
equals(java.lang.Object x,
java.lang.Object y)
|
java.io.Serializable |
getEnumCode()
Gets the persistable enum code of this enum. |
protected org.hibernate.type.NullableType |
getNullableType()
|
int |
hashCode(java.lang.Object x)
|
boolean |
isMutable()
|
java.lang.Object |
nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
java.lang.Object owner)
|
void |
nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index)
|
java.lang.Object |
replace(java.lang.Object original,
java.lang.Object target,
java.lang.Object owner)
|
java.lang.Class |
returnedClass()
|
int[] |
sqlTypes()
|
| Methods inherited from class net.sf.jzeno.model.AbstractEntity |
|---|
clone, equals, getChangedValue, getChangedValues, getId, getOriginalValue, getOriginalValues, hashCode, isChanged, isChanged, isUnsaved, onDelete, onFlushDirty, onLoad, onSave, postFlush, preFlush, setId, snapshot, superHashCode, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected PersistentEnum()
Default constructor. Hibernate need the default constructor to retrieve
an instance of the enum from a JDBC resultset. The instance will be
converted to the correct enum instance in
nullSafeGet(java.sql.ResultSet, java.lang.String[], java.lang.Object).
| Method Detail |
|---|
public int compareTo(java.lang.Object other)
AbstractEntitydefine the natural ordering of abstract entities
compareTo in interface java.lang.ComparablecompareTo in class AbstractEntityprotected org.hibernate.type.NullableType getNullableType()
public int[] sqlTypes()
sqlTypes in interface PersistentEnumItfsqlTypes in interface org.hibernate.usertype.UserType
public java.lang.Object deepCopy(java.lang.Object value)
throws org.hibernate.HibernateException
deepCopy in interface PersistentEnumItfdeepCopy in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateExceptionpublic boolean isMutable()
isMutable in interface PersistentEnumItfisMutable in interface org.hibernate.usertype.UserTypepublic java.lang.Class returnedClass()
returnedClass in interface PersistentEnumItfreturnedClass in interface org.hibernate.usertype.UserType
public boolean equals(java.lang.Object x,
java.lang.Object y)
throws org.hibernate.HibernateException
equals in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
public java.lang.Object nullSafeGet(java.sql.ResultSet rs,
java.lang.String[] names,
java.lang.Object owner)
throws org.hibernate.HibernateException,
java.sql.SQLException
nullSafeGet in interface PersistentEnumItfnullSafeGet in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
java.sql.SQLException
public void nullSafeSet(java.sql.PreparedStatement st,
java.lang.Object value,
int index)
throws org.hibernate.HibernateException,
java.sql.SQLException
nullSafeSet in interface PersistentEnumItfnullSafeSet in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
java.sql.SQLExceptionpublic java.io.Serializable getEnumCode()
PersistentEnumItfGets the persistable enum code of this enum.
getEnumCode in interface PersistentEnumItf
public java.lang.Object assemble(java.io.Serializable cached,
java.lang.Object owner)
throws org.hibernate.HibernateException
assemble in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
public java.io.Serializable disassemble(java.lang.Object value)
throws org.hibernate.HibernateException
disassemble in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
public int hashCode(java.lang.Object x)
throws org.hibernate.HibernateException
hashCode in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
public java.lang.Object replace(java.lang.Object original,
java.lang.Object target,
java.lang.Object owner)
throws org.hibernate.HibernateException
replace in interface org.hibernate.usertype.UserTypeorg.hibernate.HibernateException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||