JPAUpdateClause query = new JPAUpdateClause(em, user);query.set(user.name, "test").setLockMode(LockModeType.PESSIMISTIC_WRITE);
java.lang.IllegalStateException: Illegal attempt to set lock mode on a non-SELECT query
Throws: IllegalStateException - if the query is found not to be a Java Persistence query language SELECT query or a Criteria API query