Package javax.persistence

Examples of javax.persistence.EntityTransaction.commit()


     
      Query query = session.createQuery(hql);
          query.setParameter("userContactId",userContactId);
          int rowCount = query.executeUpdate();
     
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return rowCount;     
    } catch (Exception e) {
      log.error("[deleteUserContact]",e);
View Full Code Here


     
      Query query = session.createQuery(hql);
          query.setParameter("ownerId",ownerId);
          int rowCount = query.executeUpdate();
     
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return rowCount;     
    } catch (Exception e) {
      log.error("[deleteAllUserContacts]",e);
View Full Code Here

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("user_id", user_id);
      query.setParameter("ownerId", ownerId);
      List ll = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      log.info("checkUserContacts"+(Long)ll.get(0));
     
      return (Long)ll.get(0);
View Full Code Here

      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("hash", hash);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      if (ll.size() > 0) {
        return ll.get(0);
      }
View Full Code Here

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("ownerId", ownerId);
      query.setParameter("pending", pending);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return ll;
     
    } catch (Exception e) {
View Full Code Here

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("contactId", contactId);
      query.setParameter("shareCalendar", shareCalendar);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return ll;
     
    } catch (Exception e) {
View Full Code Here

      tx.begin();
      Query query = session.createQuery(hql);
      query.setParameter("user_id", user_id);
      query.setParameter("pending", pending);
      List<UserContacts> ll = query.getResultList();
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return ll;
     
    } catch (Exception e) {
View Full Code Here

      UserContacts userContacts = null;
      try {
        userContacts = (UserContacts) query.getSingleResult();
        } catch (NoResultException ex) {
        }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return userContacts;
     
    } catch (Exception e) {
View Full Code Here

      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);
     
      return userContacts;
     
    } catch (Exception e) {
View Full Code Here

          } else {
            if (!session.contains(userContacts)) {
              session.merge(userContacts);
          }
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
     
      return userContactId;
     
    } catch (Exception e) {
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.