List of usage examples for org.hibernate Criteria setLockMode
public Criteria setLockMode(LockMode lockMode);
From source file:org.kaaproject.kaa.server.common.dao.impl.sql.HibernateAbstractDao.java
License:Apache License
protected T findOneByCriterionWithLock(Criterion criterion, LockMode lockMode) { String className = getSimpleClassName(); LOG.trace("Searching {} entity by criterion [{}] ", className, criterion); Criteria criteria = getCriteria(); criteria.setLockMode(lockMode); criteria.add(criterion);/* w w w . ja va 2 s. c om*/ return (T) criteria.uniqueResult(); }