Class BaseEntity
java.lang.Object
io.github.marcopaglio.booking.model.BaseEntity
- Direct Known Subclasses:
Client
,Reservation
Contains the necessary structure of a generic entity.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
Enforces overriding in entity classes based on equality.getId()
Retrieves the identifier of the entity.abstract int
hashCode()
Enforces overriding in entity classes based on equality.void
Sets the identifier of the entity.abstract String
toString()
Enforces overriding in entity classes based on descriptiveness.
-
Field Details
-
ID_MONGODB
Field name used in a MongoDB database to access theid
attribute.- See Also:
-
ID_POSTGRESQL
Field name used in a PostgreSQL database to access theid
attribute.- See Also:
-
-
Constructor Details
-
BaseEntity
protected BaseEntity()Empty constructor.
-
-
Method Details
-
getId
Retrieves the identifier of the entity. Note: UUID Objects are immutable.- Returns:
- the
UUID
of the entity.
-
setId
Sets the identifier of the entity.- Parameters:
id
- the identifier to set.
-
hashCode
public abstract int hashCode()Enforces overriding in entity classes based on equality. -
equals
Enforces overriding in entity classes based on equality. -
toString
Enforces overriding in entity classes based on descriptiveness.
-