List of usage examples for org.hibernate BasicQueryContract setFlushMode
@Deprecated
default BasicQueryContract setFlushMode(FlushMode flushMode)
From source file:org.jboss.as.test.compat.jpa.hibernate.transformer.SFSBHibernateSessionFactory.java
License:Open Source License
public FlushMode getFlushModeFromQueryTest(FlushMode flushMode) { FlushMode result;/* w ww. j ava 2 s. c om*/ Session session = sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); try { BasicQueryContract basicQueryContract = session.createQuery("from Student"); if (flushMode != null) { basicQueryContract.setFlushMode(flushMode); } result = basicQueryContract.getFlushMode(); return result; } finally { transaction.rollback(); session.close(); } }