Package org.hibernate

Examples of org.hibernate.Criteria.list()


    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(RightsGroup.class);
      c.add(Restrictions.idEq(groupID));
      List<RightsGroup> lstRights = c.list();
      if(lstRights != null && lstRights.size() > 0) {
        group = lstRights.get(0);
      }
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
View Full Code Here


    try {
      sessionFactory = HibernateSessionFactory.getInstance();
      session = sessionFactory.openSession();
      Criteria c = session.createCriteria(BaseRight.class);
      c.add(Restrictions.idEq(baseRightID));
      List<BaseRight> lstRights = c.list();
      if(lstRights != null && lstRights.size() > 0) {
        baseRight = lstRights.get(0);
      }
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
View Full Code Here

     
      if(group != null) {
        c.add(Restrictions.eq("rightGroup", group));
      }
     
      return c.list();
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
      close(sessionFactory, session);
    }
View Full Code Here

      }
      if(entity != null) {
        DefaultPermissionEntity defaultEntity = new DefaultPermissionEntity(entity);
        criteria.add(Restrictions.eq("entity", defaultEntity));
      }
      return criteria.list();   
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
      close(sessionFactory, session);
    }
View Full Code Here

        // fillRelevantProjects(fromProjectList, toProjectList, user,
        // projectStatus);
      }

      System.out.println("ProjectManagerImpl.getAllProjects() ended ");
      return criteria.list();
      // return toProjectList;

    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
View Full Code Here

      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOCustomField.class);
      criteria.add(Restrictions.ilike("customFieldModule", "tasks"));
      criteria.add(Restrictions.ilike("customFieldName", "Module"));
      BOCustomField.CustomTaskModule = (BOCustomField) criteria.list().get(0);
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
      close(sessionFactory, session);
    }
View Full Code Here

     
     
      if(user.getUserType()==UserType.Administrator)
      {
        Criteria criteria = session.createCriteria(BOCompany.class);
        return criteria.list();
      }
     
      else
      {
        ArrayList<BOCompany> companyList = new ArrayList<BOCompany>();
View Full Code Here

     
     
      if(user.getUserType()==UserType.Administrator)
      {
        Criteria criteria = session.createCriteria(BODepartment.class);
        return criteria.list();
      }
     
      else
      {
        ArrayList<BODepartment> departmentList = new ArrayList<BODepartment>();
View Full Code Here

      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOUser.class);
      session.flush();
     
      return criteria.list();
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
      close(sessionFactory, session);
    }
View Full Code Here

      session = sessionFactory.openSession();

      Criteria criteria = session.createCriteria(BOUser.class);
     
      criteria.add(Restrictions.in("userID", ids));
      return criteria.list();
    } catch (Exception a_th) {
      throw new RuntimeException(a_th);
    } finally {
      close(sessionFactory, session);
    }
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.