Package org.hibernate.test.legacy

Examples of org.hibernate.test.legacy.Simple


    log.info("Using function named [" + functionName + "] for 'function as alias' test");
    String query = "select " + functionName + " from Simple as " + functionName + " where " + functionName + ".id = 10";

    Session s = openSession();
    Transaction t = s.beginTransaction();
    Simple simple = new Simple();
    simple.setName("Simple 1");
    s.save( simple, new Long(10) );
    t.commit();
    s.close();

    s = openSession();
View Full Code Here


  }

  public void testCachedQueryOnInsert() throws Exception {
    Session s = openSession();
    Transaction t = s.beginTransaction();
    Simple simple = new Simple();
    simple.setName("Simple 1");
    s.save( simple, new Long(10) );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    Query q = s.createQuery("from Simple s");
    List list = q.setCacheable(true).list();
    assertTrue( list.size()==1 );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    q = s.createQuery("from Simple s");
    list = q.setCacheable(true).list();
    assertTrue( list.size()==1 );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    Simple simple2 = new Simple();
    simple2.setCount(133);
    s.save( simple2, new Long(12) );
    t.commit();
    s.close();

    s = openSession();
View Full Code Here

TOP

Related Classes of org.hibernate.test.legacy.Simple

Copyright © 2018 www.massapicom. 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.