Package org.hibernate.classic

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


    j = (J) s.get(J.class, jid);
    i = (I) s.get(I.class, iid);
    s.delete(j);
    s.delete(i);
    s.flush();
    s.connection().commit();
    s.close();

  }
}
View Full Code Here


    j.setType( 'x' );
    j.setAmount( 1.0f );
    Serializable iid = s.save(i);
    Serializable jid = s.save(j);
    s.flush();
    s.connection().commit();
    s.close();

    getSessions().evict(I.class);

    s = getSessions().openSession();
View Full Code Here

    i = (I) s.get(I.class, iid);
    assertTrue( i.getClass()==I.class );
    j.setAmount( 0.5f );
    s.lock(i, LockMode.UPGRADE);
    s.flush();
    s.connection().commit();
    s.close();

    getSessions().evict(I.class);

    s = getSessions().openSession();
View Full Code Here

    i = (I) s.get(I.class, iid);
    assertTrue( i.getClass()==I.class );
    j.setAmount( 0.5f );
    s.lock(i, LockMode.UPGRADE);
    s.flush();
    s.connection().commit();
    s.close();

    getSessions().evict(I.class);

    s = getSessions().openSession();
View Full Code Here

    assertTrue( s.createQuery( "from I" ).list().size()==2 );
    assertTrue( s.createQuery( "from J" ).list().size()==1 );
    assertTrue( s.createQuery( "from J j where j.amount > 0 and j.name is not null" ).list().size()==1 );
    assertTrue( s.createQuery( "from I i where i.class = org.hibernate.test.legacy.I" ).list().size()==1 );
    assertTrue( s.createQuery( "from I i where i.class = J" ).list().size()==1 );
    s.connection().commit();
    s.close();

    getSessions().evict(I.class);

    s = getSessions().openSession();
View Full Code Here

    K k = new K();
    Serializable kid = s.save(k);
    i.setParent(k);
    j.setParent(k);
    s.flush();
    s.connection().commit();
    s.close();

    getSessions().evict(I.class);

    s = getSessions().openSession();
View Full Code Here

    session.createSQLQuery("select {category.*} from category {category}", "category", Category.class).list();
    session.createSQLQuery("select {simple.*} from Simple {simple}", "simple", Simple.class).list();
    session.createSQLQuery("select {a.*} from TA {a}", "a", A.class).list();

    session.connection().commit();
    session.close();

  }

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

      query = session.createSQLQuery("select {category.*} from category {category} where {category}.name in :names", "category", Category.class);
      query.setParameterList("names", str);     
      query.uniqueResult();

      session.connection().commit();
      session.close();
     
     

    }
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();
    List list = s.createSQLQuery("select {category.*} from category {category}", "category", Category.class).list();
    list.get(0);
View Full Code Here

    s.close();

    s = openSession();
    List list = s.createSQLQuery("select {category.*} from category {category}", "category", Category.class).list();
    list.get(0);
    s.connection().commit();
    s.close();
   
    if ( getDialect() instanceof MySQLDialect ) return;

    s = openSession();
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.