Package org.nuiton.topia.persistence
Class TopiaEntityAbstract
java.lang.Object
org.nuiton.topia.persistence.TopiaEntityAbstract
- All Implemented Interfaces:
Serializable,TopiaEntity
Classe de base de toutes les entités, cela permet de concentrer le code
technique dans cette classe. L'identifiant peut-etre n'importe quoi Aucune
restriction n'est faite dessus, il peut meme changer entre deux types
d'entité si cela ne pose pas d'autre probleme (heritage entre ces entités).
- Version:
- $Id$
- Author:
- poussin <poussin@codelutin.com>
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PropertyChangeSupportprotected VetoableChangeSupportprotected TopiaContextprotected Dateprotected Stringprotected longprotected PropertyChangeSupportprotected VetoableChangeSupportFields inherited from interface org.nuiton.topia.persistence.TopiaEntity
AGGREGATE, COMPOSITE, TOPIA_CREATE_DATE, TOPIA_ID, TOPIA_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd listener for property writing.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Add listener for property writing.voidaddPropertyListener(PropertyChangeListener listener) Add listener for property reading.voidaddPropertyListener(String propertyName, PropertyChangeListener listener) Add listener for property reading.voidvoidaddVetoableChangeListener(String propertyName, VetoableChangeListener vetoable) voidaddVetoableListener(VetoableChangeListener vetoable) voidaddVetoableListener(String propertyName, VetoableChangeListener vetoable) booleanOn est sur que les objets sont bien les memes car s'il n'ont pas d'id cela veut dire qu'il ne vienne pas de la meme session donc qu'il sont nouveau et different, ou bien qu'ils viennent de la meme session et dans ce cas l'egalite == fonctionne.protected voidfireOnPostRead(String propertyName, int index, Object value) protected voidfireOnPostRead(String propertyName, Object value) protected voidfireOnPostWrite(String propertyName, int index, Object oldValue, Object newValue) protected voidfireOnPostWrite(String propertyName, Object oldValue, Object newValue) protected voidfireOnPreRead(String propertyName, Object value) protected voidfireOnPreWrite(String propertyName, Object oldValue, Object newValue) protected PropertyChangeSupportInitializereadListenersat first use or after deserialisation.protected VetoableChangeSupportInitializereadVetoablesat first use or after deserialisation.Technical date creation of the entity.Unique technical Id of the entity.longTechnical property to keep versionning of the entity.protected PropertyChangeSupportInitializewriteListenersat first use or after deserialisation.protected VetoableChangeSupportInitializewriteVetoablesat first use or after deserialisation.inthashCode()On utilise la date de creation comme hash code, cette date ne varie pas au cours du tempsvoidvoidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) voidremovePropertyListener(PropertyChangeListener listener) voidremovePropertyListener(String propertyName, PropertyChangeListener listener) voidvoidremoveVetoableChangeListener(String propertyName, VetoableChangeListener vetoable) voidremoveVetoableListener(VetoableChangeListener vetoable) voidremoveVetoableListener(String propertyName, VetoableChangeListener vetoable) voidsetTopiaContext(TopiaContext context) voidsetTopiaCreateDate(Date topiaCreateDate) Set the technical creationdateof the entity.voidsetTopiaId(String v) Set the technicalidof the entity.voidsetTopiaVersion(long v) Set the technicalversionof the entity.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuiton.topia.persistence.TopiaEntity
accept
-
Field Details
-
topiaId
-
topiaVersion
protected long topiaVersion -
topiaCreateDate
-
topiaContext
-
readVetoables
-
readListeners
-
writeVetoables
-
writeListeners
-
-
Constructor Details
-
TopiaEntityAbstract
public TopiaEntityAbstract()
-
-
Method Details
-
getReadVetoableChangeSupport
InitializereadVetoablesat first use or after deserialisation.- Returns:
- readVetoables
-
getReadPropertyChangeSupport
InitializereadListenersat first use or after deserialisation.- Returns:
- readListeners
-
getWriteVetoableChangeSupport
InitializewriteVetoablesat first use or after deserialisation.- Returns:
- writeVetoables
-
getWritePropertyChangeSupport
InitializewriteListenersat first use or after deserialisation.- Returns:
- writeListeners
-
getTopiaId
Description copied from interface:TopiaEntityUnique technical Id of the entity. This id contains the full qualified name of the entity interface. This id has also an index and his used to identify uniquely the entity in the database.- Specified by:
getTopiaIdin interfaceTopiaEntity- Returns:
- the technical Id of the entity
-
setTopiaId
Description copied from interface:TopiaEntitySet the technicalidof the entity. Careful, use this method only for copy. The technical id is generated by ToPIA when entity is created usingTopiaDAO.create(Object...).- Specified by:
setTopiaIdin interfaceTopiaEntity- Parameters:
v- technical id to set
-
getTopiaVersion
public long getTopiaVersion()Description copied from interface:TopiaEntityTechnical property to keep versionning of the entity. The version is incremented on each change of the entity.- Specified by:
getTopiaVersionin interfaceTopiaEntity- Returns:
- the current version of the entity
-
setTopiaVersion
public void setTopiaVersion(long v) Description copied from interface:TopiaEntitySet the technicalversionof the entity. Careful, use this method only for copy. The version is automatically incremented on entity changes.- Specified by:
setTopiaVersionin interfaceTopiaEntity- Parameters:
v- technical version to set
-
getTopiaCreateDate
Description copied from interface:TopiaEntityTechnical date creation of the entity. This date doesn't change through time and was initialized on entity creation when usingTopiaDAO.create(Object...).- Specified by:
getTopiaCreateDatein interfaceTopiaEntity- Returns:
- the creation date of the entity
-
setTopiaCreateDate
Description copied from interface:TopiaEntitySet the technical creationdateof the entity. Careful, use this method only for copy. This date is immutable and was created on entity creation.- Specified by:
setTopiaCreateDatein interfaceTopiaEntity- Parameters:
topiaCreateDate- technical create date to set
-
getTopiaContext
-
setTopiaContext
- Parameters:
context- The context to set.- Throws:
TopiaException- if any pb ?
-
getComposite
- Specified by:
getCompositein interfaceTopiaEntity- Returns:
- all object that must be deleted if this object is deleted
- Throws:
TopiaException- if any pb
-
getAggregate
- Specified by:
getAggregatein interfaceTopiaEntity- Returns:
- all object that are aggregate with this instance, aggreate object are not removed automaticaly
- Throws:
TopiaException- if any pb
-
hashCode
public int hashCode()On utilise la date de creation comme hash code, cette date ne varie pas au cours du temps -
equals
On est sur que les objets sont bien les memes car s'il n'ont pas d'id cela veut dire qu'il ne vienne pas de la meme session donc qu'il sont nouveau et different, ou bien qu'ils viennent de la meme session et dans ce cas l'egalite == fonctionne. -
fireOnPreRead
-
fireOnPostRead
-
fireOnPostRead
-
fireOnPreWrite
-
fireOnPostWrite
-
fireOnPostWrite
-
addPropertyChangeListener
Description copied from interface:TopiaEntityAdd listener for property writing.- Specified by:
addPropertyChangeListenerin interfaceTopiaEntity- Parameters:
propertyName- name of property to listenlistener- the listener to register
-
addPropertyChangeListener
Description copied from interface:TopiaEntityAdd listener for property writing.- Specified by:
addPropertyChangeListenerin interfaceTopiaEntity- Parameters:
listener- the listener to register
-
addVetoableChangeListener
- Specified by:
addVetoableChangeListenerin interfaceTopiaEntity
-
addVetoableChangeListener
- Specified by:
addVetoableChangeListenerin interfaceTopiaEntity
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceTopiaEntity
-
removePropertyChangeListener
- Specified by:
removePropertyChangeListenerin interfaceTopiaEntity
-
removeVetoableChangeListener
- Specified by:
removeVetoableChangeListenerin interfaceTopiaEntity
-
removeVetoableChangeListener
- Specified by:
removeVetoableChangeListenerin interfaceTopiaEntity
-
addPropertyListener
Description copied from interface:TopiaEntityAdd listener for property reading.- Specified by:
addPropertyListenerin interfaceTopiaEntity- Parameters:
propertyName- the property name to listenlistener- the listener to register
-
addPropertyListener
Description copied from interface:TopiaEntityAdd listener for property reading.- Specified by:
addPropertyListenerin interfaceTopiaEntity- Parameters:
listener- the listener to register
-
addVetoableListener
- Specified by:
addVetoableListenerin interfaceTopiaEntity
-
addVetoableListener
- Specified by:
addVetoableListenerin interfaceTopiaEntity
-
removePropertyListener
- Specified by:
removePropertyListenerin interfaceTopiaEntity
-
removePropertyListener
- Specified by:
removePropertyListenerin interfaceTopiaEntity
-
removeVetoableListener
- Specified by:
removeVetoableListenerin interfaceTopiaEntity
-
removeVetoableListener
- Specified by:
removeVetoableListenerin interfaceTopiaEntity
-