Package org.springframework.data.domain
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
-
Method Details
-
getId
Returns the id of the entity.- Returns:
- the id. Can be null.
-
isNew
boolean isNew()Returns if thePersistable
is new or was persisted already.- Returns:
- if true the object is new.
-