org.springframework.batch.core

## Class JobInstance

- java.lang.Object
- - org.springframework.batch.core.Entity
  - - org.springframework.batch.core.JobInstance

- All Implemented Interfaces:
    java.io.Serializable, javax.batch.runtime.JobInstance

      public class JobInstance
      extends Entity
      implements javax.batch.runtime.JobInstance

  Batch domain object representing a uniquely identifiable job run. JobInstance can be restarted multiple times in case of execution failure and it's lifecycle ends with first successful execution. Trying to execute an existing JobInstance that has already completed successfully will result in error. Error will be raised also for an attempt to restart a failed JobInstance if the Job is not restartable.
  Author:
    Lucas Ward, Dave Syer, Robert Kasanicky, Michael Minella, Mahmoud Ben Hassine
  See Also:
    `Job`, `JobParameters`, `JobExecution`, `JobInstance`, Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobInstance(java.lang.Long id, java.lang.String jobName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getInstanceId()`
    `java.lang.String` | `getJobName()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.springframework.batch.core.Entity

      `equals, getId, getVersion, hashCode, incrementVersion, setId, setVersion`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### JobInstance

          public JobInstance(java.lang.Long id,
                             java.lang.String jobName)

  - ### Method Detail

    - #### getJobName

          public java.lang.String getJobName()

      Specified by:
        `getJobName` in interface `javax.batch.runtime.JobInstance`
      Returns:
        the job name. (Equivalent to getJob().getName())

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `Entity`

    - #### getInstanceId

          public long getInstanceId()

      Specified by:
        `getInstanceId` in interface `javax.batch.runtime.JobInstance`