Record Class ParameterLimits
java.lang.Object
java.lang.Record
org.hibernate.dialect.jdbc.spi.ParameterLimits
- Record Components:
inExpressionCountLimit- the maximum number of elements in oneINexpression, or a nonpositive value for no limitparameterCountLimit- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ParameterLimitsNo limit on eitherIN-expression elements or statement parameters. -
Constructor Summary
ConstructorsConstructorDescriptionParameterLimits(int inExpressionCountLimit, int parameterCountLimit) Creates an instance of aParameterLimitsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of theinExpressionCountLimitrecord component.static ParameterLimitsof(int limit) Create a profile which applies the same limit to both dimensions.intReturns the value of theparameterCountLimitrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
UNLIMITED
No limit on eitherIN-expression elements or statement parameters.
-
-
Constructor Details
-
ParameterLimits
public ParameterLimits(int inExpressionCountLimit, int parameterCountLimit) Creates an instance of aParameterLimitsrecord class.- Parameters:
inExpressionCountLimit- the value for theinExpressionCountLimitrecord componentparameterCountLimit- the value for theparameterCountLimitrecord component
-
-
Method Details
-
of
Create a profile which applies the same limit to both dimensions.- Parameters:
limit- the shared limit, or a nonpositive value for no limit- Returns:
UNLIMITEDfor a nonpositive limit, or a profile containing the shared positive limit
-
toString
-
hashCode
-
equals
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 thecomparemethod from their corresponding wrapper classes. -
inExpressionCountLimit
public int inExpressionCountLimit()Returns the value of theinExpressionCountLimitrecord component.- Returns:
- the value of the
inExpressionCountLimitrecord component
-
parameterCountLimit
public int parameterCountLimit()Returns the value of theparameterCountLimitrecord component.- Returns:
- the value of the
parameterCountLimitrecord component
-