mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-27 22:39:13 +00:00
Fix SessionImpl#buildLockOptions causing NPE
This commit is contained in:
parent
9ba18b8c5d
commit
3e3db6d352
@ -2919,12 +2919,15 @@ public void refresh(Object entity, LockModeType lockModeType, Map<String, Object
|
|||||||
}
|
}
|
||||||
|
|
||||||
private LockOptions buildLockOptions(LockModeType lockModeType, Map<String, Object> properties) {
|
private LockOptions buildLockOptions(LockModeType lockModeType, Map<String, Object> properties) {
|
||||||
final LockOptions output = this.lockOptions.makeCopy();
|
LockOptions lockOptions = new LockOptions();
|
||||||
output.setLockMode( LockModeTypeHelper.getLockMode( lockModeType ) );
|
if ( this.lockOptions != null ) { //otherwise the default LockOptions constructor is the same as DEFAULT_LOCK_OPTIONS
|
||||||
if ( properties != null ) {
|
LockOptions.copy( this.lockOptions, lockOptions );
|
||||||
LockOptionsHelper.applyPropertiesToLockOptions( properties, () -> output );
|
|
||||||
}
|
}
|
||||||
return output;
|
lockOptions.setLockMode( LockModeTypeHelper.getLockMode( lockModeType ) );
|
||||||
|
if ( properties != null ) {
|
||||||
|
LockOptionsHelper.applyPropertiesToLockOptions( properties, () -> lockOptions );
|
||||||
|
}
|
||||||
|
return lockOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user