use of org.hibernate.test.hql.StateProvince in project hibernate-orm by hibernate.
the class LongInElementsTest method testLongInElementsByHQL.
@Test
@TestForIssue(jiraKey = "HHH-2166")
@SkipForDialect(value = { SQLServerDialect.class, Oracle8iDialect.class, TeradataDialect.class, SybaseDialect.class }, comment = "this test fails on oracle and ms sql server, for more info, see HHH-1123")
public void testLongInElementsByHQL() {
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
beijing.setIsoCode("100089");
beijing.setName("beijing");
session.persist(beijing);
session.flush();
session.clear();
Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
query.setParameterList("idList", createLotsOfElements());
List list = query.list();
session.flush();
session.clear();
assertEquals(1, list.size());
session.delete(beijing);
t.commit();
session.close();
}
use of org.hibernate.test.hql.StateProvince in project hibernate-orm by hibernate.
the class LongInElementsTest method testLongInElementsByCriteria.
@Test
@TestForIssue(jiraKey = "HHH-2166")
@SkipForDialect(value = { SQLServerDialect.class, Oracle8iDialect.class, TeradataDialect.class, SybaseDialect.class }, comment = "this test fails on oracle and ms sql server, for more info, see HHH-1123")
public void testLongInElementsByCriteria() {
Session session = openSession();
Transaction t = session.beginTransaction();
StateProvince beijing = new StateProvince();
beijing.setIsoCode("100089");
beijing.setName("beijing");
session.persist(beijing);
session.flush();
session.clear();
Criteria criteria = session.createCriteria(StateProvince.class);
criteria.add(Restrictions.in("id", createLotsOfElements()));
List list = criteria.list();
session.flush();
session.clear();
assertEquals(1, list.size());
session.delete(beijing);
t.commit();
session.close();
}
Aggregations