Package org.hibernate.criterion

Examples of org.hibernate.criterion.DetachedCriteria.createAlias()


    }
    if(StringUtils.isNotBlank(leave.getLeaveType())) {
      dc.add(Restrictions.like("leaveType", leave.getLeaveType()));
    }
    dc.add(Restrictions.eq("delFlag", Leave.DEL_FLAG_NORMAL));
    dc.createAlias("createBy", "createBy");
    dc.createAlias("createBy.office", "office");
    dc.add(dataScopeFilter(UserUtils.getUser(), "office", "createBy"));
    dc.addOrder(Order.desc("id"));
      return leaveDao.find(page, dc);
  }
View Full Code Here


    if(StringUtils.isNotBlank(leave.getLeaveType())) {
      dc.add(Restrictions.like("leaveType", leave.getLeaveType()));
    }
    dc.add(Restrictions.eq("delFlag", Leave.DEL_FLAG_NORMAL));
    dc.createAlias("createBy", "createBy");
    dc.createAlias("createBy.office", "office");
    dc.add(dataScopeFilter(UserUtils.getUser(), "office", "createBy"));
    dc.addOrder(Order.desc("id"));
      return leaveDao.find(page, dc);
  }
View Full Code Here

        && updateExpiredWeightDate.getTime() < new Date().getTime())){
      articleDao.updateExpiredWeight();
      CacheUtils.put("updateExpiredWeightDateByArticle", DateUtils.addHours(new Date(), 6));
    }
    DetachedCriteria dc = articleDao.createDetachedCriteria();
    dc.createAlias("category", "category");
    dc.createAlias("category.site", "category.site");
    if (article.getCategory()!=null && StringUtils.isNotBlank(article.getCategory().getId()) && !Category.isRoot(article.getCategory().getId())){
      Category category = categoryDao.get(article.getCategory().getId());
      if (category!=null){
        dc.add(Restrictions.or(
View Full Code Here

      articleDao.updateExpiredWeight();
      CacheUtils.put("updateExpiredWeightDateByArticle", DateUtils.addHours(new Date(), 6));
    }
    DetachedCriteria dc = articleDao.createDetachedCriteria();
    dc.createAlias("category", "category");
    dc.createAlias("category.site", "category.site");
    if (article.getCategory()!=null && StringUtils.isNotBlank(article.getCategory().getId()) && !Category.isRoot(article.getCategory().getId())){
      Category category = categoryDao.get(article.getCategory().getId());
      if (category!=null){
        dc.add(Restrictions.or(
            Restrictions.eq("category.id", category.getId()),
View Full Code Here

    }
    if (article.getCreateBy()!=null && StringUtils.isNotBlank(article.getCreateBy().getId())){
      dc.add(Restrictions.eq("createBy.id", article.getCreateBy().getId()));
    }
    if (isDataScopeFilter){
      dc.createAlias("category.office", "categoryOffice").createAlias("createBy", "createBy");
      dc.add(dataScopeFilter(UserUtils.getUser(), "categoryOffice", "createBy"));
    }
    dc.add(Restrictions.eq(Article.FIELD_DEL_FLAG, article.getDelFlag()));
    if (StringUtils.isBlank(page.getOrderBy())){
      dc.addOrder(Order.desc("weight"));
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.