Package org.hibernate

Examples of org.hibernate.Session.save()


    
              // localhost has IPv6 addresses
              if (Inet6Address.class.isInstance(addr)) {
                final TargetIPv6 foo = new TargetIPv6("transient localhost", (Inet6Address) addr, snmp_manager);
                if (foo == getCanonicalInstance(foo)) {
                  session.save(foo);
                  if (foo.addTarget(this, visual_thishost) == true) foo.checkSNMPAwareness();
                }
              }
            }
View Full Code Here


            action.setBackground(background);
            if (target.canManageThisChild(action))
              try {
                background.addActionQueue(action);
                action.setParent(this, target);
                session.save(action);
              } catch (final GeneralException ex) {
                log.error("Exception", ex);
              }
            }
          }
View Full Code Here

    // j'ai eu �a ici et avant : Illegal attempt to associate a collection with two open sessions
    session.update(this);
    EventList el = eventLists.get(event.getClass().toString());
    if (el == null) eventLists.put(event.getClass().toString(), el = new EventList());
    event.setEventList(el);
    session.save(event);
  }

  public void addEvent(final Synchro synchro, final EventGeneric event) {
    // create a view if this is the first event of this type
    boolean found = false;
View Full Code Here

    final Session session = synchro.getSessionFactory().getCurrentSession();
    session.update(this);
    EventList el = eventLists.get(event.getClass().toString());
    if (el == null) eventLists.put(event.getClass().toString(), el = new EventList());
    event.setEventList(el);
    session.save(event);
  }

  /**
   * Called when this target is disposed.
   * @param none.
View Full Code Here

        a.setAddress1(address1);
        a.setCity(city);
        a.setState(state);
        a.setCountry(country);

        sess.save(a);
        sess.getTransaction().commit();

        return a;
    }
View Full Code Here

                emp.setIsClockedIn(true);
                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) {
View Full Code Here

                emp.setIsClockedIn(false);
                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) {
View Full Code Here

        emp.setUser(u);
        emp.setAddress(a);
        emp.setPosition(p);

        // Save everything
        sess.save(u);
        sess.save(a);
        sess.save(emp);

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

        emp.setAddress(a);
        emp.setPosition(p);

        // Save everything
        sess.save(u);
        sess.save(a);
        sess.save(emp);

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

        emp.setPosition(p);

        // Save everything
        sess.save(u);
        sess.save(a);
        sess.save(emp);

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

        // Return our new employee
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.