Package org.minijax.dao
Interface BaseEntity
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
NamedEntity
- All Known Implementing Classes:
DefaultBaseEntity,DefaultNamedEntity
public interface BaseEntity extends Serializable
The BaseEntity class is the abstract base class for all web primitives.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description InstantgetCreatedDateTime()Returns the date/time when the object was created in the database.InstantgetDeletedDateTime()Returns the date/time when the object was last deleted in the database.UUIDgetId()Returns the ID of the object.InstantgetUpdatedDateTime()Returns the date/time when the object was last updated in the database.booleanisDeleted()Returns whether the object is deleted.voidsetDeleted(boolean deleted)voidsetId(UUID id)static <T extends BaseEntity>
voidsortByCreatedDateTime(List<T> list)Sorts a list of ID objects by created time (ascending).
-
-
-
Method Detail
-
getId
UUID getId()
Returns the ID of the object.- Returns:
-
setId
void setId(UUID id)
-
getCreatedDateTime
Instant getCreatedDateTime()
Returns the date/time when the object was created in the database.- Returns:
- The created date/time.
-
getUpdatedDateTime
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
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(List<T> list)
Sorts a list of ID objects by created time (ascending).- Parameters:
list- The list of ID objects (modified in place).
-
-