Package org.hibernate.classic

Examples of org.hibernate.classic.Session.connection()


    assertNotNull(values[0]);
    assertNotNull(values[1]);
    assertTrue("wrong type: " + values[0].getClass(), values[0] instanceof Category);
    assertTrue("wrong type: " + values[1].getClass(), values[1] instanceof Assignable);
   
    s.connection().commit();
    s.close();

  }

  public void testPropertyResultSQL() throws HibernateException, SQLException {
View Full Code Here


    l.add(c);
    assn.setCategories(l);
    c.setAssignable(assn);
    s.save(assn);
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();

    Query query = s.getNamedQuery("nonaliasedsql");
View Full Code Here

    List list = query.list();
        assertNotNull(list);
   
    assertTrue(list.get(0) instanceof Category);
   
    s.connection().commit();
    s.close();

  }
 
  public void testFindBySQLMultipleObject() throws HibernateException, SQLException {
View Full Code Here

  public void testFindBySQLMultipleObject() throws HibernateException, SQLException {
    Session s = openSession();
    s.delete("from Assignable");
    s.delete("from Category");
    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    Category c = new Category();
    c.setName("NAME");
    Assignable assn = new Assignable();
View Full Code Here

    assn = new Assignable();
    assn.setId("i.d.3");
    s.save(assn);
    s.flush();
    s.connection().commit();
    s.close();

    if ( getDialect() instanceof MySQLDialect ) return;

    s = openSession();
View Full Code Here

    s = openSession();
    List list = s.createSQLQuery("select {category.*}, {assignable.*} from category {category}, \"assign-able\" {assignable}", new String[] { "category", "assignable" }, new Class[] { Category.class, Assignable.class }).list();

    assertTrue(list.size() == 6); // crossproduct of 2 categories x 3 assignables
    assertTrue(list.get(0) instanceof Object[]);
    s.connection().commit();
    s.close();
  }

  public void testFindBySQLParameters() throws HibernateException, SQLException {
    Session s = openSession();
View Full Code Here

  public void testFindBySQLParameters() throws HibernateException, SQLException {
    Session s = openSession();
    s.delete("from Assignable");
    s.delete("from Category");
    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    Category c = new Category();
    c.setName("Good");
    Assignable assn = new Assignable();
View Full Code Here

    assn = new Assignable();
    assn.setId("i.d.3");
    s.save(assn);
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
    Query basicParam = s.createSQLQuery("select {category.*} from category {category} where {category}.name = 'Best'", "category", Category.class);
    List list = basicParam.list();
View Full Code Here

    namedParam.setString("firstCat", "Better");
    namedParam.setString("secondCat", "Best");
    list = namedParam.list();
    assertEquals(2, list.size());

    s.connection().commit();
    s.close();
  }

  public void testEscapedJDBC() throws HibernateException, SQLException {
    if (
View Full Code Here

        }
    List list = query.list();

    assertNotNull(list);
    assertEquals(1, list.size());
    session.connection().commit();
    session.close();
  }

  public void testDoubleAliasing() throws HibernateException, SQLException
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.