Package org.hibernate

Examples of org.hibernate.Session.update()


    if (parent != null && !parent.canManageThisChild(this)) return false;

    if (parent != null) {
      final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
      session.saveOrUpdate(getGUI().getCanonicalInstance(this));
      session.update(parent);
      getGUI().getCanonicalInstance(this).setParent(getGUI(), parent);
      if (getGUI().getCanonicalInstance(this) == this) return true;
    }
    return false;
  }
View Full Code Here


      session.beginTransaction();

      try  {
        for (final VisualElement elt : getGUI().getVisualTransient().getSubElements(Target.class)) {
          final Target target = (Target) elt;
          session.update(target);
          for (final String event_type : target.getEventLists().keySet()) {
            final Integer count = (Integer) session.createQuery("select count(*) from EventGeneric ev " +
                "where ev.eventList = :event_list")
                .setString("event_list", target.getEventLists().get(event_type).getId().toString()).uniqueResult();

View Full Code Here

        a.setCity(city);
        a.setState(state);
        a.setZipCode(zipCode);
        a.setCountry(Country);

        sess.update(a);

        return a;
    }
}
View Full Code Here

                user.setEmployee(emp);
                org.hibernate.Transaction tx = null;
                try {
                    tx = sess.beginTransaction();
                    sess.save(evt);
                    sess.update(emp);
                    sess.update(user);
                    tx.commit();
                } catch (HibernateException he) {
                    if (tx != null) {
                        tx.rollback();
View Full Code Here

                org.hibernate.Transaction tx = null;
                try {
                    tx = sess.beginTransaction();
                    sess.save(evt);
                    sess.update(emp);
                    sess.update(user);
                    tx.commit();
                } catch (HibernateException he) {
                    if (tx != null) {
                        tx.rollback();
                    }
View Full Code Here

                user.setEmployee(emp);
                org.hibernate.Transaction tx = null;
                try {
                    tx = sess.beginTransaction();
                    sess.save(evt);
                    sess.update(emp);
                    sess.update(user);
                    tx.commit();
                } catch (HibernateException he) {
                    if (tx != null) {
                        tx.rollback();
View Full Code Here

                org.hibernate.Transaction tx = null;
                try {
                    tx = sess.beginTransaction();
                    sess.save(evt);
                    sess.update(emp);
                    sess.update(user);
                    tx.commit();
                } catch (HibernateException he) {
                    if (tx != null) {
                        tx.rollback();
                    }
View Full Code Here

        // Set position
        emp.setPosition(p);

        // Update in db
        sess.update(u);
        sess.update(emp);

        // Commit
        sess.getTransaction().commit();
View Full Code Here

        // Set position
        emp.setPosition(p);

        // Update in db
        sess.update(u);
        sess.update(emp);

        // Commit
        sess.getTransaction().commit();

        // Return updated employee
View Full Code Here

   }

   public Object update(Object obj) throws Exception
   {
      Session session = openSession();
      session.update(obj);
      session.flush();
      return obj;
   }

   public Object save(Object obj) throws Exception
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.