Class AbstractPersistable<PK extends Serializable>
java.lang.Object
org.springframework.data.jpa.domain.AbstractPersistable<PK>
- Type Parameters:
- PK- the type of the identifier.
- All Implemented Interfaces:
- org.springframework.data.domain.Persistable<PK>
- Direct Known Subclasses:
- AbstractAuditable
@MappedSuperclass
public abstract class AbstractPersistable<PK extends Serializable>
extends Object
implements org.springframework.data.domain.Persistable<PK>
Abstract base class for entities. Allows parameterization of id type, chooses auto-generation and implements
 
equals(Object) and hashCode() based on that id.- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch, Greg Turnquist
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Constructor Details- 
AbstractPersistablepublic AbstractPersistable()
 
- 
- 
Method Details- 
getId- Specified by:
- getIdin interface- org.springframework.data.domain.Persistable<PK extends Serializable>
 
- 
setIdSets the id of the entity.- Parameters:
- id- the id to set
 
- 
isNewpublic boolean isNew()Must beTransientin order to ensure that no JPA provider complains because of a missing setter.- Specified by:
- isNewin interface- org.springframework.data.domain.Persistable<PK extends Serializable>
- See Also:
- 
- Persistable.isNew()
 
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
 
-