# HG changeset patch # User Robert Casties # Date 1566828614 -7200 # Node ID 70a02006675ce9827124e027b52c04f2fb124876 # Parent 8dc4ac635d1176c42a0a1dcdf80a86aee8dfba4c New clean actions to delete lost floruit_dates and empty references. diff -r 8dc4ac635d11 -r 70a02006675c src/main/java/org/mpi/openmind/repository/services/PersistenceService.java --- a/src/main/java/org/mpi/openmind/repository/services/PersistenceService.java Wed Aug 21 14:25:42 2019 +0200 +++ b/src/main/java/org/mpi/openmind/repository/services/PersistenceService.java Mon Aug 26 16:10:14 2019 +0200 @@ -1246,10 +1246,8 @@ for (AttributeFilter filter : filters) { hql += " ( "; if (StringUtils.isNotEmpty(filter.getEntObjectClass())) { - hql += "att.sourceObjectClass = :sourceObjectClass" + count - + " "; - if (StringUtils.isNotEmpty(filter.getName()) - || StringUtils.isNotEmpty(filter.getOwnValue())) + hql += "att.sourceObjectClass = :sourceObjectClass" + count + " "; + if (StringUtils.isNotEmpty(filter.getName()) || StringUtils.isNotEmpty(filter.getOwnValue())) hql += " AND "; } if (StringUtils.isNotEmpty(filter.getName())) { @@ -1258,15 +1256,15 @@ hql += " AND "; } if (StringUtils.isNotEmpty(filter.getOwnValue())) { - if (filter.isNormalize()) { - hql += "att.normalizedOwnValue LIKE :ownValue" + count + " "; - } else if (filter.isRegex()) { - hql += "REGEXP(att.ownValue, :ownValue" + count + ") = 1 "; - } else if (filter.isExactMatch()) { - hql += "att.ownValue = :ownValue" + count + " "; - } else { - hql += "att.ownValue LIKE :ownValue" + count + " "; - } + if (filter.isNormalize()) { + hql += "att.normalizedOwnValue LIKE :ownValue" + count + " "; + } else if (filter.isRegex()) { + hql += "REGEXP(att.ownValue, :ownValue" + count + ") = 1 "; + } else if (filter.isExactMatch()) { + hql += "att.ownValue = :ownValue" + count + " "; + } else { + hql += "att.ownValue LIKE :ownValue" + count + " "; + } } hql += " ) "; diff -r 8dc4ac635d11 -r 70a02006675c src/main/java/org/mpi/openmind/repository/services/utils/AttributeFilter.java --- a/src/main/java/org/mpi/openmind/repository/services/utils/AttributeFilter.java Wed Aug 21 14:25:42 2019 +0200 +++ b/src/main/java/org/mpi/openmind/repository/services/utils/AttributeFilter.java Mon Aug 26 16:10:14 2019 +0200 @@ -6,8 +6,14 @@ * @author jurzua */ public class AttributeFilter extends Filter { - private String name; - private String entObjectClass; + public String name; + public String entObjectClass; + + /** + * match if the relation is not present. + */ + public Boolean attributeMissing = false; + public AttributeFilter(){} public AttributeFilter(String name, String value, String entObjectClass){ diff -r 8dc4ac635d11 -r 70a02006675c src/main/java/org/mpi/openmind/repository/services/utils/Filter.java --- a/src/main/java/org/mpi/openmind/repository/services/utils/Filter.java Wed Aug 21 14:25:42 2019 +0200 +++ b/src/main/java/org/mpi/openmind/repository/services/utils/Filter.java Mon Aug 26 16:10:14 2019 +0200 @@ -6,10 +6,10 @@ */ public abstract class Filter { - protected String ownValue; - protected boolean normalize = false; - protected boolean isRegex = false; - protected boolean exactMatch = false; + public String ownValue; + public boolean normalize = false; + public boolean isRegex = false; + public boolean exactMatch = false; public boolean isNormalize() { return normalize;