|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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(java.lang.Long id)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object other)
Attempt to establish identity based on id if both exist. |
java.lang.Long |
getId()
|
java.lang.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(java.lang.Long id)
|
void |
setVersion(java.lang.Integer version)
Public setter for the version needed only by repository methods. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Entity()
public Entity(java.lang.Long id)
| Method Detail |
|---|
public java.lang.Long getId()
public void setId(java.lang.Long id)
public java.lang.Integer getVersion()
public void setVersion(java.lang.Integer version)
version - the version to setpublic void incrementVersion()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in class java.lang.ObjectObject.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 java.lang.ObjectObject.hashCode()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||