Package org.nuiton.topia.persistence
Interface TopiaEntity
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
TopiaEntityContextable
- All Known Implementing Classes:
AbstractTopiaEntity
The TopiaEntity is the main interface for each generated entity.
An entity is just a persistent bean mapped with Hibernate. The manipulation on entities (create, update, delete,
find) is made by the associated TopiaDao.
- Author:
- Benjamin Poussin - poussin@codelutin.com, Florian Desbois- fdebois@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated.since 3.0, will be removed in 3.1, unusedstatic final StringDeprecated.since 3.0, will be removed in 3.1, unusedstatic final Stringstatic final Stringstatic final Stringstatic final StringDeprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_CREATE_DATEinsteadstatic final StringDeprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_IDinsteadstatic final StringDeprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_VERSIONinstead -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(TopiaEntityVisitor visitor) Route the entity using avisitor.Technical date creation of the entity.Unique technical Id of the entity.longTechnical property to keep versionning of the entity.booleanbooleanThis method must be used to know if the current entity is present on the persistent support.voidNotifies the current entity instance than it has been removed from the persistent support.voidsetTopiaCreateDate(Date date) Set the technical creationdateof the entity.voidsetTopiaId(String id) Set the technicalidof the entity.voidsetTopiaVersion(long version) Set the technicalversionof the entity.
-
Field Details
-
PROPERTY_TOPIA_ID
- See Also:
-
TOPIA_ID
Deprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_IDinstead- See Also:
-
PROPERTY_TOPIA_CREATE_DATE
- See Also:
-
TOPIA_CREATE_DATE
Deprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_CREATE_DATEinstead- See Also:
-
PROPERTY_TOPIA_VERSION
- See Also:
-
TOPIA_VERSION
Deprecated.since 3.0, will be removed in 3.1, usePROPERTY_TOPIA_VERSIONinstead- See Also:
-
COMPOSITE
Deprecated.since 3.0, will be removed in 3.1, unused- See Also:
-
AGGREGATE
Deprecated.since 3.0, will be removed in 3.1, unused- See Also:
-
-
Method Details
-
getTopiaId
String getTopiaId()Unique technical Id of the entity. This id contains the fully qualified name of the entity interface. This id also has an index and is used to uniquely identify the entity in the database.- Returns:
- the technical Id of the entity
-
setTopiaId
Set the technicalidof the entity. Make sure to use this method only for copy. The technical id is generated by ToPIA when the entity is persisted using theTopiaDao.create()methods.- Parameters:
id- technical id to set
-
getTopiaVersion
long getTopiaVersion()Technical property to keep versionning of the entity. The version is incremented on each change of the entity.- Returns:
- the current version of the entity
-
setTopiaVersion
void setTopiaVersion(long version) Set the technicalversionof the entity. Make sure to use this method only for copy. The version is automatically incremented on entity changes.- Parameters:
version- technical version to set
-
getTopiaCreateDate
Date getTopiaCreateDate()Technical date creation of the entity. This date doesn't change through time and was initialized on entity creation when using theTopiaDao.create()methods.- Returns:
- the creation date of the entity
-
setTopiaCreateDate
Set the technical creationdateof the entity. Make sure to use this method only for copy. This date is immutable and was created on entity creation.- Parameters:
date- technical create date to set
-
isPersisted
boolean isPersisted()This method must be used to know if the current entity is present on the persistent support. If the entity is not yet persisted or if the entity has been removed, this method will return false.- Returns:
- true if the entity is persisted and not yet deleted
- Since:
- 3.0
-
isDeleted
boolean isDeleted()- Returns:
- Is the entity was removed from persistent support ?
- Since:
- 3.0
-
notifyDeleted
void notifyDeleted()Notifies the current entity instance than it has been removed from the persistent support.- Since:
- 3.0
-
accept
Route the entity using avisitor.- Parameters:
visitor- to used
-