mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-26 05:14:57 +00:00
HHH-8563 - javax.persistence.Query#getLockMode should throw ISE in some cases
This commit is contained in:
parent
0d7854a15d
commit
f79271d60e
@ -139,7 +139,16 @@ public TypedQuery<X> setLockMode(javax.persistence.LockModeType lockModeType) {
|
||||
|
||||
@Override
|
||||
public javax.persistence.LockModeType getLockMode() {
|
||||
getEntityManager().checkOpen( false );
|
||||
checkOpen( false );
|
||||
|
||||
if ( isNativeSqlQuery() ) {
|
||||
throw new IllegalStateException( "Illegal attempt to set lock mode on a native SQL query" );
|
||||
}
|
||||
|
||||
if ( ! isSelectQuery() ) {
|
||||
throw new IllegalStateException( "Illegal attempt to set lock mode on a non-SELECT query" );
|
||||
}
|
||||
|
||||
return jpaLockMode;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user