|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.etaxonomy.cdm.model.common.CdmBase
@MappedSuperclass public abstract class CdmBase
The base class for all CDM domain classes implementing UUIDs and bean property change event firing.
It provides a globally unique UUID and keeps track of creation date and person.
The UUID is the same for different versions (see VersionableEntity) of a CDM object, so a locally unique id exists in addition
that allows to safely access and store several objects (=version) with the same UUID.
This class together with the eu.etaxonomy.cdm.aspectj.PropertyChangeAspect
will fire bean change events to all registered listeners. Listener registration and event firing
is done with the help of the PropertyChangeSupport class.
| Field Summary | |
|---|---|
protected UUID |
uuid
|
| Constructor Summary | |
|---|---|
CdmBase()
Class constructor assigning a unique UUID and creation date. |
|
| Method Summary | ||
|---|---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
see PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener) |
|
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
see PropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener) |
|
Object |
clone()
|
|
protected void |
clone(CdmBase clone)
|
|
static
|
deproxy(Object object,
Class<T> clazz)
These methods are present due to HHH-1517 - that in a one-to-many relationship with a superclass at the "one" end, the proxy created by hibernate is the superclass, and not the subclass, resulting in a classcastexception when you try to cast it. |
|
boolean |
equals(Object obj)
Is true if UUID is the same for the passed Object and this one. |
|
void |
firePropertyChange(PropertyChangeEvent evt)
|
|
void |
firePropertyChange(String property,
boolean oldval,
boolean newval)
|
|
void |
firePropertyChange(String property,
float oldval,
float newval)
|
|
void |
firePropertyChange(String property,
int oldval,
int newval)
|
|
void |
firePropertyChange(String property,
Object oldval,
Object newval)
|
|
void |
firePropertyChange(String property,
String oldval,
String newval)
|
|
org.joda.time.DateTime |
getCreated()
|
|
User |
getCreatedBy()
|
|
int |
getId()
Returns local unique identifier for the concrete subclass |
|
UUID |
getUuid()
|
|
int |
hashCode()
Overrides Object.hashCode()
See hibernate109, geocities
or ibm
for more information about equals and hashcode. |
|
boolean |
hasListeners(String propertyName)
|
|
String |
instanceToString()
This returns an String that identifies the cdm instacne well without being necessarily unique. |
|
protected void |
invokeSetMethod(Method method,
Object object)
|
|
protected void |
invokeSetMethodWithNull(Method method,
Object object)
|
|
boolean |
isInstanceOf(Class<? extends CdmBase> clazz)
|
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
see PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener) |
|
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
|
|
void |
setCreated(org.joda.time.DateTime created)
Sets the timestamp this object was created. |
|
void |
setCreatedBy(User createdBy)
|
|
void |
setId(int id)
Assigns a unique local ID to this object. |
|
void |
setUuid(UUID uuid)
|
|
String |
toString()
Overrides Object.toString(). |
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
@NotNull
@Field(store=YES,
index=YES,
analyze=NO)
@FieldBridge(impl=UuidBridge.class)
protected UUID uuid
| Constructor Detail |
|---|
public CdmBase()
| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
listener -
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
PropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener listener)
PropertyChangeSupport.addPropertyChangeListener(PropertyChangeListener)
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
PropertyChangeSupport.addPropertyChangeListener(String, PropertyChangeListener)public boolean hasListeners(String propertyName)
public void firePropertyChange(String property,
String oldval,
String newval)
public void firePropertyChange(String property,
int oldval,
int newval)
public void firePropertyChange(String property,
float oldval,
float newval)
public void firePropertyChange(String property,
boolean oldval,
boolean newval)
public void firePropertyChange(String property,
Object oldval,
Object newval)
public void firePropertyChange(PropertyChangeEvent evt)
public UUID getUuid()
getUuid in interface ICdmBasepublic void setUuid(UUID uuid)
setUuid in interface ICdmBasepublic int getId()
ICdmBase
getId in interface ICdmBasepublic void setId(int id)
ICdmBase
setId in interface ICdmBasepublic org.joda.time.DateTime getCreated()
getCreated in interface ICdmBasepublic void setCreated(org.joda.time.DateTime created)
ICdmBaseTRAC ticket
setCreated in interface ICdmBasepublic User getCreatedBy()
getCreatedBy in interface ICdmBasepublic void setCreatedBy(User createdBy)
setCreatedBy in interface ICdmBase
public static <T extends CdmBase> T deproxy(Object object,
Class<T> clazz)
throws ClassCastException
T - object - clazz -
ClassCastException
public boolean isInstanceOf(Class<? extends CdmBase> clazz)
throws ClassCastException
ClassCastExceptionpublic boolean equals(Object obj)
equals in class ObjectSee {@link http://www.hibernate.org/109.html hibernate109}, {@link http://www.geocities.com/technofundo/tech/java/equalhash.html geocities}
or {@link http://www.ibm.com/developerworks/java/library/j-jtp05273.html ibm}
for more information about equals and hashcode.public int hashCode()
Object.hashCode()
See hibernate109, geocities
or ibm
for more information about equals and hashcode.
hashCode in class Objectpublic String toString()
Object.toString().
This returns an String that identifies the object well without being necessarily unique. Internally the method is delegating the
call to {link instanceToString().Note: If overriding this method's javadoc always copy or link the above requirement. If not overwritten by a subclass method returns the class, id and uuid as a string for any CDM object.
For example: Taxon#13<b5938a98-c1de-4dda-b040-d5cc5bfb3bc0>
toString in class ObjectObject.toString()public String instanceToString()
id and uuid.
For example: Taxon#13<b5938a98-c1de-4dda-b040-d5cc5bfb3bc0>
protected void invokeSetMethod(Method method,
Object object)
protected void invokeSetMethodWithNull(Method method,
Object object)
protected void clone(CdmBase clone)
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||