|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.dominate.EntityImpl
public class EntityImpl
Typical implementation of an entity object whose identifier is a Long value.
This implementation can be used, for example, as a base class for object persisted on a relational database and whose primary key is generated using a sequence or an id field.
It has optimistic lock version property and property change support too
| Constructor Summary | |
|---|---|
EntityImpl()
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
|
boolean |
equals(Object obj)
Two entities are equals if they have the same id and their classes are compatible. |
protected void |
firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
|
Long |
getId()
Returns this entity object identifier. |
Long |
getVersion()
|
int |
hashCode()
Calculate this entity object hash code using its id |
void |
removePropertyChangeListener(PropertyChangeListener listener)
|
void |
setId(Long id)
Sets this entity object identifier. |
void |
setVersion(Long version)
|
String |
toString()
Return a string containing class name, id and version of the entity |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EntityImpl()
| Method Detail |
|---|
public Long getId()
Entity
getId in interface Entity<Long>public void setId(Long id)
Entity
setId in interface Entity<Long>id - the identifier to be setpublic Long getVersion()
getVersion in interface OptLockEntity<Long>public void setVersion(Long version)
setVersion in interface OptLockEntity<Long>public boolean equals(Object obj)
equals in class Objectobj - the object with which to compare
Object.equals(Object)public int hashCode()
hashCode in class ObjectObject.hashCode()public String toString()
toString in class Object
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener in interface PropertyChangeEmitterpublic void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener in interface PropertyChangeEmitter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||