Package org.hibernate.classic

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


    bars.remove( bars.iterator().next() );
    foos.remove(1);
    s = openSession();
    t = s.beginTransaction();
    s.update(baz);
    assertEquals( 2, s.find("From Bar bar").size() );
    assertEquals( 3, s.find("From Foo foo").size() );
    t.commit();
    s.close();
View Full Code Here


    s.close();

    foos.remove(0);
    s = openSession();
    t = s.beginTransaction();
    s.update(baz);
    bars.remove( bars.iterator().next() );
    assertEquals( 1, s.find("From Foo foo").size() );
    s.delete(baz);
    //s.flush();
    assertEquals( 0, s.find("From Foo foo").size() );
View Full Code Here

    s = openSession();

    list = s.find("select p from Person as p where p.address = 'Lrkevnget 1'");
    assertTrue(list.size() == 0);
    p.setAddress("Lrkevnget 1");
    s.update(p);
    list = s.find("select p from Person as p where p.address = 'Lrkevnget 1'");
    assertTrue(list.size() == 1);
    list = s.find("select p from Party as p where p.address = 'P. P. Street 8'");
    assertTrue(list.size() == 0);
View Full Code Here

    s.connection().commit();
    s.close();

    s = openSession();
    l.setDescription("sick're");
    s.update(l);
    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    l = new Location();
View Full Code Here

    s.save(v); Serializable id = s.save(v);
    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    s.update(v, id); s.update(v, id);
    s.delete(v); s.delete(v);
    s.flush();
    s.connection().commit();
    s.close();
  }
View Full Code Here

    s.save(v); Serializable id = s.save(v);
    s.flush();
    s.connection().commit();
    s.close();
    s = openSession();
    s.update(v, id); s.update(v, id);
    s.delete(v); s.delete(v);
    s.flush();
    s.connection().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.find("select abs(round(s.pay)) from Simple s");
      assertEquals("abs(round(-45.8)) result was incorrect ", new Float(46), rset.get(0));
View Full Code Here

        s.find("select trunc(round(sysdate())) from Simple s").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.find("select MOD( NVL(s.pay, 5000), 2 ) from Simple as s where s.id = 10").get(0);
      assertTrue( 0 == value.intValue() );
    }

    if ( (getDialect() instanceof HSQLDialect) ) {
View Full Code Here

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

    s = openSession();
    t = s.beginTransaction();
    s.update(b);
    t.commit();
    s.close();

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

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

    s = openSession();
    t = s.beginTransaction();
    s.update( simple, new Long(10) );
    t.commit();
    s.close();

    s = openSession();
    t = s.beginTransaction();
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.