# Record Class PSBatchParameter

java.lang.Object
java.lang.Record
org.apache.cayenne.access.jdbc.PSBatchParameter

public record PSBatchParameter(Object[] values, int psPosition, int psType, int psScale, DbAttribute attribute) extends Record
An immutable batch parameter corresponding to a single PreparedStatement placeholder, carrying the values of all batch rows for that placeholder alongside the static position and column metadata. The value of a given row is resolved via `getValue(int)`.

A value may be a `DeferredValue`, e.g. when it comes from a generated key of another row in the same transaction. Deferred values are resolved when the corresponding row is bound, i.e. after the rows preceding it have been executed.

Since:
  5.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PSBatchParameter(Object[] values, int psPosition, int psType, int psScale, DbAttribute attribute)`
  Creates an instance of a `PSBatchParameter` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `DbAttribute`
  `attribute()`
  Returns the value of the `attribute` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `Object`
  `getValue(int row)`
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `int`
  `psPosition()`
  Returns the value of the `psPosition` record component.
  `int`
  `psScale()`
  Returns the value of the `psScale` record component.
  `int`
  `psType()`
  Returns the value of the `psType` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `Object[]`
  `values()`
  Returns the value of the `values` record component.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### PSBatchParameter

    public PSBatchParameter(Object[] values, int psPosition, int psType, int psScale, DbAttribute attribute)
    Creates an instance of a `PSBatchParameter` record class.
    Parameters:
      `values` - the value for the `values` record component
      `psPosition` - the value for the `psPosition` record component
      `psType` - the value for the `psType` record component
      `psScale` - the value for the `psScale` record component
      `attribute` - the value for the `attribute` record component

- ## Method Details

  - ### getValue

    public Object getValue(int row)

  - ### toString

    public final String toString()
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### hashCode

    public final int hashCode()
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with `Objects::equals(Object,Object)`; primitive components are compared with the `compare` method from their corresponding wrapper classes.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### values

    public Object[] values()
    Returns the value of the `values` record component.
    Returns:
      the value of the `values` record component

  - ### psPosition

    public int psPosition()
    Returns the value of the `psPosition` record component.
    Returns:
      the value of the `psPosition` record component

  - ### psType

    public int psType()
    Returns the value of the `psType` record component.
    Returns:
      the value of the `psType` record component

  - ### psScale

    public int psScale()
    Returns the value of the `psScale` record component.
    Returns:
      the value of the `psScale` record component

  - ### attribute

    public DbAttribute attribute()
    Returns the value of the `attribute` record component.
    Returns:
      the value of the `attribute` record component