List of usage examples for org.hibernate SQLQuery setLockOptions
@Override NativeQuery<T> setLockOptions(LockOptions lockOptions);
From source file:ch.algotrader.dao.AbstractDao.java
License:Open Source License
protected SQLQuery prepareSQLQuery(final LockOptions lockOptions, final String queryString, final int maxResults) { Session currentSession = getCurrentSession(); SQLQuery query = currentSession.createSQLQuery(queryString); if (lockOptions != null) { query.setLockOptions(lockOptions); }//from w w w . ja v a 2s.c o m if (maxResults > 0) { query.setMaxResults(maxResults); } return query; }
From source file:ch.algotrader.dao.AbstractDao.java
License:Open Source License
protected SQLQuery prepareSQLQuery(final LockOptions lockOptions, final String queryString, final int maxResults, final Object... params) { Session currentSession = getCurrentSession(); SQLQuery query = currentSession.createSQLQuery(queryString); if (lockOptions != null) { query.setLockOptions(lockOptions); }// w w w .j av a 2 s. c om if (maxResults > 0) { query.setMaxResults(maxResults); } applyParameters(query, params); return query; }
From source file:ch.algotrader.dao.AbstractDao.java
License:Open Source License
protected SQLQuery prepareSQLQuery(final LockOptions lockOptions, final String queryString, final int maxResults, final NamedParam... params) { Session currentSession = getCurrentSession(); SQLQuery query = currentSession.createSQLQuery(queryString); if (lockOptions != null) { query.setLockOptions(lockOptions); }/*from w ww .j a v a2s.com*/ if (maxResults > 0) { query.setMaxResults(maxResults); } applyParameters(query, params); return query; }