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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanEnforces overriding in entity classes based on equality.getId()Retrieves the identifier of the entity.abstract inthashCode()Enforces overriding in entity classes based on equality.voidSets the identifier of the entity.abstract StringtoString()Enforces overriding in entity classes based on descriptiveness.
-
Field Details
-
ID_MONGODB
Field name used in a MongoDB database to access theidattribute.- See Also:
-
ID_POSTGRESQL
Field name used in a PostgreSQL database to access theidattribute.- 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
UUIDof 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.
-