Record Class LockingSqlRewriteResult
java.lang.Object
java.lang.Record
org.hibernate.dialect.lock.spi.LockingSqlRewriteResult
- Record Components:
sql- rewritten SQL forLockingSqlRewriteResult.Outcome.APPLIED, otherwise the unchanged input SQLoutcome- semantic outcome of the rewrite attempt
@SPI
public record LockingSqlRewriteResult(String sql, LockingSqlRewriteResult.Outcome outcome)
extends Record
The immutable outcome of applying pessimistic locking to already-rendered SQL.
Rewriters must distinguish an inapplicable request from one they cannot
safely fulfill. Hibernate may use LockingSqlRewriteResult.Outcome.UNSUPPORTED when deciding whether
to perform follow-on locking; it must not interpret that outcome as
successful locking.
- Since:
- 8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumClassification of the rewrite outcome. -
Constructor Summary
ConstructorsConstructorDescriptionLockingSqlRewriteResult(String sql, LockingSqlRewriteResult.Outcome outcome) Creates a rewrite result. -
Method Summary
Modifier and TypeMethodDescriptionstatic LockingSqlRewriteResultCreates a result for a successfully applied rewrite.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static LockingSqlRewriteResultnotApplicable(String sql) Creates a result for a request which requires no SQL rewrite.outcome()Returns the value of theoutcomerecord component.sql()Returns the value of thesqlrecord component.final StringtoString()Returns a string representation of this record class.static LockingSqlRewriteResultunsupported(String sql) Creates a result for a request which cannot be applied safely.
-
Constructor Details
-
LockingSqlRewriteResult
Creates a rewrite result.
-
-
Method Details
-
applied
Creates a result for a successfully applied rewrite. -
notApplicable
Creates a result for a request which requires no SQL rewrite. -
unsupported
Creates a result for a request which cannot be applied safely. -
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 withObjects::equals(Object,Object). -
sql
-
outcome
-