Package com.github.dactiv.orm.core

Examples of com.github.dactiv.orm.core.MatchValue


  public Predicate build(PropertyFilter filter,SpecificationEntity entity) {

    String matchValue = filter.getMatchValue();
    Class<?> FieldType = filter.getFieldType();
   
    MatchValue matchValueModel = getMatchValue(matchValue, FieldType);
   
    Predicate predicate = null;
   
    if (matchValueModel.hasOrOperate()) {
      predicate = entity.getBuilder().disjunction();
    } else {
      predicate = entity.getBuilder().conjunction();
    }
   
    for (Object value : matchValueModel.getValues()) {
      if (filter.hasMultiplePropertyNames()) {
        for (String propertyName:filter.getPropertyNames()) {
          predicate.getExpressions().add(build(propertyName, value, entity));
        }
      } else {
View Full Code Here


   */
  public Criterion build(PropertyFilter filter) {
    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));
View Full Code Here

  /*
   * (non-Javadoc)
   * @see com.github.dactiv.orm.core.spring.data.jpa.restriction.PredicateSingleValueSupport#getMatchValue(java.lang.String, java.lang.Class)
   */
  public MatchValue getMatchValue(String matchValue, Class<?> FieldType) {
    MatchValue matchValueModel = super.getMatchValue(matchValue, FieldType);
    for (int i = 0; i < matchValueModel.getValues().size(); i++) {
      Object value = matchValueModel.getValues().get(i);
      if (value instanceof String && StringUtils.equals(value.toString(),"null")) {
        matchValueModel.getValues().remove(i);
        matchValueModel.getValues().add(i, null);
      }
    }
    return matchValueModel;
  }
View Full Code Here

   * (non-Javadoc)
   * @see com.github.dactiv.orm.core.hibernate.restriction.CriterionSingleValueSupport#getMatchValue(java.lang.String, java.lang.Class)
   */
  public MatchValue getMatchValue(String matchValue, Class<?> FieldType) {
   
    MatchValue matchValueModel = super.getMatchValue(matchValue, FieldType);
    for (int i = 0; i < matchValueModel.getValues().size(); i++) {
      Object value = matchValueModel.getValues().get(i);
      if (value instanceof String && StringUtils.equals(value.toString(),"null")) {
        matchValueModel.getValues().remove(i);
        matchValueModel.getValues().add(i, null);
      }
    }
    return matchValueModel;
  }
View Full Code Here

TOP

Related Classes of com.github.dactiv.orm.core.MatchValue

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.