Package org.hibernate

Examples of org.hibernate.Query.executeUpdate()


        String hdr = "removeEntries(" + mex + "): ";
        __log.debug(hdr);

        Query q = getSession().createQuery(QRY_DELMESSAGES);
        q.setEntity(0, mex); // messageExchange
        int numMods = q.executeUpdate();
        __log.debug(hdr + " deleted " + numMods + " rows");
    }

}
View Full Code Here


  }
 
  protected void clearSelectors() {
    Query q = getSession().createQuery(QRY_DELSELECTORS);
    q.setEntity(0, _instance);
    q.executeUpdate();   
  }

  public int getActivityFailureCount() {
    return _instance.getActivityFailureCount();
  }
View Full Code Here

    public ProcessInstanceDAO getTargetInstance() {
        // First we need to reliably lock the instance:
        if (!_locked) {
            Query q = getSession().createQuery(LOCK_INSTANCE);
            q.setLong(0, _selector.getInstance().getId());
            q.executeUpdate();
            _locked = true;
        }

        // now it is safe to return
        return new ProcessInstanceDaoImpl(_sm, _selector.getInstance());
View Full Code Here

        // is a much safer alternative.
        String processType = new QName(_hobj.getProcess().getTypeNamespace(), _hobj.getProcess().getTypeName()).toString();
        Query lockQry = getSession().createQuery(LOCK_SELECTORS);
        lockQry.setString(0, key == null ? null : key.toCanonicalString());
        lockQry.setString(1, processType);
        if (lockQry.executeUpdate() > 0) {
           
            Query q = getSession().createQuery(FLTR_SELECTORS);
            q.setString(0, key == null ? null : key.toCanonicalString());
            q.setString(1, processType);
            q.setString(2, _hobj.getCorrelatorId());
View Full Code Here

        String hdr = "removeRoutes(" + routeGroupId + ", iid=" + target.getInstanceId() + "): ";
        __log.debug(hdr);
        Query q = getSession().createQuery(QRY_DELSELECTORS);
        q.setString(0, routeGroupId); // groupId
        q.setEntity(1, ((ProcessInstanceDaoImpl) target).getHibernateObj()); // instance
        int updates = q.executeUpdate();
        __log.debug(hdr + "deleted " + updates + " rows");

    }

    public void removeEntries(HMessageExchange mex) {
View Full Code Here

        String hdr = "removeEntries(" + mex + "): ";
        __log.debug(hdr);

        Query q = getSession().createQuery(QRY_DELMESSAGES);
        q.setEntity(0, mex); // messageExchange
        int numMods = q.executeUpdate();
        __log.debug(hdr + " deleted " + numMods + " rows");
    }

}
View Full Code Here

  }
 
  protected void clearSelectors() {
    Query q = getSession().createQuery(QRY_DELSELECTORS);
    q.setEntity(0, _instance);
    q.executeUpdate();   
  }

  public int getActivityFailureCount() {
    return _instance.getActivityFailureCount();
  }
View Full Code Here

            public Object doInHibernate(Session arg0) throws HibernateException, SQLException {
                String hql = "delete from org.fireflow.engine.impl.WorkItem  where taskInstance.id=? and state=0";
                Query query = arg0.createQuery(hql);
                query.setString(0, taskInstanceId);
                return query.executeUpdate();
            }
        });
    }

    /* (non-Javadoc)
 
View Full Code Here

                String hql1 = "Update org.fireflow.engine.impl.TaskInstance m Set m.suspended=:suspended Where m.processInstanceId=:processInstanceId And (m.state=0 Or m.state=1)";
                Query query1 = arg0.createQuery(hql1);
                query1.setBoolean("suspended", Boolean.TRUE);
                query1.setString("processInstanceId", processInstance.getId());
                query1.executeUpdate();

                return null;
            }
        });
    }
View Full Code Here

                String hql1 = "Update org.fireflow.engine.impl.TaskInstance m Set m.suspended=:suspended Where m.processInstanceId=:processInstanceId And (m.state=0 Or m.state=1)";
                Query query1 = arg0.createQuery(hql1);
                query1.setBoolean("suspended", Boolean.FALSE);
                query1.setString("processInstanceId", processInstance.getId());
                query1.executeUpdate();

                return null;
            }
        });
    }
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.