Package org.hibernate

Examples of org.hibernate.Session.beginTransaction()


public class ProcessInstanceDbLog {
   
    @SuppressWarnings("unchecked")
  public static List<ProcessInstanceLog> findProcessInstances() {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery("from ProcessInstanceLog").list();
        session.getTransaction().commit();
        return result;
    }
View Full Code Here


    }

    @SuppressWarnings("unchecked")
  public static List<ProcessInstanceLog> findProcessInstances(String processId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery(
            "from ProcessInstanceLog as log where log.processId = ?")
                .setString(0, processId).list();
        session.getTransaction().commit();
        return result;
View Full Code Here

        return result;
    }

  public static List<ProcessInstanceLog> findActiveProcessInstances(String processId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery(
            "from ProcessInstanceLog as log where log.processId = ? AND log.end is null")
                .setString(0, processId).list();
        session.getTransaction().commit();
        return result;
View Full Code Here

    Transaction tx = (Transaction)transactions.get();
    if (tx == null || tx.wasCommitted() || tx.wasRolledBack()) {
      Session ssn = (Session)sessions.get();
      if(ssn == null){
        ssn = getSession();
        tx = ssn.beginTransaction();
        transactions.set(tx);
      }
      else if(ssn != null){
        tx = ssn.beginTransaction();
        transactions.set(tx);       
View Full Code Here

        ssn = getSession();
        tx = ssn.beginTransaction();
        transactions.set(tx);
      }
      else if(ssn != null){
        tx = ssn.beginTransaction();
        transactions.set(tx);       
      }
    }
    else{
      if(tx!=null && log.isWarnEnabled())
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public static ProcessInstanceLog findProcessInstance(long processInstanceId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> result = session.createQuery(
            "from ProcessInstanceLog as log where log.processInstanceId = ?")
                .setLong(0, processInstanceId).list();
        session.getTransaction().commit();
        return result == null || result.size() == 0 ? null : result.get(0);
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public static List<NodeInstanceLog> findNodeInstances(long processInstanceId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<NodeInstanceLog> result = session.createQuery(
            "from NodeInstanceLog as log where log.processInstanceId = ?")
                .setLong(0, processInstanceId).list();
        session.getTransaction().commit();
        return result;
View Full Code Here

    }

    @SuppressWarnings("unchecked")
  public static List<NodeInstanceLog> findNodeInstances(long processInstanceId, String nodeId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<NodeInstanceLog> result = session.createQuery(
            "from NodeInstanceLog as log where log.processInstanceId = ? and log.nodeId = ?")
                .setLong(0, processInstanceId)
                .setString(1, nodeId).list();
        session.getTransaction().commit();
View Full Code Here

    }

  @SuppressWarnings("unchecked")
  public static void clear() {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        List<ProcessInstanceLog> processInstances =
          session.createQuery("from ProcessInstanceLog").list();
        for (ProcessInstanceLog processInstance: processInstances) {
          session.delete(processInstance);
        }
View Full Code Here

    }

    private void addProcessLog(long processInstanceId, String processId) {
        ProcessInstanceLog log = new ProcessInstanceLog(processInstanceId, processId);
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.save(log);
        session.getTransaction().commit();
    }
   
    private void updateProcessLog(long processInstanceId) {
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.