HHH-8756 relaxed validation on non select queries when lock mode is set to NONE
This commit is contained in:
parent
c4c33943f2
commit
a32b5dfa74
3
hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi/AbstractQueryImpl.java
Normal file → Executable file
3
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 ( ! LockModeType.NONE.equals(lockModeType)) {
|
||||||
if ( ! isSelectQuery() ) {
|
if ( ! isSelectQuery() ) {
|
||||||
throw new IllegalStateException( "Illegal attempt to set lock mode on a non-SELECT query" );
|
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