Package org.hibernate.classic

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


    if (!beanForm.validateRequired())
    {
        return; // Errors
    }
    Session session = getHibernateSession();
    session.saveOrUpdate(bean);
    session.getTransaction().commit();
    if (returnPage != null)
    {
      returnPage.info("Saved.");
      setResponsePage(returnPage);
View Full Code Here


    Session s = openSession();
    Eye e = new Eye();
    e.setName("Eye Eye");
    Jay jay = new Jay(e);
    e.setJay(jay);
    s.saveOrUpdate(e);
    s.flush();
    s.connection().commit();
    s.close();

    s = openSession();
View Full Code Here

    tx.commit();
    s.close();
    c.getOther().setClazz(Qux.class);
    s = openSession();
    tx = s.beginTransaction();
    s.saveOrUpdate(c);
    tx.commit();
    s.close();
    c.getOther().getOther().setClazz(Bar.class);
    s = openSession();
    tx = s.beginTransaction();
View Full Code Here

    tx.commit();
    s.close();
    c.getOther().getOther().setClazz(Bar.class);
    s = openSession();
    tx = s.beginTransaction();
    s.saveOrUpdate(c);
    tx.commit();
    s.close();
    s = openSession();
    tx = s.beginTransaction();
    c = (Circular) s.load(Circular.class, id);
View Full Code Here

    private void initData() throws Exception {
        Session s = openSession();
        Transaction t = s.beginTransaction();
        Componentizable master = getMaster("hibernate", "ORM tool", "ORM tool1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", "open source", "open source1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", null, null);
        s.saveOrUpdate(master);
        t.commit();
View Full Code Here

        Session s = openSession();
        Transaction t = s.beginTransaction();
        Componentizable master = getMaster("hibernate", "ORM tool", "ORM tool1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", "open source", "open source1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", null, null);
        s.saveOrUpdate(master);
        t.commit();
        s.close();
    }
View Full Code Here

        Componentizable master = getMaster("hibernate", "ORM tool", "ORM tool1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", "open source", "open source1");
        s.saveOrUpdate(master);
        master = getMaster("hibernate", null, null);
        s.saveOrUpdate(master);
        t.commit();
        s.close();
    }

    private void deleteData() throws Exception {
View Full Code Here

    fee1.setFi("changed");

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

    Qux q = new Qux("quxxy");
    q.setTheKey(0);
View Full Code Here

    q.setTheKey(0);
    fee1.setQux(q);

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

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

    fee2.getFees().add("an element");
    fee1.setFi("changed again");

    s = openSession();
    s.beginTransaction();
    s.saveOrUpdate(fee2);
    s.update( fee1, fee1.getKey() );
    s.getTransaction().commit();
    s.close();

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