public abstract class AbstractTopiaEntity extends Object implements TopiaEntity
ListenableTopiaEntity but it implements its
methods to lighten base implementation.| Modifier and Type | Field and Description |
|---|---|
protected static TopiaFiresSupport |
DEFAULT_INSTANCE
Default instance used as fallback by the entities if they are out of a ToPIA runtime scope.
|
protected boolean |
deleted |
protected WeakReference<TopiaFiresSupport> |
firesSupport
A potential instance that may be injected by the Dao or retrieved in a contextable entity.
|
protected PropertyChangeSupport |
postReadListeners |
protected PropertyChangeSupport |
postWriteListeners |
protected VetoableChangeSupport |
preReadListeners |
protected VetoableChangeSupport |
preWriteListeners |
protected Date |
topiaCreateDate |
protected String |
topiaId |
protected long |
topiaVersion |
AGGREGATE, COMPOSITE, PROPERTY_TOPIA_CREATE_DATE, PROPERTY_TOPIA_ID, PROPERTY_TOPIA_VERSION, TOPIA_CREATE_DATE, TOPIA_ID, TOPIA_VERSION| Constructor and Description |
|---|
AbstractTopiaEntity() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPostReadListener(PropertyChangeListener listener) |
void |
addPostReadListener(String propertyName,
PropertyChangeListener listener) |
void |
addPostWriteListener(PropertyChangeListener listener) |
void |
addPostWriteListener(String propertyName,
PropertyChangeListener listener) |
void |
addPreReadListener(String propertyName,
VetoableChangeListener listener) |
void |
addPreReadListener(VetoableChangeListener listener) |
void |
addPreWriteListener(String propertyName,
VetoableChangeListener listener) |
void |
addPreWriteListener(VetoableChangeListener listener) |
void |
addPropertyChangeListener(PropertyChangeListener listener) |
void |
addPropertyChangeListener(String property,
PropertyChangeListener listener) |
boolean |
equals(Object obj) |
protected void |
fireOnPostRead(String propertyName,
int index,
Object value) |
protected void |
fireOnPostRead(String propertyName,
Object value) |
protected void |
fireOnPostWrite(String propertyName,
int index,
Object oldValue,
Object newValue) |
protected void |
fireOnPostWrite(String propertyName,
Object oldValue,
Object newValue) |
protected void |
fireOnPreRead(String propertyName,
Object value) |
protected void |
fireOnPreWrite(String propertyName,
Object oldValue,
Object newValue) |
protected TopiaFiresSupport |
getFiresSupport() |
protected TopiaFiresSupport |
getFiresSupportOrNull() |
protected PropertyChangeSupport |
getPostReadListeners(boolean create)
Initialize
postReadListeners at first use or after deserialisation. |
protected PropertyChangeSupport |
getPostWriteListeners(boolean create)
Initialize
postWriteListeners at first use or after deserialisation. |
protected VetoableChangeSupport |
getPreReadListeners(boolean create)
Initialize
preReadListeners at first use or after deserialisation. |
protected VetoableChangeSupport |
getPreWriteListeners(boolean create)
Initialize
preWriteListeners at first use or after deserialisation. |
Date |
getTopiaCreateDate()
Technical date creation of the entity.
|
String |
getTopiaId()
Unique technical Id of the entity.
|
long |
getTopiaVersion()
Technical property to keep versionning of the entity.
|
int |
hashCode()
We are using the
topiaCreateDate for the hashCode because it does not change through time. |
boolean |
isDeleted() |
boolean |
isPersisted()
This method must be used to know if the current entity is present on the persistent support.
|
void |
notifyDeleted()
Notifies the current entity instance than it has been removed from the persistent support.
|
void |
removePostReadListener(PropertyChangeListener listener) |
void |
removePostReadListener(String propertyName,
PropertyChangeListener listener) |
void |
removePostWriteListener(PropertyChangeListener listener) |
void |
removePostWriteListener(String propertyName,
PropertyChangeListener listener) |
void |
removePreReadListener(String propertyName,
VetoableChangeListener listener) |
void |
removePreReadListener(VetoableChangeListener listener) |
void |
removePreWriteListener(String propertyName,
VetoableChangeListener listener) |
void |
removePreWriteListener(VetoableChangeListener listener) |
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
removePropertyChangeListener(String property,
PropertyChangeListener listener) |
void |
setFiresSupport(TopiaFiresSupport firesSupport) |
void |
setTopiaCreateDate(Date topiaCreateDate)
Set the technical creation
date of the entity. |
void |
setTopiaId(String v)
Set the technical
id of the entity. |
void |
setTopiaVersion(long v)
Set the technical
version of the entity. |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitacceptprotected static final TopiaFiresSupport DEFAULT_INSTANCE
protected String topiaId
protected long topiaVersion
protected Date topiaCreateDate
protected transient boolean deleted
protected transient WeakReference<TopiaFiresSupport> firesSupport
TopiaPersistenceContext instance, thus its
life cycle may be shorter than the entity. This is why it is kept as a WeakReference.
If not present, the entity will use the DEFAULT_INSTANCE as a fallback TopiaFiresSupport.protected transient VetoableChangeSupport preReadListeners
protected transient PropertyChangeSupport postReadListeners
protected transient VetoableChangeSupport preWriteListeners
protected transient PropertyChangeSupport postWriteListeners
public void setFiresSupport(TopiaFiresSupport firesSupport)
protected TopiaFiresSupport getFiresSupportOrNull()
protected TopiaFiresSupport getFiresSupport()
protected PropertyChangeSupport getPostReadListeners(boolean create)
postReadListeners at first use or after deserialisation.create - indicates if the PropertyChangeSupport can be created if it does not existprotected PropertyChangeSupport getPostWriteListeners(boolean create)
postWriteListeners at first use or after deserialisation.create - indicates if the PropertyChangeSupport can be created if it does not existprotected VetoableChangeSupport getPreReadListeners(boolean create)
preReadListeners at first use or after deserialisation.create - indicates if the VetoableChangeSupport can be created if it does not existprotected VetoableChangeSupport getPreWriteListeners(boolean create)
preWriteListeners at first use or after deserialisation.create - indicates if the VetoableChangeSupport can be created if it does not existpublic String getTopiaId()
TopiaEntitygetTopiaId in interface TopiaEntitypublic void setTopiaId(String v)
TopiaEntityid of the entity. Make sure to use this method only for copy. The technical id is
generated by ToPIA when the entity is persisted using the TopiaDao.create()
methods.setTopiaId in interface TopiaEntityv - technical id to setpublic long getTopiaVersion()
TopiaEntitygetTopiaVersion in interface TopiaEntitypublic void setTopiaVersion(long v)
TopiaEntityversion of the entity. Make sure to use this method only for copy. The version is
automatically incremented on entity changes.setTopiaVersion in interface TopiaEntityv - technical version to setpublic Date getTopiaCreateDate()
TopiaEntityTopiaDao.create() methods.getTopiaCreateDate in interface TopiaEntitypublic void setTopiaCreateDate(Date topiaCreateDate)
TopiaEntitydate of the entity. Make sure to use this method only for copy. This date is
immutable and was created on entity creation.setTopiaCreateDate in interface TopiaEntitytopiaCreateDate - technical create date to setpublic boolean isPersisted()
TopiaEntityisPersisted in interface TopiaEntitypublic boolean isDeleted()
isDeleted in interface TopiaEntitypublic void notifyDeleted()
TopiaEntitynotifyDeleted in interface TopiaEntitypublic int hashCode()
topiaCreateDate for the hashCode because it does not change through time.protected void fireOnPostWrite(String propertyName, Object oldValue, Object newValue)
protected void fireOnPostWrite(String propertyName, int index, Object oldValue, Object newValue)
public void addPreReadListener(String propertyName, VetoableChangeListener listener)
public void addPreReadListener(VetoableChangeListener listener)
public void removePreReadListener(String propertyName, VetoableChangeListener listener)
public void removePreReadListener(VetoableChangeListener listener)
public void addPostReadListener(String propertyName, PropertyChangeListener listener)
public void addPostReadListener(PropertyChangeListener listener)
public void removePostReadListener(String propertyName, PropertyChangeListener listener)
public void removePostReadListener(PropertyChangeListener listener)
public void addPreWriteListener(String propertyName, VetoableChangeListener listener)
public void addPreWriteListener(VetoableChangeListener listener)
public void removePreWriteListener(String propertyName, VetoableChangeListener listener)
public void removePreWriteListener(VetoableChangeListener listener)
public void addPostWriteListener(String propertyName, PropertyChangeListener listener)
public void addPostWriteListener(PropertyChangeListener listener)
public void removePostWriteListener(String propertyName, PropertyChangeListener listener)
public void removePostWriteListener(PropertyChangeListener listener)
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String property, PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String property, PropertyChangeListener listener)
Copyright © 2004–2016 CodeLutin. All rights reserved.