Interface Persistable<ID>

Type Parameters:
ID - the type of the identifier
All Known Subinterfaces:
Auditable<U,ID,T>

public interface Persistable<ID>
Simple interface for entities.

Note that methods declared in this interface (getId() and isNew()) become property accessors when implementing this interface in combination with @AccessType(PROPERTY). Either of these can be marked as transient when annotated with @Transient.

Author:
Oliver Gierke, Christoph Strobl, Mark Paluch
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the id of the entity.
    boolean
    Returns if the Persistable is new or was persisted already.
  • Method Details

    • getId

      @Nullable ID getId()
      Returns the id of the entity.
      Returns:
      the id. Can be null.
    • isNew

      boolean isNew()
      Returns if the Persistable is new or was persisted already.
      Returns:
      if true the object is new.