Package org.springframework.batch.core
Class Entity
java.lang.Object
org.springframework.batch.core.Entity
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
JobExecution
,JobInstance
,StepExecution
Batch Domain Entity class. Any class that should be uniquely identifiable from another
should subclass from Entity. See Domain Driven Design, by Eric Evans, for more
information on this pattern and the difference between Entities and Value Objects.
- Author:
- Lucas Ward, Dave Syer, Mahmoud Ben Hassine
- See Also:
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Entity
public Entity(long id) The constructor for theEntity
where the ID is established.- Parameters:
id
- The ID for the entity.
-
-
Method Details
-
getId
public long getId()- Returns:
- The ID associated with the
Entity
.
-
getVersion
- Returns:
- the version.
-
setVersion
Public setter for the version. Needed only by repository methods.- Parameters:
version
- The version to set.
-
incrementVersion
public void incrementVersion()Increment the version number. -
toString
Creates a string representation of theEntity
, including theid
,version
, and class name. -
equals
-
hashCode
public int hashCode()
-