Package org.hibernate.criterion

Examples of org.hibernate.criterion.Junction


    String matchValue = filter.getMatchValue();
    Class<?> FieldType = filter.getFieldType();
   
    MatchValue matchValueModel = getMatchValue(matchValue, FieldType);
   
    Junction criterion = null;
   
    if (matchValueModel.hasOrOperate()) {
      criterion = Restrictions.disjunction();
    } else {
      criterion = Restrictions.conjunction();
    }
   
    for (Object value : matchValueModel.getValues()) {
     
      if (filter.hasMultiplePropertyNames()) {
        List<Criterion> disjunction = new ArrayList<Criterion>();
        for (String propertyName:filter.getPropertyNames()) {
          disjunction.add(build(propertyName,value));
        }
        criterion.add(Restrictions.or(disjunction.toArray(new Criterion[disjunction.size()])));
      } else {
        criterion.add(build(filter.getSinglePropertyName(),value));
      }
     
    }
   
    return criterion;
View Full Code Here


            WeblogEntryData current, String catName, int maxEntries, boolean next)
            throws RollerException {
        if (catName != null && catName.trim().equals("/")) {
            catName = null;
        }
        Junction conjunction = Expression.conjunction();
        conjunction.add(Expression.eq("website", current.getWebsite()));
        conjunction.add(Expression.eq("status", WeblogEntryData.PUBLISHED));
       
        if (next) {
            conjunction.add(Expression.gt("pubTime", current.getPubTime()));
        } else {
            conjunction.add(Expression.lt("pubTime", current.getPubTime()));
        }
       
        if (catName != null) {
            WeblogCategoryData category =
                    getWeblogCategoryByPath(current.getWebsite(), null, catName);
            if (category != null) {
                conjunction.add(Expression.eq("category", category));
            } else {
                throw new RollerException("Cannot find category: "+catName);
            }
        }
       
View Full Code Here

           
            String spamwords = RollerRuntimeConfig.getProperty("spam.blacklist");
           
            String[] blacklist = StringUtils.split(
                    StringUtils.deleteWhitespace(spamwords),",");
            Junction or = Expression.disjunction();
            for (int i=0; i<blacklist.length; i++) {
                String ignoreWord = blacklist[i].trim();
                //log.debug("including ignore word - "+ignoreWord);
                or.add(Expression.ilike("refererUrl","%"+ignoreWord+"%"));
            }
            criteria.add(Expression.conjunction()
            .add(Expression.disjunction().add(Expression.isNull("excerpt")).add(Expression.eq("excerpt", "")))
            .add(or)
            );
View Full Code Here

           
            String[] blacklist = StringUtils.split(
                    StringUtils.deleteWhitespace(website.getBlacklist()),",");
            if (blacklist.length == 0) return;
           
            Junction or = Expression.disjunction();
            for (int i=0; i<blacklist.length; i++) {
                String ignoreWord = blacklist[i].trim();
                or.add(Expression.ilike("refererUrl","%"+ignoreWord+"%"));
            }
            criteria.add(Expression.conjunction()
            .add(Expression.disjunction().add(Expression.isNull("excerpt")).add(Expression.eq("excerpt", "")))
            .add(Expression.eq("website",website))
            .add(or)
View Full Code Here

       
        try {
            Session session = ((HibernatePersistenceStrategy)strategy).getSession();
            Criteria criteria = session.createCriteria(RefererData.class);
           
            Junction conjunction = Expression.conjunction();
            conjunction.add(Expression.eq("website", website));
            conjunction.add(Expression.eq("requestUrl", requestUrl));
           
            Junction disjunction = Expression.conjunction();
            disjunction.add(Expression.eq("title", title));
            disjunction.add(Expression.eq("excerpt", excerpt));
           
            criteria.add(conjunction);
            criteria.add(disjunction);
           
            return criteria.list();
View Full Code Here

      junction.add(criterion);
  }

  private void addLogical(SimpleTwitterCriterion customCriterion,
      Junction junction) {
    Junction subJunction = addLogical(customCriterion);
    if (subJunction != null)
      junction.add(subJunction);
  }
View Full Code Here

      junction.add(subJunction);
  }

  private void addLogical(SimpleTwitterCriterion customCriterion,
      Criteria criteria) {
    Junction junction = addLogical(customCriterion);
    if (junction != null)
      criteria.add(junction);
  }
View Full Code Here

      criteria.add(junction);
  }

  private Junction addLogical(SimpleTwitterCriterion customCriterion) {
    SimpleTwitterCriterion.OPERATION oper = customCriterion.getOperation();
    Junction junction = null;
    switch (oper) {
    case AND:
      junction = Restrictions.conjunction();
      break;
    case OR:
View Full Code Here

           
            String spamwords = RollerRuntimeConfig.getProperty("spam.blacklist");
           
            String[] blacklist = StringUtils.split(
                    StringUtils.deleteWhitespace(spamwords),",");
            Junction or = Expression.disjunction();
            for (int i=0; i<blacklist.length; i++) {
                String ignoreWord = blacklist[i].trim();
                //log.debug("including ignore word - "+ignoreWord);
                or.add(Expression.ilike("refererUrl","%"+ignoreWord+"%"));
            }
            criteria.add(Expression.conjunction()
            .add(Expression.disjunction().add(Expression.isNull("excerpt")).add(Expression.eq("excerpt", "")))
            .add(or)
            );
View Full Code Here

           
            String[] blacklist = StringUtils.split(
                    StringUtils.deleteWhitespace(website.getBlacklist()),",");
            if (blacklist.length == 0) return;
           
            Junction or = Expression.disjunction();
            for (int i=0; i<blacklist.length; i++) {
                String ignoreWord = blacklist[i].trim();
                or.add(Expression.ilike("refererUrl","%"+ignoreWord+"%"));
            }
            criteria.add(Expression.conjunction()
            .add(Expression.disjunction().add(Expression.isNull("excerpt")).add(Expression.eq("excerpt", "")))
            .add(Expression.eq("website",website))
            .add(or)
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Junction

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.