mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-04 16:59:29 +00:00
HHH-15761 Avoid possible NullPointerException
In AbstractSqlAstTranslator
This commit is contained in:
parent
20e7f1be9c
commit
919e322600
@ -1180,11 +1180,11 @@ protected void visitForUpdateClause(QuerySpec querySpec) {
|
||||
// Since we get here, we know that no alias locks were applied.
|
||||
// We only apply locking on the root query though if there is a global lock mode
|
||||
final LockOptions lockOptions = getLockOptions();
|
||||
final Boolean followOnLocking = getLockOptions() == null ? Boolean.FALSE : lockOptions.getFollowOnLocking();
|
||||
final Boolean followOnLocking = lockOptions == null ? Boolean.FALSE : lockOptions.getFollowOnLocking();
|
||||
if ( Boolean.TRUE.equals( followOnLocking ) ) {
|
||||
this.lockOptions = null;
|
||||
}
|
||||
else if ( lockOptions.getLockMode() != LockMode.NONE ) {
|
||||
else if ( lockOptions != null && lockOptions.getLockMode() != LockMode.NONE ) {
|
||||
final ForUpdateClause forUpdateClause = new ForUpdateClause();
|
||||
forUpdateClause.merge( getLockOptions() );
|
||||
forUpdateClause.applyAliases( getDialect().getWriteRowLockStrategy(), querySpec );
|
||||
|
Loading…
x
Reference in New Issue
Block a user