@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: (b,c) > (?, ?) AND b < ? if (!otherRestriction.isMultiColumn() && ((SingleColumnRestriction) otherRestriction).canBeConvertedToMultiColumnRestriction()) { return doMergeWith(((SingleColumnRestriction) otherRestriction).toMultiColumnRestriction()); } return doMergeWith(otherRestriction); }
/** * Returns the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. * * @param otherRestriction the other restrictions * @return the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. */ protected final String getColumnsInCommons(Restriction otherRestriction) { Set<ColumnDefinition> commons = new HashSet<>(getColumnDefs()); commons.retainAll(otherRestriction.getColumnDefs()); StringBuilder builder = new StringBuilder(); for (ColumnDefinition columnDefinition : commons) { if (builder.length() != 0) builder.append(" ,"); builder.append(columnDefinition.name); } return builder.toString(); }
@Override public final boolean hasSupportingIndex(SecondaryIndexManager indexManager) { for (Index index : indexManager.listIndexes()) if (isSupportedBy(index)) return true; return false; }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: b > ? AND (b,c) < (?, ?) if (otherRestriction.isMultiColumn() && canBeConvertedToMultiColumnRestriction()) { return toMultiColumnRestriction().mergeWith(otherRestriction); } return doMergeWith(otherRestriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: b > ? AND (b,c) < (?, ?) if (otherRestriction.isMultiColumn() && canBeConvertedToMultiColumnRestriction()) { return toMultiColumnRestriction().mergeWith(otherRestriction); } return doMergeWith(otherRestriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: b > ? AND (b,c) < (?, ?) if (otherRestriction.isMultiColumn() && canBeConvertedToMultiColumnRestriction()) { return toMultiColumnRestriction().mergeWith(otherRestriction); } return doMergeWith(otherRestriction); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: (b,c) > (?, ?) AND b < ? if (!otherRestriction.isMultiColumn() && ((SingleColumnRestriction) otherRestriction).canBeConvertedToMultiColumnRestriction()) { return doMergeWith(((SingleColumnRestriction) otherRestriction).toMultiColumnRestriction()); } return doMergeWith(otherRestriction); }
@Override public final boolean hasSupportingIndex(SecondaryIndexManager indexManager) { for (Index index : indexManager.listIndexes()) if (isSupportedBy(index)) return true; return false; }
/** * Returns the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. * * @param otherRestriction the other restrictions * @return the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. */ protected final String getColumnsInCommons(Restriction otherRestriction) { Set<ColumnDefinition> commons = new HashSet<>(getColumnDefs()); commons.retainAll(otherRestriction.getColumnDefs()); StringBuilder builder = new StringBuilder(); for (ColumnDefinition columnDefinition : commons) { if (builder.length() != 0) builder.append(" ,"); builder.append(columnDefinition.name); } return builder.toString(); }
@Override public final SingleRestriction mergeWith(SingleRestriction otherRestriction) { // We want to allow query like: (b,c) > (?, ?) AND b < ? if (!otherRestriction.isMultiColumn() && ((SingleColumnRestriction) otherRestriction).canBeConvertedToMultiColumnRestriction()) { return doMergeWith(((SingleColumnRestriction) otherRestriction).toMultiColumnRestriction()); } return doMergeWith(otherRestriction); }
@Override public final boolean hasSupportingIndex(SecondaryIndexManager indexManager) { for (Index index : indexManager.listIndexes()) if (isSupportedBy(index)) return true; return false; }
/** * Returns the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. * * @param otherRestriction the other restrictions * @return the names of the columns that are specified within this <code>Restrictions</code> and the other one * as a comma separated <code>String</code>. */ protected final String getColumnsInCommons(Restriction otherRestriction) { Set<ColumnDefinition> commons = new HashSet<>(getColumnDefs()); commons.retainAll(otherRestriction.getColumnDefs()); StringBuilder builder = new StringBuilder(); for (ColumnDefinition columnDefinition : commons) { if (builder.length() != 0) builder.append(" ,"); builder.append(columnDefinition.name); } return builder.toString(); }