use of org.hibernate.testing.SkipForDialect in project hibernate-orm by hibernate.
the class ASTParserLoadingTest method testPaginationWithPolymorphicQuery.
@Test
@SkipForDialect(value = IngresDialect.class, jiraKey = "HHH-4961", comment = "Ingres does not support this scoping in 9.3")
public void testPaginationWithPolymorphicQuery() {
Session s = openSession();
s.beginTransaction();
Human h = new Human();
h.setName(new Name("Steve", null, "Ebersole"));
s.save(h);
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
List results = s.createQuery("from java.lang.Object").setMaxResults(2).list();
assertEquals(1, results.size());
s.getTransaction().commit();
s.close();
s = openSession();
s.beginTransaction();
s.delete(h);
s.getTransaction().commit();
s.close();
}
use of org.hibernate.testing.SkipForDialect in project hibernate-orm by hibernate.
the class ASTParserLoadingTest method testOneToManyFilter.
@Test
@SkipForDialect(value = IngresDialect.class, jiraKey = "HHH-4976", comment = "Ingres 9.3 does not support sub-selects in the select list")
public void testOneToManyFilter() throws Throwable {
Session session = openSession();
Transaction txn = session.beginTransaction();
Product product = new Product();
product.setDescription("My Product");
product.setNumberAvailable(10);
product.setPrice(new BigDecimal(123));
product.setProductId("4321");
session.save(product);
Customer customer = new Customer();
customer.setCustomerId("123456789");
customer.setName("My customer");
customer.setAddress("somewhere");
session.save(customer);
Order order = customer.generateNewOrder(new BigDecimal(1234));
session.save(order);
LineItem li = order.generateLineItem(product, 5);
session.save(li);
session.flush();
assertEquals(session.createFilter(customer.getOrders(), "").list().size(), 1);
assertEquals(session.createFilter(order.getLineItems(), "").list().size(), 1);
assertEquals(session.createFilter(order.getLineItems(), "where this.quantity > :quantity").setInteger("quantity", 5).list().size(), 0);
session.delete(li);
session.delete(order);
session.delete(product);
session.delete(customer);
txn.commit();
session.close();
}
use of org.hibernate.testing.SkipForDialect in project hibernate-orm by hibernate.
the class ASTParserLoadingTest method testSelectClauseSubselect.
@Test
@SkipForDialect(value = IngresDialect.class, jiraKey = "HHH-4973", comment = "Ingres 9.3 does not support sub-selects in the select list")
@SuppressWarnings({ "unchecked" })
public void testSelectClauseSubselect() {
Session s = openSession();
Transaction t = s.beginTransaction();
Zoo zoo = new Zoo();
zoo.setName("Melbourne Zoo");
zoo.setMammals(new HashMap());
zoo.setAnimals(new HashMap());
Mammal plat = new Mammal();
plat.setBodyWeight(11f);
plat.setDescription("Platypus");
plat.setZoo(zoo);
plat.setSerialNumber("plat123");
zoo.getMammals().put("Platypus", plat);
zoo.getAnimals().put("plat123", plat);
s.persist(plat);
s.persist(zoo);
s.createQuery("select (select max(z.id) from a.zoo z) from Animal a").list();
s.createQuery("select (select max(z.id) from a.zoo z where z.name=:name) from Animal a").setParameter("name", "Melbourne Zoo").list();
s.delete(plat);
s.delete(zoo);
t.commit();
s.close();
}
use of org.hibernate.testing.SkipForDialect in project hibernate-orm by hibernate.
the class ASTParserLoadingTest method testParameterMixing.
@Test
@SkipForDialect(value = CUBRIDDialect.class, comment = "As of version 8.4.1 CUBRID does not support temporary tables." + " This test somehow calls MultiTableDeleteExecutor which raises an" + " exception saying 'cannot doAfterTransactionCompletion multi-table" + " deletes using dialect not supporting temp tables'.")
public void testParameterMixing() {
Session s = openSession();
Transaction t = s.beginTransaction();
s.createQuery("from Animal a where a.description = ? and a.bodyWeight = ? or a.bodyWeight = :bw").setString(0, "something").setFloat(1, 12345f).setFloat("bw", 123f).list();
t.commit();
s.close();
}
use of org.hibernate.testing.SkipForDialect in project hibernate-orm by hibernate.
the class BulkManipulationTest method testTempTableGenerationIsolation.
@Test
@SkipForDialect(value = CUBRIDDialect.class, comment = "As of verion 8.4.1 CUBRID doesn't support temporary tables. This test fails with" + "HibernateException: cannot doAfterTransactionCompletion multi-table deletes using dialect not supporting temp tables")
public void testTempTableGenerationIsolation() throws Throwable {
Session s = openSession();
s.beginTransaction();
Truck truck = new Truck();
truck.setVin("123t");
truck.setOwner("Steve");
s.save(truck);
// manually flush the session to ensure the insert happens
s.flush();
// now issue a bulk delete against Car which should force the temp table to be
// created. we need to test to ensure that this does not cause the transaction
// to be committed...
s.createQuery("delete from Vehicle").executeUpdate();
s.getTransaction().rollback();
s.close();
s = openSession();
s.beginTransaction();
List list = s.createQuery("from Car").list();
assertEquals("temp table gen caused premature commit", 0, list.size());
s.createQuery("delete from Car").executeUpdate();
s.getTransaction().rollback();
s.close();
}
Aggregations