Package org.hibernate.classic

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


    s.find("from Baz baz join baz.stringDateMap date where index(date) = 'foo'");
    s.find("from Baz baz join baz.topGlarchez g where index(g) = 'A'");
    s.find("select index(g) from Baz baz join baz.topGlarchez g");

    assertTrue( s.find("from Baz baz left join baz.stringSet").size()==3 );
    baz = (Baz) s.find("from Baz baz join baz.stringSet str where str='foo'").get(0);
    assertTrue( !Hibernate.isInitialized( baz.getStringSet() ) );
    baz = (Baz) s.find("from Baz baz left join fetch baz.stringSet").get(0);
    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
View Full Code Here


    s.find("select index(g) from Baz baz join baz.topGlarchez g");

    assertTrue( s.find("from Baz baz left join baz.stringSet").size()==3 );
    baz = (Baz) s.find("from Baz baz join baz.stringSet str where str='foo'").get(0);
    assertTrue( !Hibernate.isInitialized( baz.getStringSet() ) );
    baz = (Baz) s.find("from Baz baz left join fetch baz.stringSet").get(0);
    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
View Full Code Here

    assertTrue( s.find("from Baz baz left join baz.stringSet").size()==3 );
    baz = (Baz) s.find("from Baz baz join baz.stringSet str where str='foo'").get(0);
    assertTrue( !Hibernate.isInitialized( baz.getStringSet() ) );
    baz = (Baz) s.find("from Baz baz left join fetch baz.stringSet").get(0);
    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
    s.find("from Glarch g inner join g.fooComponents comp join comp.fee fee where fee.count > 0");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee.count is not null");
View Full Code Here

    baz = (Baz) s.find("from Baz baz join baz.stringSet str where str='foo'").get(0);
    assertTrue( !Hibernate.isInitialized( baz.getStringSet() ) );
    baz = (Baz) s.find("from Baz baz left join fetch baz.stringSet").get(0);
    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
    s.find("from Glarch g inner join g.fooComponents comp join comp.fee fee where fee.count > 0");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee.count is not null");
View Full Code Here

    baz = (Baz) s.find("from Baz baz left join fetch baz.stringSet").get(0);
    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
    s.find("from Glarch g inner join g.fooComponents comp join comp.fee fee where fee.count > 0");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee.count is not null");

    s.delete(baz);
    //s.delete("from Glarch g");
View Full Code Here

    assertTrue( Hibernate.isInitialized( baz.getStringSet() ) );
    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
    s.find("from Glarch g inner join g.fooComponents comp join comp.fee fee where fee.count > 0");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee.count is not null");

    s.delete(baz);
    //s.delete("from Glarch g");
    s.delete( s.get(Glarch.class, gid) );
View Full Code Here

    assertTrue( s.find("from Baz baz join baz.stringSet string where string='foo'").size()==1 );
    assertTrue( s.find("from Baz baz inner join baz.components comp where comp.name='foo'").size()==1 );
    //List bss = s.find("select baz, ss from Baz baz inner join baz.stringSet ss");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee is not null");
    s.find("from Glarch g inner join g.fooComponents comp join comp.fee fee where fee.count > 0");
    s.find("from Glarch g inner join g.fooComponents comp where comp.fee.count is not null");

    s.delete(baz);
    //s.delete("from Glarch g");
    s.delete( s.get(Glarch.class, gid) );
    s.flush();
View Full Code Here

    fooBag.add( new Foo() );
    baz.setFooBag(fooBag);
    s.save(baz);
    s.flush();
    fooBag = baz.getFooBag();
    s.find("from Baz baz left join fetch baz.fooBag");
    assertTrue( fooBag==baz.getFooBag() );
    s.connection().commit();
    s.close();

    s = openSession();
View Full Code Here

    s = openSession();
    baz = (Baz) s.load( Baz.class, baz.getCode() );
    Object bag = baz.getFooBag();
    assertFalse( Hibernate.isInitialized(bag) );
    s.find("from Baz baz left join fetch baz.fooBag");
    assertTrue( bag==baz.getFooBag() );
    assertTrue( baz.getFooBag().size()==2 );
    s.delete(baz);
    s.flush();
    s.connection().commit();
View Full Code Here

    s.save( new Holder("ice T") );
    s.save( new Holder("ice cube") );

    assertTrue( s.find("from java.lang.Object as o").size()==15 );
    assertTrue( s.find("from Named").size()==7 );
    assertTrue( s.find("from Named n where n.name is not null").size()==4 );
    iter = s.iterate("from Named n");
    while ( iter.hasNext() ) {
      assertTrue( iter.next() instanceof Named );
    }
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.