Class AbstractPersistable<P extends Serializable>
- java.lang.Object
-
- de.knightsoftnet.gwtp.spring.shared.data.jpa.domain.AbstractPersistable<P>
-
- Type Parameters:
P- the type of the identifier.
- All Implemented Interfaces:
org.springframework.data.domain.Persistable<P>
- Direct Known Subclasses:
LocalizedEntity
@MappedSuperclass public abstract class AbstractPersistable<P extends Serializable> extends Object implements org.springframework.data.domain.Persistable<P>
Abstract base class for entities. Allows parameterization of id type, chooses auto-generation and implementsequals(Object)andhashCode()based on that id. Based onAbstractPersistablebut with public setter for id, it's required on editor and serializer on client side.- Author:
- Oliver Gierke, Thomas Darimont, Mark Paluch, Manfred Tremmel
-
-
Constructor Summary
Constructors Constructor Description AbstractPersistable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)PgetId()inthashCode()booleanisNew()Must beTransientin order to ensure that no JPA provider complains because of a missing setter.voidsetId(P id)Sets the id of the entity.StringtoString()
-
-
-
Method Detail
-
getId
@Nullable public P getId()
- Specified by:
getIdin interfaceorg.springframework.data.domain.Persistable<P extends Serializable>
-
setId
public void setId(@Nullable P id)Sets the id of the entity.- Parameters:
id- the id to set
-
isNew
public boolean isNew()
Must beTransientin order to ensure that no JPA provider complains because of a missing setter.- Specified by:
isNewin interfaceorg.springframework.data.domain.Persistable<P extends Serializable>- See Also:
Persistable.isNew()
-
-