@Test
public void foobarTest() throws Exception {
try (Session s = openSession()) {
Transaction tx = s.beginTransaction();
EntityA entityA1 = new EntityA();
s.persist(entityA1);
tx.commit();
}
try (Session s = openSession()) {
Transaction tx = s.beginTransaction();
String hql = "select e from org.hibernate.bugs.EntityA e";
Query<EntityA> query = s.createQuery(hql, EntityA.class);
List<EntityA> actual = query.list();
assertThat(actual).hasSize(1);
tx.rollback();
}
}