@Test public void testFullPredicateExtraction() { FilterExpression expression = new InPredicate(new Path(Book.class, dictionary, "genre"), "Literary Fiction"); FilterExpression extracted = FilterPredicatePushdownExtractor.extractPushDownPredicate(dictionary, expression); assertEquals(expression, extracted); }
public static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression) { FilterExpressionNormalizationVisitor normalizationVisitor = new FilterExpressionNormalizationVisitor(); FilterExpression normalizedExpression = expression.accept(normalizationVisitor); FilterPredicatePushdownExtractor verifier = new FilterPredicatePushdownExtractor(dictionary); return normalizedExpression.accept(verifier); }
FilterPredicatePushdownExtractor implements FilterExpressionVisitor<FilterExpression> { public static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression) { FilterExpressionNormalizationVisitor normalizationVisitor = new FilterExpressionNormalizationVisitor(); FilterExpression normalizedExpression = expression.accept(normalizationVisitor); FilterPredicatePushdownExtractor verifier = new FilterPredicatePushdownExtractor(dictionary); return normalizedExpression.accept(verifier); } }
FilterPredicatePushdownExtractor implements FilterExpressionVisitor<FilterExpression> { public static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression) { FilterExpressionNormalizationVisitor normalizationVisitor = new FilterExpressionNormalizationVisitor(); FilterExpression normalizedExpression = expression.accept(normalizationVisitor); FilterPredicatePushdownExtractor verifier = new FilterPredicatePushdownExtractor(dictionary); return normalizedExpression.accept(verifier); } FilterPredicatePushdownExtractor(EntityDictionary dictionary); }
FilterPredicatePushdownExtractor implements FilterExpressionVisitor<FilterExpression> { public static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression) { FilterExpressionNormalizationVisitor normalizationVisitor = new FilterExpressionNormalizationVisitor(); FilterExpression normalizedExpression = expression.accept(normalizationVisitor); FilterPredicatePushdownExtractor verifier = new FilterPredicatePushdownExtractor(dictionary); return normalizedExpression.accept(verifier); } FilterPredicatePushdownExtractor(EntityDictionary dictionary); @Override FilterExpression visitPredicate(FilterPredicate filterPredicate); @Override FilterExpression visitAndExpression(AndFilterExpression expression); @Override FilterExpression visitOrExpression(OrFilterExpression expression); @Override FilterExpression visitNotExpression(NotFilterExpression expression); static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression); }
FilterPredicatePushdownExtractor implements FilterExpressionVisitor<FilterExpression> { public static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression) { FilterExpressionNormalizationVisitor normalizationVisitor = new FilterExpressionNormalizationVisitor(); FilterExpression normalizedExpression = expression.accept(normalizationVisitor); FilterPredicatePushdownExtractor verifier = new FilterPredicatePushdownExtractor(dictionary); return normalizedExpression.accept(verifier); } FilterPredicatePushdownExtractor(EntityDictionary dictionary); @Override FilterExpression visitPredicate(FilterPredicate filterPredicate); @Override FilterExpression visitAndExpression(AndFilterExpression expression); @Override FilterExpression visitOrExpression(OrFilterExpression expression); @Override FilterExpression visitNotExpression(NotFilterExpression expression); static FilterExpression extractPushDownPredicate(EntityDictionary dictionary, FilterExpression expression);  }