Package org.hibernate.classic

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


    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    q = (Qux) s.load(Qux.class, q.getKey() );
    b = (BarProxy) s.load( Foo.class, b.getKey() );
    b.getKey();
    assertFalse( Hibernate.isInitialized(b) );
    b.getBarString();
    assertTrue( Hibernate.isInitialized(b) );
View Full Code Here


    s.close();

    s = openSession();
    s.beginTransaction();
    q = (Qux) s.load(Qux.class, q.getKey() );
    b = (BarProxy) s.load( Foo.class, b.getKey() );
    b.getKey();
    assertFalse( Hibernate.isInitialized(b) );
    b.getBarString();
    assertTrue( Hibernate.isInitialized(b) );
    BarProxy b2 = (BarProxy) s.load( Bar.class, b.getKey() );
View Full Code Here

    b = (BarProxy) s.load( Foo.class, b.getKey() );
    b.getKey();
    assertFalse( Hibernate.isInitialized(b) );
    b.getBarString();
    assertTrue( Hibernate.isInitialized(b) );
    BarProxy b2 = (BarProxy) s.load( Bar.class, b.getKey() );
    Qux q2 = (Qux) s.load( Qux.class, q.getKey() );
    assertTrue( "loaded same object", q==q2 );
    assertTrue( "loaded same object", b==b2 );
    assertTrue( Math.round( b.getFormula() ) == b.getInt()/2 );
    s.delete(q2);
View Full Code Here

    b.getKey();
    assertFalse( Hibernate.isInitialized(b) );
    b.getBarString();
    assertTrue( Hibernate.isInitialized(b) );
    BarProxy b2 = (BarProxy) s.load( Bar.class, b.getKey() );
    Qux q2 = (Qux) s.load( Qux.class, q.getKey() );
    assertTrue( "loaded same object", q==q2 );
    assertTrue( "loaded same object", b==b2 );
    assertTrue( Math.round( b.getFormula() ) == b.getInt()/2 );
    s.delete(q2);
    s.delete(b2);
View Full Code Here

    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    g = (GlarchProxy) s.load(Glarch.class, gid);
    assertTrue( g.getMultiple()!=null );
    assertEquals( g.getMultiple().count, 12 );
    assertSame(g.getMultiple().glarch, g);
    s.delete(g);
    s.getTransaction().commit();
View Full Code Here

    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    g = (GlarchProxy) s.load(Glarch.class, id);
    assertTrue( g.getName().equals("G") );
    assertTrue( g.getDynaBean().get("foo").equals("foo") && g.getDynaBean().get("bar").equals( new Integer(66) ) );
    assertTrue( ! (g instanceof Glarch) );
    g.getDynaBean().put("foo", "bar");
    s.getTransaction().commit();
View Full Code Here

    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    g = (GlarchProxy) s.load(Glarch.class, id);
    assertTrue( g.getDynaBean().get("foo").equals("bar") && g.getDynaBean().get("bar").equals( new Integer(66) ) );
    g.setDynaBean(null);
    s.getTransaction().commit();
    s.close();
View Full Code Here

    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
    g = (GlarchProxy) s.load(Glarch.class, id);
    assertTrue( g.getDynaBean()==null );
    s.delete(g);
    s.getTransaction().commit();
    s.close();
  }
View Full Code Here

    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
    foo = (FooProxy) s.load(Foo.class, id);
    foo2 = (FooProxy) s.load(Foo.class, id2);
    assertFalse( Hibernate.isInitialized(foo) );
    Hibernate.initialize(foo2);
    Hibernate.initialize(foo);
    assertTrue( foo.getComponent().getImportantDates().length==4 );
View Full Code Here

    s.close();

    s = openSession();
    t = s.beginTransaction();
    foo = (FooProxy) s.load(Foo.class, id);
    foo2 = (FooProxy) s.load(Foo.class, id2);
    assertFalse( Hibernate.isInitialized(foo) );
    Hibernate.initialize(foo2);
    Hibernate.initialize(foo);
    assertTrue( foo.getComponent().getImportantDates().length==4 );
    assertTrue( foo2.getComponent().getImportantDates().length==4 );
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.