com.anasoft.os.daofusion.entity
Class PersistentEnumeration

java.lang.Object
  extended by com.anasoft.os.daofusion.entity.PersistentEntity<java.lang.Long>
      extended by com.anasoft.os.daofusion.entity.PersistentEnumeration
All Implemented Interfaces:
Persistable<java.lang.Long>, java.io.Serializable

public abstract class PersistentEnumeration
extends PersistentEntity<java.lang.Long>

Base class for persistent enumerations managed within the JPA / Hibernate persistence context.

Persistent enumeration is a special kind of persistent entity which adds a name field with unique, not-updatable and not-null constraints. The name field must be manually set by the user before persisting the instance. Persistent enumeration uses Long as the primary key column type.

Note that the persistent enumeration provides a hashCode() and equals(Object) implementation based on the name field.

Author:
vojtech.szocs
See Also:
PersistentEntity, Serialized Form

Field Summary
static java.lang.String _NAME
           
 
Fields inherited from class com.anasoft.os.daofusion.entity.PersistentEntity
_ID
 
Constructor Summary
PersistentEnumeration()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
 int hashCode()
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 
Methods inherited from class com.anasoft.os.daofusion.entity.PersistentEntity
clone, getId, setId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_NAME

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

PersistentEnumeration

public PersistentEnumeration()
Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.