Interface TopiaEntity

All Superinterfaces:
Serializable
All Known Subinterfaces:
TopiaEntityContextable
All Known Implementing Classes:
AbstractTopiaEntity

public interface TopiaEntity extends Serializable

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.

Setter methods have to be used only in internal. They are in the interface to make easier their usages in internal.
Author:
Benjamin Poussin - poussin@codelutin.com, Florian Desbois- fdebois@codelutin.com
  • Field Details

  • 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

      void setTopiaId(String id)
      Set the technical id 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.
      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 technical version of 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 the TopiaDao.create() methods.
      Returns:
      the creation date of the entity
    • setTopiaCreateDate

      void setTopiaCreateDate(Date date)
      Set the technical creation date of 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

      void accept(TopiaEntityVisitor visitor)
      Route the entity using a visitor.
      Parameters:
      visitor - to used