Package javax.persistence

Examples of javax.persistence.Query


        //"and c.deleted <> :deleted";
    Object idf = PersistenceSessionUtil.createSession();
    EntityManager session = PersistenceSessionUtil.getSession();
    EntityTransaction tx = session.getTransaction();
      tx.begin();
    Query query = session.createQuery(hql);
    query.setParameter("email", email);
    //query.setParameter("deleted", "true");
   
    List<Adresses> addr = query.getResultList();
   
    tx.commit();
    PersistenceSessionUtil.closeSession(idf);
 
    log.debug("retrieveAddressByEmail "+addr.size());
View Full Code Here


    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Users_Usergroups as c where c.user_id = :user_id");
      query.setParameter("user_id", USER_ID.longValue());
      int count = query.getResultList().size();
      usersusergroups = new Users_Usergroups[count];
      int k = 0;
      for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
        usersusergroups[k] = (Users_Usergroups) it2.next();
        k++;
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
View Full Code Here

    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Users_Usergroups as c where c.user_id = :user_id");
      query.setParameter("user_id", USER_ID);
      for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
        usersusergroups = (Users_Usergroups) it2.next();
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
    } catch (Exception ex2) {
View Full Code Here

      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session
            .createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id");
        query.setParameter("usergroup_id", usergroup_id.longValue());
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups = (Users_Usergroups) it2.next();
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        //TODO: setzen der Usergroups einer Gruppe
View Full Code Here

    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id");
      query.setParameter("usergroup_id", usergroup_id.longValue());
      int count = query.getResultList().size();
      usergroups = new Usergroups[count];
      int k = 0;
      for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
        usergroups[k] = (Usergroups) it2.next();
        k++;
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
View Full Code Here

      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session.createQuery("from Usergroups");
        int count = query.getResultList().size();
        usergroups = new Usergroups[count];
        int k = 0;
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          usergroups[k] = (Usergroups) it2.next();
          k++;
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
View Full Code Here

    try {
      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
      Query query = session
          .createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id");
      query.setParameter("usergroup_id", usergroup_id.longValue());
      for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
        usergroups = (Usergroups) it2.next();
      }
      tx.commit();
      PersistenceSessionUtil.closeSession(idf);
    } catch (Exception ex2) {
View Full Code Here

      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session.createQuery("from Usergroups");
        int count = query.getResultList().size();
        usergroups = new Usergroups[count];
        int k = 0;
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          usergroups[k] = (Usergroups) it2.next();
          k++;
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
View Full Code Here

      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session
            .createQuery("select c from Usergroups as c where c.usergroup_id = :usergroup_id");
        query.setParameter("usergroup_id", usergroup_id.longValue());
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups = (Users_Usergroups) it2.next();
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
        //TODO: Benutzer einer gruppe setzten
View Full Code Here

      try {
        Object idf = PersistenceSessionUtil.createSession();
        EntityManager session = PersistenceSessionUtil.getSession();
        EntityTransaction tx = session.getTransaction();
      tx.begin();
        Query query = session
            .createQuery("select c from usergroup_id as c where c.level_id = :level_id");
        query.setParameter("level_id", 1);
        int count = query.getResultList().size();
        groups = new Usergroups[count];
        int k = 0;
        for (Iterator it2 = query.getResultList().iterator(); it2.hasNext();) {
          groups[k] = (Usergroups) it2.next();
          k++;
        }
        tx.commit();
        PersistenceSessionUtil.closeSession(idf);
View Full Code Here

TOP

Related Classes of javax.persistence.Query

Copyright © 2018 www.massapicom. 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.