Package org.infinispan.objectfilter

Examples of org.infinispan.objectfilter.ObjectFilter$FilterResult


         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      ObjectFilter objectFilter = matcher.getObjectFilter(filterSubscription);

      matcher.match(person);
      assertEquals(1, matchCount[0]);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);

      assertEquals(1, matchCount[0]); // check that the object filter did not also mistakenly trigger a match in the parent matcher
   }
View Full Code Here


      String queryString = "from org.infinispan.objectfilter.test.model.Person p where p.name = 'John'";

      Matcher matcher = createMatcher();
      Object person = createPerson1();

      ObjectFilter objectFilter = matcher.getObjectFilter(queryString);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

            .having("id").lt(1000)
            .and()
            .having("age").lt(1000)
            .toBuilder().build();

      ObjectFilter objectFilter = matcher.getObjectFilter(q);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

      Query q = qf.from(Person.class)
            .having("name").like("Jo%")
            .and(qf.not().having("name").like("Jo%").or().having("id").lt(1000))
            .toBuilder().build();

      ObjectFilter objectFilter = matcher.getObjectFilter(q);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            b[0] = true;
         }
      });

      ObjectFilter objectFilter = matcher.getObjectFilter(filterSubscription);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);

      matcher.match(person);
      assertTrue(b[0]);
View Full Code Here

      QueryFactory qf = matcher.getQueryFactory();
      Query q = qf.from(Person.class)
            .having("name").eq("John").toBuilder().build();

      ObjectFilter objectFilter = matcher.getObjectFilter(q);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertNotNull(result);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

   protected long measureFilter(String query) throws Exception {
      Matcher matcher = createMatcher();

      Object obj = createPerson1();

      ObjectFilter objectFilter = matcher.getObjectFilter(query);

      long stime = System.nanoTime();
      for (int i = 0; i < ITERATIONS; i++) {
         ObjectFilter.FilterResult result = objectFilter.filter(obj);
         assertNotNull(result);
      }
      return System.nanoTime() - stime;
   }
View Full Code Here

            };
            predicateIndex.addSubscriptionForPredicate(predicateNode, predicateCallback);
         }
      }

      return new ObjectFilter() {

         @Override
         public String getEntityTypeName() {
            return filterSubscriptionImpl.getEntityTypeName();
         }
View Full Code Here

         public void onFilterResult(Object instance, Object[] projection, Comparable[] sortProjection) {
            matchCount[0]++;
         }
      });

      ObjectFilter objectFilter = matcher.getObjectFilter(filterSubscription);

      matcher.match(person);
      assertEquals(1, matchCount[0]);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);

      assertEquals(1, matchCount[0]); // check that the object filter did not also mistakenly trigger a match in the parent matcher
   }
View Full Code Here

      String queryString = "from org.infinispan.objectfilter.test.model.Person p where p.name = 'John'";

      Matcher matcher = createMatcher();
      Object person = createPerson1();

      ObjectFilter objectFilter = matcher.getObjectFilter(queryString);

      matcher.match(person);

      ObjectFilter.FilterResult result = objectFilter.filter(person);
      assertTrue(result.getInstance() == person);
   }
View Full Code Here

TOP

Related Classes of org.infinispan.objectfilter.ObjectFilter$FilterResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.