类 Entity
- java.lang.Object
- org.springframework.batch.core.Entity
- 所有已实现的接口:
java.io.Serializable
- 直接已知子类:
JobExecution
,JobInstance
,StepExecution
public class Entity extends java.lang.Object implements java.io.Serializable
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.- 作者:
- Lucas Ward, Dave Syer
- 另请参阅:
- 序列化表格
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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 numbervoid
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()
方法详细资料
getId
public java.lang.Long getId()
setId
public void setId(java.lang.Long id)
getVersion
public java.lang.Integer getVersion()
- 返回:
- the version
setVersion
public void setVersion(java.lang.Integer version)
Public setter for the version needed only by repository methods.- 参数:
version
- the version to set
incrementVersion
public void incrementVersion()
Increment the version number
toString
public java.lang.String toString()
- 覆盖:
toString
在类中java.lang.Object
equals
public boolean equals(java.lang.Object other)
Attempt to establish identity based on id if both exist. If either id does not exist use Object.equals().- 覆盖:
equals
在类中java.lang.Object
- 另请参阅:
Object.equals(java.lang.Object)
hashCode
public int hashCode()
Use ID if it exists to establish hash code, otherwise fall back to Object.hashCode(). Based on the same information as equals, so if that changes, this will. N.B. this follows the contract of Object.hashCode(), but will cause problems for anyone adding an unsavedEntity
to a Set because Set.contains() will almost certainly return false for theEntity
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
在类中java.lang.Object
- 另请参阅:
Object.hashCode()