Package org.hibernate

Examples of org.hibernate.Session.update()


            if (event != null && event.getResponse() != null && event.getResponse().size() > 0 &&
                event.getResponse().get(0) != null && event.getResponse().get(0).getVariable() != null) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try {
              session.update(_this);
              setType(event.getResponse().get(0).getVariable().toString());
              session.getTransaction().commit();
              } catch (final Exception ex) {
                log.error("Exception", ex);
                session.getTransaction().rollback();
View Full Code Here


    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

    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());
    }

    final String addr_str = GenericTools.inet4AddressToString(target_ipv4.getAddress());
    final String net_str = GenericTools.getNetFromAddress(addr_str);
View Full Code Here

    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

        synchronized (getGUI().getSynchro()) {
          synchronized (getGUI().sync_tree) {
            final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try {
              session.update(this); // pour le setDescription() => � enlever qd la description ne sera plus persistente
              if (value_ok) {
                getTarget().addEvent(new EventGenericSrc(true, value, value1, value2, value3, value4, value5, value6, value7, value8, value9, value10, units));
                getGUI().setStatus(getGUI().getConfig().getPattern("new_file_value", GenericTools.formatNumericString(getGUI().getConfig(), new Integer(value < 0 ? value1 : value).toString())));
                setDescription("" + GenericTools.formatNumericString(getGUI().getConfig(), new Integer(value < 0 ? value1 : value).toString()) + " " + querier.getUnit());
View Full Code Here

      synchronized (getGUI().getSynchro()) {
        synchronized (getGUI().sync_tree) {
          final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
          session.beginTransaction();
          try {
            session.update(this); // pour le setDescription() => � enlever qd la description ne sera plus persistente

            getTarget().addEvent(new EventGenericSrc(false));
            // mettre un setstatus comme pour IPv4
//            setDescription(getGUI().getConfig().getString("unreachable"));
View Full Code Here

            synchronized (getGUI().getSynchro()) {
              synchronized (getGUI().sync_tree) {
                final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
                session.beginTransaction();
                try {
                  session.update(this);

                  getTarget().addEvent(new EventHTTP(new Double(((double) 8 * 1000 * bytes_received) /
                      (System.currentTimeMillis() - last_time)).intValue()));

                  getTarget().addEvent(new EventHTTPPages(new Double(((double) 1000 * pages_received) /
View Full Code Here

        synchronized (getGUI().getSynchro()) {
          synchronized (getGUI().sync_tree) {
            final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
            session.beginTransaction();
            try {
              session.update(this);
//              log.debug("ActionPing::invoke(): starting adding a bunch of events");
              for (int i = 1; i < 50; i++)
                getTarget().addEvent(new EventReachable(true, 10));
//              log.debug("ActionPing::invoke(): FINISHED");
              session.getTransaction().commit();
View Full Code Here

          synchronized (getGUI().getSynchro()) {
            synchronized (getGUI().sync_tree) {
              final Session session = getGUI().getSynchro().getSessionFactory().getCurrentSession();
              session.beginTransaction();
              try {
                session.update(this); // pour le setDescription() => � enlever qd la description ne sera plus persistente
                if (match.find() == true) {
                  final int delay = new Integer(match.group(2)).intValue();

                  getTarget().addEvent(new EventReachable(true, new Integer(match.group(2)).intValue()));
                  getGUI().setStatus(getGUI().getConfig().getPattern("received_icmp", address));
View Full Code Here

          "<TR><TD bgcolor='lightyellow' align='left'><B>" + htmlFace("target") + "</B></TD>" +
          "<TD bgcolor='lightyellow' align='left'><B>" + htmlFace("class") + "</B></TD>" +
          "<TD bgcolor='lightyellow' align='right'><B>" + htmlFace("events") + "</B></TD></TR>";
          for (final VisualElement elt : visual_transient.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

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.