HHH-8756 relaxed validation on non select queries when lock mode is set to NONE
This commit is contained in:
parent
c4c33943f2
commit
a32b5dfa74
7
hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractQueryImpl.java
Normal file → Executable file
7
hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractQueryImpl.java
Normal file → Executable file
|
@ -124,10 +124,11 @@ public abstract class AbstractQueryImpl<X> extends BaseQueryImpl implements Type
|
||||||
throw new IllegalStateException( "Illegal attempt to set lock mode on a native SQL query" );
|
throw new IllegalStateException( "Illegal attempt to set lock mode on a native SQL query" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! isSelectQuery() ) {
|
if ( ! LockModeType.NONE.equals(lockModeType)) {
|
||||||
throw new IllegalStateException( "Illegal attempt to set lock mode on a non-SELECT query" );
|
if ( ! isSelectQuery() ) {
|
||||||
|
throw new IllegalStateException( "Illegal attempt to set lock mode on a non-SELECT query" );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! canApplyAliasSpecificLockModeHints() ) {
|
if ( ! canApplyAliasSpecificLockModeHints() ) {
|
||||||
throw new IllegalStateException( "Not a JPAQL/Criteria query" );
|
throw new IllegalStateException( "Not a JPAQL/Criteria query" );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue