コード例 #1
0
  /** @see com.manpower.portal.mpnet.dao.interfaces.DAO#findByID(java.io.Serializable) */
  public Object findByID(Serializable id) {

    Session session = HibernateUtil.getCurrentSession();

    Object question = session.get(SteeringQuestion.class, id);

    return question;
  }
コード例 #2
0
 public List<ApplicantSearchGeoCode> getApplicantGeoLocationsByIds(List<Long> idList) {
   // TODO Auto-generated method stub
   Session session = HibernateUtil.getCurrentSession();
   Criteria criteria = session.createCriteria(ApplicantSearchGeoCode.class);
   criteria.add(Restrictions.in("id", idList));
   criteria.addOrder(Order.asc("id"));
   List<ApplicantSearchGeoCode> results = criteria.list();
   return results;
 }
コード例 #3
0
 public List<ApplicantSearchGeoCode> getApplicantGeoLocations(
     long siteId, int fromIndex, int toIndex) {
   // TODO Auto-generated method stub
   Session session = HibernateUtil.getCurrentSession();
   Criteria criteria = session.createCriteria(ApplicantSearchGeoCode.class);
   criteria.add(Restrictions.eq("siteId", Long.valueOf(siteId)));
   criteria.addOrder(Order.asc("id"));
   criteria.setFirstResult(fromIndex + 1);
   criteria.setMaxResults(toIndex - fromIndex + 1);
   List<ApplicantSearchGeoCode> results = criteria.list();
   return results;
 }
コード例 #4
0
  /** Find legal questions by Site and language */
  public List findLegalQuestions(long siteId, String language) {

    Session session = HibernateUtil.getCurrentSession();

    Criteria query = session.createCriteria(SteeringQuestion.class);

    //	Alexander Todorov;
    //	We will search for specified language if it is not empty or null.
    //	Else we will search questions for a site.

    if (language != null && language.trim().length() > 0) {

      query.add(Restrictions.eq("language", language));
    }

    query.add(Restrictions.eq("siteId", new Long(siteId)));
    query.add(Restrictions.eq("questionType", "LGL"));
    query.addOrder(Order.asc("questionId"));
    return query.list();
  }
コード例 #5
0
 /** @see com.manpower.portal.mpnet.dao.abstracts.DAOFactory#getCandidateEducationDAO() */
 public CandidateEducationDAO getCandidateEducationDAO() {
   Session session = com.manpower.j2ee.util.hibernate.HibernateUtil.getCurrentSession();
   return new CandidateEducationDAOHibernate(session);
 }
コード例 #6
0
 /** @see com.manpower.portal.mpnet.dao.abstracts.DAOFactory#getAdvertisementDAO() */
 public AdvertisementDAO getAdvertisementDAO() {
   Session session = com.manpower.j2ee.util.hibernate.HibernateUtil.getCurrentSession();
   return new AdvertisementDAOHibernate(session);
 }
コード例 #7
0
 /**
  * Get Hibernate session
  *
  * @return Current Hibernate session
  */
 protected Session getCurrentSession() {
   Session session = com.manpower.j2ee.util.hibernate.HibernateUtil.getCurrentSession();
   return session;
 }