Project

General

Profile

« Previous | Next » 

Revision ea92da24

Added by Andreas Kohlbecker over 5 years ago

fixing wrong boolean operator combination for Restrictions with operator AND_NOT

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/CdmEntityDaoBase.java
591 591
                        logger.debug("addRestrictions() predicate with " + propertyName + " " + (restriction.getMatchMode() == null ? "=" : restriction.getMatchMode().name()) + " " + v.toString());
592 592
                    }
593 593
                }
594
                perProperty.add(new CriterionWithOperator(restriction.getOperator(), Restrictions.or(predicates)));
594
                if(restriction.getOperator() == Operator.AND_NOT){
595
                    perProperty.add(new CriterionWithOperator(restriction.getOperator(), Restrictions.and(predicates)));
596
                } else {
597
                    perProperty.add(new CriterionWithOperator(restriction.getOperator(), Restrictions.or(predicates)));
598
                }
595 599
            } // check has values
596 600
        } // loop over restrictions
597 601

  

Also available in: Unified diff