File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
hibernate-entitymanager/src/main/java/org/hibernate/jpa/spi Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,11 @@ public TypedQuery<X> setLockMode(javax.persistence.LockModeType lockModeType) {
124
124
throw new IllegalStateException ( "Illegal attempt to set lock mode on a native SQL query" );
125
125
}
126
126
127
- if ( ! isSelectQuery () ) {
128
- throw new IllegalStateException ( "Illegal attempt to set lock mode on a non-SELECT query" );
127
+ if ( ! LockModeType .NONE .equals (lockModeType )) {
128
+ if ( ! isSelectQuery () ) {
129
+ throw new IllegalStateException ( "Illegal attempt to set lock mode on a non-SELECT query" );
130
+ }
129
131
}
130
-
131
132
if ( ! canApplyAliasSpecificLockModeHints () ) {
132
133
throw new IllegalStateException ( "Not a JPAQL/Criteria query" );
133
134
}
You can’t perform that action at this time.
0 commit comments