Package org.hibernate.classic

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


    List list = namedQuery.list();
   
    assertEquals(1, list.size());
    assertEquals( "flakky comp", ( (Componentizable) list.get(0) ).getComponent().getName() );
   
    session.clear();
   
    session.delete(componentizable);
    session.flush();
   
    session.connection().commit();
View Full Code Here


    else {
      assertSame(a2, savedB);
      assertSame(a1, savedA);
    }

    session.clear();
    List list2 = session.getNamedQuery("propertyResultDiscriminator").list();
    assertEquals(2, list2.size());
   
    session.connection().commit();
    session.close();
View Full Code Here

   
    s = openSession();
    t = s.beginTransaction();
    d = (D) s.get(D.class, did);
    assertTrue(d.getReverse().getId().equals(did));
    s.clear();
    getSessions().evict(D.class);
    getSessions().evict(A.class);
    d = (D) s.get(D.class, did);
    assertTrue(d.inverse.getId().equals(did));
    assertTrue(d.inverse.getName().equals("a"));
View Full Code Here

        object.setDate3(testvalue3);
        s.save( object, new Long(10));
        t.commit();
        s.close();
        s = openSession();
        s.clear();
        t = s.beginTransaction();
        TestInterSystemsFunctionsClass test = (TestInterSystemsFunctionsClass) s.get(TestInterSystemsFunctionsClass.class, new Long(10));
        assertTrue( test.getDate1().equals(testvalue));
        test = (TestInterSystemsFunctionsClass) s.get(TestInterSystemsFunctionsClass.class, new Long(10), LockMode.UPGRADE);
        assertTrue( test.getDate1().equals(testvalue));
View Full Code Here

    getSessions().evict(D.class);
    getSessions().evict(A.class);
    d = (D) s.get(D.class, did);
    assertTrue(d.inverse.getId().equals(did));
    assertTrue(d.inverse.getName().equals("a"));
    s.clear();
    getSessions().evict(D.class);
    getSessions().evict(A.class);
    assertTrue( s.find("from D d join d.reverse r join d.inverse i where i = r").size()==1 );
    t.commit();
    s.close();
View Full Code Here

    assertEquals( 1, count );
    BooleanLiteralEntity entity = ( BooleanLiteralEntity ) s.createQuery( "from BooleanLiteralEntity" ).uniqueResult();
    assertTrue( entity.isYesNoBoolean() );
    assertTrue( entity.isTrueFalseBoolean() );
    assertTrue( entity.isZeroOneBoolean() );
    s.clear();

    count = s.createQuery( "update BooleanLiteralEntity set yesNoBoolean = true, trueFalseBoolean = true, zeroOneBoolean = true" )
        .executeUpdate();
    assertEquals( 1, count );
    entity = ( BooleanLiteralEntity ) s.createQuery( "from BooleanLiteralEntity" ).uniqueResult();
View Full Code Here

  public void testRefreshProxy() throws Exception {
    Session s = openSession();
    Glarch g = new Glarch();
    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();
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.