类 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
    另请参阅:
    序列化表格
    • 构造器概要

      构造器 
      构造器说明
      Entity() 
      Entity​(java.lang.Long id) 
    • 方法概要

      所有方法 实例方法 具体方法 
      修饰符和类型方法说明
      booleanequals​(java.lang.Object other)
      Attempt to establish identity based on id if both exist.
      java.lang.LonggetId() 
      java.lang.IntegergetVersion() 
      inthashCode()
      Use ID if it exists to establish hash code, otherwise fall back to Object.hashCode().
      voidincrementVersion()
      Increment the version number
      voidsetId​(java.lang.Long id) 
      voidsetVersion​(java.lang.Integer version)
      Public setter for the version needed only by repository methods.
      java.lang.StringtoString() 
      • 从类继承的方法 java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 构造器详细资料

      • Entity

        public Entity​(java.lang.Long id)
    • 方法详细资料

      • 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
      • 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 unsaved 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 在类中 java.lang.Object
        另请参阅:
        Object.hashCode()