Interface BaseEntity

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
NamedEntity
All Known Implementing Classes:
DefaultBaseEntity, DefaultNamedEntity

public interface BaseEntity
extends java.io.Serializable
The BaseEntity class is the abstract base class for all web primitives.
  • Method Summary

    Modifier and Type Method Description
    java.time.Instant getCreatedDateTime()
    Returns the date/time when the object was created in the database.
    java.time.Instant getDeletedDateTime()
    Returns the date/time when the object was last deleted in the database.
    java.util.UUID getId()
    Returns the ID of the object.
    java.time.Instant getUpdatedDateTime()
    Returns the date/time when the object was last updated in the database.
    boolean isDeleted()
    Returns whether the object is deleted.
    void setDeleted​(boolean deleted)  
    void setId​(java.util.UUID id)  
    static <T extends BaseEntity>
    void
    sortByCreatedDateTime​(java.util.List<T> list)
    Sorts a list of ID objects by created time (ascending).
  • Method Details

    • getId

      java.util.UUID getId()
      Returns the ID of the object.
      Returns:
    • setId

      void setId​(java.util.UUID id)
    • getCreatedDateTime

      java.time.Instant getCreatedDateTime()
      Returns the date/time when the object was created in the database.
      Returns:
      The created date/time.
    • getUpdatedDateTime

      java.time.Instant getUpdatedDateTime()
      Returns the date/time when the object was last updated in the database.
      Returns:
      The updated date/time.
    • isDeleted

      boolean isDeleted()
      Returns whether the object is deleted. Data is never truly deleted from the database. It is the responsibility of all application logic to enforce the deleted flag as appropriate.
      Returns:
      True if the object is deleted.
    • setDeleted

      void setDeleted​(boolean deleted)
    • getDeletedDateTime

      java.time.Instant getDeletedDateTime()
      Returns the date/time when the object was last deleted in the database. Data is never truly deleted from the database. It is the responsibility of all application logic to enforce the deleted flag as appropriate.
      Returns:
      The deleted date/time.
    • sortByCreatedDateTime

      static <T extends BaseEntity> void sortByCreatedDateTime​(java.util.List<T> list)
      Sorts a list of ID objects by created time (ascending).
      Parameters:
      list - The list of ID objects (modified in place).