public class Entity extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
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() |
public Entity()
public Entity(Long id)
public Long getId()
public void setId(Long id)
public Integer getVersion()
public void setVersion(Integer version)
version
- the version to setpublic void incrementVersion()
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()
Copyright © 2014 Pivotal. All rights reserved.