Examples of saveOrUpdate()


Examples of org.hibernate.Session.saveOrUpdate()

   */
  protected static void saveOrUpdate(Object cbean){
    try{
      Session ssn = getSession();
      beginTransaction();
      ssn.saveOrUpdate(cbean);
      commit();
    }catch(HibernateException e){
      rollback();
      throw e;
    }
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

    final boolean is_new = !getGUI().containsCanonicalInstance(this);
    final TargetIPv4 target_ipv4 = (TargetIPv4) getGUI().getCanonicalInstance(this);

    final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
    session.saveOrUpdate(target_ipv4);
    session.update(parent);

    if (!getGUI().getVisualTransientAll().contains(target_ipv4)) {
      session.update(getGUI().getVisualTransientAll());
      target_ipv4.setParent(getGUI(), getGUI().getVisualTransientAll());
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

    }

    if (getGUI().getConfig().getProperty("enableeverynetworks") != null &&
        getGUI().getConfig().getProperty("enableeverynetworks").equals("true")) {
      subnet = (TargetIPv4Subnet) getGUI().getCanonicalInstance(subnet);
      session.saveOrUpdate(subnet);
      if (!getGUI().getVisualTransientNetworks().contains(subnet)) {
        session.update(getGUI().getVisualTransientNetworks());
        subnet.setParent(getGUI(), getGUI().getVisualTransientNetworks());
      }
      if (!subnet.contains(target_ipv4)) target_ipv4.setParent(getGUI(), subnet);
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

    if (!canAddTarget(parent)) return false;
    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

Examples of org.hibernate.Session.saveOrUpdate()

                sqlWorkspaceVertex.setVisible(update.getVisible());
                if (update.getGraphPosition() != null) {
                    sqlWorkspaceVertex.setGraphPositionX(update.getGraphPosition().getX());
                    sqlWorkspaceVertex.setGraphPositionY(update.getGraphPosition().getY());
                }
                session.saveOrUpdate(sqlWorkspaceVertex);
            }

            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      transaction = session.beginTransaction();

      if (criteria.equalsIgnoreCase("Add") || criteria.equalsIgnoreCase("Update")) {
        session.saveOrUpdate(objToSave);
      } else if (criteria.equalsIgnoreCase("Delete")) {
        session.delete(objToSave);
      }

//      transaction.commit();
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

        try {
            Session session = getSession();

            transaction = session.beginTransaction();

            session.saveOrUpdate(valueObject);

            transaction.commit();

            return true;
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

        Prozess proc = it.next();
        logger.debug("updating history entries for " + proc.getTitel());
        try {
          if (!proc.isSwappedOutGui()) {
            if (true == updateHistory(proc) | updateHistoryForSteps(proc)) {
              session.saveOrUpdate(proc);
              logger.debug("history updated for process " + proc.getId());
            }
          }

          // commit transaction every 50 items
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

   */
  protected void storeObj(Object obj) throws DAOException {
    try {

      Session session = Helper.getHibernateSession();
      session.saveOrUpdate(obj);
      session.flush();
      session.beginTransaction().commit();
    } catch (HibernateException he) {
      rollback();
      throw new DAOException(he);
View Full Code Here

Examples of org.hibernate.Session.saveOrUpdate()

  protected void storeList(List<Object> list) throws DAOException {
    try {
      Session session = Helper.getHibernateSession();
      for (Object obj : list) {
        session.saveOrUpdate(obj);
      }
      session.flush();
      session.beginTransaction().commit();
    } catch (HibernateException he) {
      rollback();
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.