Record Class ParameterLimits

java.lang.Object
java.lang.Record
org.hibernate.dialect.jdbc.spi.ParameterLimits
Record Components:
inExpressionCountLimit - the maximum number of elements in one IN expression, or a nonpositive value for no limit
parameterCountLimit - the maximum number of JDBC parameters in the complete statement, or a nonpositive value for no limit

@SPI({USE,SUPPLY}) public record ParameterLimits(int inExpressionCountLimit, int parameterCountLimit) extends Record

Immutable limits on JDBC parameters accepted by a database.

The two limits are independent: inExpressionCountLimit applies to one IN expression, while parameterCountLimit applies to the complete JDBC statement. A custom Dialect should return UNLIMITED when neither limit applies, use of(int) when both limits are the same, or invoke the canonical constructor when they differ. Nonpositive values are normalized to 0, the explicit unlimited value.

Since:
8.0
See Also:
  • Field Details

    • UNLIMITED

      public static final ParameterLimits UNLIMITED
      No limit on either IN-expression elements or statement parameters.
  • Constructor Details

    • ParameterLimits

      public ParameterLimits(int inExpressionCountLimit, int parameterCountLimit)
      Creates an instance of a ParameterLimits record class.
      Parameters:
      inExpressionCountLimit - the value for the inExpressionCountLimit record component
      parameterCountLimit - the value for the parameterCountLimit record component
  • Method Details

    • of

      public static ParameterLimits of(int limit)
      Create a profile which applies the same limit to both dimensions.
      Parameters:
      limit - the shared limit, or a nonpositive value for no limit
      Returns:
      UNLIMITED for a nonpositive limit, or a profile containing the shared positive limit
    • 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. All components in this record class 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.
    • inExpressionCountLimit

      public int inExpressionCountLimit()
      Returns the value of the inExpressionCountLimit record component.
      Returns:
      the value of the inExpressionCountLimit record component
    • parameterCountLimit

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