Package org.hibernate.classic

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


    fee.getFees().add("new element");
    fee1.setFee(null);

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(fee);
    s.saveOrUpdate(fee1);
    s.getTransaction().commit();
    s.close();

    s = openSession();
View Full Code Here


    fee1.setFee(null);

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(fee);
    s.saveOrUpdate(fee1);
    s.getTransaction().commit();
    s.close();

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

    fee.setQux( new Qux("quxy") );

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(fee);
    s.getTransaction().commit();
    s.close();

    fee.getQux().setStuff("xxx");
View Full Code Here

    fee.getQux().setStuff("xxx");

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(fee);
    s.getTransaction().commit();
    s.close();

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

    foos[0] = f3;
    foos[1] = f1;

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(baz);
    s.getTransaction().commit();
    s.close();

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

    baz.getFooArray()[0]=null;
    baz.getFooArray()[0]=null;

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(baz);
    doDelete( s, "from Foo" );
    baz.getOnes().remove(o);
    doDelete( s, "from One" );
    s.delete(baz);
    s.getTransaction().commit();
View Full Code Here

    }

    public void update( Vehicle vehicle ) {
        Session sess = sessionFactory.openSession();
        Transaction t = sess.beginTransaction();
        sess.saveOrUpdate( vehicle );
        t.commit();
    }

    public void delete( Vehicle vehicle ) {
        Session sess = sessionFactory.openSession();
View Full Code Here

//  }
 
  public Customer updateCustomer(Customer customer) {
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    session.beginTransaction();
    session.saveOrUpdate(customer);
    session.getTransaction().commit();
    return customer;
  }
 
  public Book updateBook(Book book) {
View Full Code Here

  }
 
  public Book updateBook(Book book) {
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    session.beginTransaction();
    session.saveOrUpdate(book);
    session.getTransaction().commit();
    return book;
  }
 
  public Book addBook(Book book) {
View Full Code Here

public class BookManager extends HibernateUtil {

  public Book update(Book book) {
    Session session = HibernateUtil.getSessionFactory().getCurrentSession();
    session.beginTransaction();
    session.saveOrUpdate(book);
    session.getTransaction().commit();
    return book;
  }
 
  public Genre update(Genre genre) {
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.