|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.core.Entity
public class Entity
Batch Domain Entity class. Any class that should be uniquely identifiable from another should subclass from Entity. More information on this pattern and the difference between Entities and Value Objects can be found in Domain Driven Design by Eric Evans.
Constructor Summary | |
---|---|
Entity()
|
|
Entity(Long id)
|
Method Summary | |
---|---|
boolean |
equals(Object other)
Attempt to establish identity based on id if both exist. |
Long |
getId()
|
Integer |
getVersion()
|
int |
hashCode()
Use ID if it exists to establish hash code, otherwise fall back to Object.hashCode(). |
void |
incrementVersion()
Increment the version number |
void |
setId(Long id)
|
void |
setVersion(Integer version)
Public setter for the version needed only by repository methods. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Entity()
public Entity(Long id)
Method Detail |
---|
public Long getId()
public void setId(Long id)
public Integer getVersion()
public void setVersion(Integer version)
version
- the version to setpublic void incrementVersion()
public String toString()
toString
in class Object
public boolean equals(Object other)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
Entity
to a
Set because Set.contains() will almost certainly return false for the
Entity
after it is saved. Spring Batch does not store any of its
entities in Sets as a matter of course, so internally this is consistent.
Clients should not be exposed to unsaved entities.
hashCode
in class Object
Object.hashCode()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |