Package org.hibernate.classic

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


    s = openSession();
    t = s.beginTransaction();
    multi.setExtraProp( multi.getExtraProp() + "2" );
    //multi.setCount( multi.getCount() + 1 );
    multi.setName("new name");
    s.update( multi, multiId );
    simp.setName("new name");
    s.update( simp, simpId );
    sm.setAmount(456.7f);
    s.update( sm, smId );
    t.commit();
View Full Code Here


    multi.setExtraProp( multi.getExtraProp() + "2" );
    //multi.setCount( multi.getCount() + 1 );
    multi.setName("new name");
    s.update( multi, multiId );
    simp.setName("new name");
    s.update( simp, simpId );
    sm.setAmount(456.7f);
    s.update( sm, smId );
    t.commit();
    s.close();
View Full Code Here

    multi.setName("new name");
    s.update( multi, multiId );
    simp.setName("new name");
    s.update( simp, simpId );
    sm.setAmount(456.7f);
    s.update( sm, smId );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
View Full Code Here

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

    s = openSession();
    t = s.beginTransaction();
    s.update( multi, multiId );
    s.delete(multi);
    assertEquals( 2, doDelete( s, "from Top" ) );
    t.commit();
    s.close();
View Full Code Here

    s.close();

    s = openSession();
    s.beginTransaction();
    foo2.setString("dirty again");
    s.update(foo2);
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
View Full Code Here

    s.close();

    s = openSession();
    s.beginTransaction();
    foo2.setString("dirty again 2");
    s.update(foo2);
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
View Full Code Here

    baz2.setStringArray( baz.getStringArray() );
    baz2.setFooArray( baz.getFooArray() );

    s = openSession();
    s.beginTransaction();
    s.update(baz2);
    s.getTransaction().commit();
    s.close();

    s = openSession();
    s.beginTransaction();
View Full Code Here

    foo2.setFloat( new Float(1.3f) );
    foo2.getDependent().setKey(null);
    foo2.getComponent().getSubcomponent().getFee().setKey(null);
    assertFalse( foo2.getKey().equals(id) );
    s.save(foo, "xyzid");
    s.update(foo2, id); //intentionally id, not id2!
    assertEquals( foo2.getKey(), id );
    assertTrue( foo2.getInt()==1234567 );
    assertEquals( foo.getKey(), "xyzid" );
    t.commit();
    s.close();
View Full Code Here

      assertNotNull("Todays Date should have been returned",(((Object[])rset.get(0))[1]));
      assertEquals("trunc(45.8) result was incorrect ", new Float(45), ( (Object[]) rset.get(0) )[2] );
      assertEquals("round(45.8) result was incorrect ", new Float(46), ( (Object[]) rset.get(0) )[3] );

      simple.setPay(new Float(-45.8));
      s.update(simple);

      // Test type conversions while using nested functions (Float to Int).
      rset = s.createQuery( "select abs(round(s.pay)) from Simple s" ).list();
      assertEquals("abs(round(-45.8)) result was incorrect ", new Float(46), rset.get(0));
View Full Code Here

          s.createQuery( "select trunc(round(sysdate())) from Simple s" ).list().size() == 1
      );

      // Test the oracle standard NVL funtion as a test of multi-param functions...
      simple.setPay(null);
      s.update(simple);
      Integer value = (Integer) s.createQuery(
          "select MOD( NVL(s.pay, 5000), 2 ) from Simple as s where s.id = 10"
      ).list()
          .get(0);
      assertTrue( 0 == value.intValue() );
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.