private String toStringFromTo() { if (isNullRestriction()) { return "is null"; } else if (isNotNullRestriction()) { return "is not null"; } String f = first == null ? "" : first.toString(); String l = last == null ? "" : last.toString(); if (f.equals(l)) { return f; } String fi = first == null ? "" : (firstIncluding ? "[" : "("); String li = last == null ? "" : (lastIncluding ? "]" : ")"); return fi + f + ".." + l + li; }
/** * Add a restriction for the given property, unless the exact same * restriction is already set. * * @param restriction the restriction to add */ private void addRestriction(PropertyRestriction restriction) { List<PropertyRestriction> list = getPropertyRestrictions(restriction.propertyName); for (PropertyRestriction old : list) { if (old.equals(restriction)) { return; } } list.add(restriction); }
@Override public PropertyRestriction getPropertyRestriction(String propertyName) { List<PropertyRestriction> list = propertyRestrictions.get(propertyName); if (list.isEmpty()) { return null; } else if (list.size() == 1) { return list.get(0); } int bestSort = -1; PropertyRestriction best = null; for (PropertyRestriction x : list) { int sort = x.sortOrder(); if (sort > bestSort) { bestSort = sort; best = x; } } return best; }
if (propertyRestrictions != null && !propertyRestrictions.isEmpty()) { for (Filter.PropertyRestriction pr : propertyRestrictions) { if (pr.isNullRestriction()) {
boolean addExplain = restriction != null && restriction.isNotNullRestriction();
boolean addExplain = restriction != null && restriction.isNotNullRestriction();
if (propertyRestrictions != null && !propertyRestrictions.isEmpty()) { for (Filter.PropertyRestriction pr : propertyRestrictions) { if (pr.isNullRestriction()) {
if (pr.isNullRestriction() && !pd.nullCheckEnabled){ continue;
int propType = determinePropertyType(defn, pr); if (pr.isNullRestriction()) { return new TermQuery(new Term(FieldNames.NULL_PROPS, defn.name)); if (pr.isNotNullRestriction() && defn.notNullCheckEnabled) { return new TermQuery(new Term(FieldNames.NOT_NULL_PROPS, defn.name)); } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { return new TermRangeQuery(propertyName, null, null, true, true);
int propType = determinePropertyType(defn, pr); if (pr.isNullRestriction()) { return new TermQuery(new Term(FieldNames.NULL_PROPS, defn.name)); if (pr.isNotNullRestriction() && defn.notNullCheckEnabled) { return new TermQuery(new Term(FieldNames.NOT_NULL_PROPS, defn.name)); } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { } else if (pr.isNotNullRestriction()) { return new TermRangeQuery(propertyName, null, null, true, true);
boolean addExcerpt = restriction != null && restriction.isNotNullRestriction();
OrderEntry oe = orders.get(i); PropertyDefinition pd = planResult.getOrderedProperty(i); PropertyRestriction orderRest = new PropertyRestriction(); orderRest.propertyName = oe.getPropertyName(); Query q = createQuery(oe.getPropertyName(), orderRest, pd);
boolean addExcerpt = restriction != null && restriction.isNotNullRestriction();
if (restriction.isNullRestriction()) {
if (restriction.isNullRestriction()) {
if (restriction.isNullRestriction()) {
OrderEntry oe = orders.get(i); PropertyDefinition pd = planResult.getOrderedProperty(i); PropertyRestriction orderRest = new PropertyRestriction(); orderRest.propertyName = oe.getPropertyName(); Query q = createQuery(oe.getPropertyName(), orderRest, pd);
public void restrictProperty(String propertyName, Operator op, PropertyValue v, int propertyType) { PropertyRestriction x = new PropertyRestriction(); x.propertyName = propertyName; x.propertyType = propertyType;
public void restrictProperty(String propertyName, Operator op, PropertyValue v, int propertyType) { PropertyRestriction x = new PropertyRestriction(); x.propertyName = propertyName; x.propertyType = propertyType;