Package org.hibernate.classic

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


    t.commit();

    t = s.beginTransaction();

    s.refresh( human );

    assertEquals( "Update did not execute properly", correctName, human.getName().getFirst() );

    s.createQuery( "delete Human" ).executeUpdate();
    t.commit();
View Full Code Here


    t.commit();

    t = s.beginTransaction();

    s.refresh( human );

    assertEquals( "Update did not execute properly", correctName, human.getName().getFirst() );

    s.createQuery( "delete Human" ).executeUpdate();
    t.commit();
View Full Code Here

    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    c = (Category) s.load(Category.class, id);
    s.refresh(c);
    s.flush();
    assertTrue( c.getSubcategories().size()==1 );
    s.flush();
    s.connection().commit();
    s.close();
View Full Code Here

    b.setClob( s.getLobHelper().createClob("foo/bar/baz") );
    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();
    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
        log.debug("levinson: just bfore b.getClob()");
        b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
View Full Code Here

    s.flush();
    stringList.remove(1);
    feeList.remove(1);
    s.flush();
    s.evict(b);
    s.refresh(b);
    assertTrue( b.getFees().size()==3 );
    stringList = b.getStringList();
    assertTrue(
      stringList.size()==3 &&
      "baz".equals( stringList.get(1) ) &&
View Full Code Here

    Serializable gid = s.save(g);
    s.flush();
    s.clear();
    GlarchProxy gp = (GlarchProxy) s.load(Glarch.class, gid);
    gp.getName(); //force init
    s.refresh(gp);
    s.delete(gp);
    s.flush();
    s.getTransaction().commit();
    s.close();
  }
View Full Code Here

    s.save(b);
    //s.refresh(b);
    //assertTrue( b.getClob() instanceof ClobImpl );
    s.flush();

    s.refresh(b);
    //b.getBlob().setBytes( 2, "abc".getBytes() );
    b.getClob().getSubString(2, 3);
    //b.getClob().setString(2, "abc");
    s.flush();
    s.connection().commit();
View Full Code Here

    s.beginTransaction();
    Foo foo = new Foo();
    s.save(foo);
    s.flush();
    s.connection().createStatement().executeUpdate("update "+getDialect().openQuote()+"foos"+getDialect().closeQuote()+" set long_ = -3");
    s.refresh(foo);
    assertTrue( foo.getLong().longValue()==-3l );
    assertTrue( s.getCurrentLockMode(foo)==LockMode.READ );
    s.refresh(foo, LockMode.UPGRADE);
    if ( getDialect().supportsOuterJoinForUpdate() ) {
      assertTrue( s.getCurrentLockMode(foo)==LockMode.UPGRADE );
View Full Code Here

    s.flush();
    s.connection().createStatement().executeUpdate("update "+getDialect().openQuote()+"foos"+getDialect().closeQuote()+" set long_ = -3");
    s.refresh(foo);
    assertTrue( foo.getLong().longValue()==-3l );
    assertTrue( s.getCurrentLockMode(foo)==LockMode.READ );
    s.refresh(foo, LockMode.UPGRADE);
    if ( getDialect().supportsOuterJoinForUpdate() ) {
      assertTrue( s.getCurrentLockMode(foo)==LockMode.UPGRADE );
    }
    s.delete(foo);
    s.getTransaction().commit();
View Full Code Here

    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    c = (Category) s.load(Category.class, id);
    s.refresh(c);
    s.flush();
    assertTrue( c.getSubcategories().size()==1 );
    s.flush();
    s.connection().commit();
    s.close();
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.