Package javax.persistence

Examples of javax.persistence.EntityTransaction.begin()


      String hql = "delete from UserContacts where userContactId = :userContactId";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      Query query = session.createQuery(hql);
          query.setParameter("userContactId",userContactId);
          int rowCount = query.executeUpdate();
     
View Full Code Here


      String hql = "delete from UserContacts where owner.user_id = :ownerId";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
     
      Query query = session.createQuery(hql);
          query.setParameter("ownerId",ownerId);
          int rowCount = query.executeUpdate();
     
View Full Code Here

              "where c.contact.user_id = :user_id AND c.owner.user_id = :ownerId ";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("user_id", user_id);
      query.setParameter("ownerId", ownerId);
      List ll = query.getResultList();
      tx.commit();
View Full Code Here

              "AND c.contact.deleted <> 'true'";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("ownerId", ownerId);
      query.setParameter("pending", pending);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
View Full Code Here

              "AND c.contact.deleted <> 'true'";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("contactId", contactId);
      query.setParameter("shareCalendar", shareCalendar);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
View Full Code Here

              "AND c.contact.deleted <> 'true'";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("user_id", user_id);
      query.setParameter("pending", pending);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
View Full Code Here

              "where c.userContactId = :userContactId";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("userContactId", userContactId);
      UserContacts userContacts = null;
      try {
        userContacts = (UserContacts) query.getSingleResult();
View Full Code Here

      String hql = "select c from UserContacts c ";
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      List<UserContacts> userContacts = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
View Full Code Here

      userContacts.setUpdated(new Date());
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (userContacts.getUserContactId() == 0) {
        session.persist(userContacts);
          } else {
            if (!session.contains(userContacts)) {
              session.merge(userContacts);
View Full Code Here

      userContacts.setUpdated(new Date());
     
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      if (userContacts.getUserContactId() == 0) {
        session.persist(userContacts);
          } else {
            if (!session.contains(userContacts)) {
              session.merge(userContacts);
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.