@SuppressWarnings({"unchecked"}) public TypedQuery<X> setLockMode(javax.persistence.LockModeType lockModeType) { if (!getEntityManager().isTransactionInProgress()) { throw new TransactionRequiredException("no transaction is in progress"); } if (!canApplyLockModes()) { throw new IllegalStateException("Not a JPAQL/Criteria query"); } this.jpaLockMode = lockModeType; ((org.hibernate.impl.QueryImpl) query) .getLockOptions() .setLockMode(LockModeTypeHelper.getLockMode(lockModeType)); return this; }
private static LockMode getLockMode(LockModeType lockMode) { return LockModeTypeHelper.getLockMode(lockMode); }