org.springframework.data.jpa.domain
Class AbstractPersistable<PK extends Serializable>
java.lang.Object
org.springframework.data.jpa.domain.AbstractPersistable<PK>
- Type Parameters:
PK - the the of the entity
- All Implemented Interfaces:
- Serializable, Persistable<PK>
- Direct Known Subclasses:
- AbstractAuditable
@MappedSuperclass
public abstract class AbstractPersistable<PK extends Serializable>
- extends Object
- implements 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
- See Also:
- Serialized Form
AbstractPersistable
public AbstractPersistable()
getId
public PK getId()
- Specified by:
getId in interface Persistable<PK extends Serializable>
setId
protected void setId(PK id)
- Sets the id of the entity.
- Parameters:
id - the id to set
isNew
public boolean isNew()
- Specified by:
isNew in interface Persistable<PK extends Serializable>
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object obj)
- Overrides:
equals in class Object
hashCode
public int hashCode()
- Overrides:
hashCode in class Object
Copyright © 2011-2013-2013 SpringSource. All Rights Reserved.