Examples of from()


Examples of org.infinispan.query.dsl.QueryFactory.from()

   public void testIn1() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      List<Integer> ids = Arrays.asList(1, 3);
      Query q = qf.from(User.class)
            .having("id").in(ids)
            .toBuilder().build();

      List<User> list = q.list();
      assertEquals(2, list.size());
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   }

   public void testIn2() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      Query q = qf.from(User.class)
            .having("id").in(4)
            .toBuilder().build();

      List<User> list = q.list();
      assertEquals(0, list.size());
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn3() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      qf.from(User.class).having("id").in(Collections.emptySet());
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn4() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn4() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      Collection collection = null;
      qf.from(User.class).having("id").in(collection);
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn5() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn5() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      Object[] array = null;
      qf.from(User.class).having("id").in(array);
   }

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn6() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   @Test(expectedExceptions = IllegalArgumentException.class)
   public void testIn6() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      Object[] array = new Object[0];
      qf.from(User.class).having("id").in(array);
   }

   public void testSampleDomainQuery1() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   public void testSampleDomainQuery1() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      // all male users
      Query q = qf.from(User.class)
            .having("gender").eq(User.Gender.MALE)
            .toBuilder().build();

      List<User> list = q.list();
      assertEquals(2, list.size());
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   public void testSampleDomainQuery2() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      // all male users, but this time retrieved in a twisted manner
      Query q = qf.from(User.class)
            .not(qf.having("gender").eq(User.Gender.FEMALE))
            .and(qf.not().not(qf.having("gender").eq(User.Gender.MALE)))
            .toBuilder().build();

      List<User> list = q.list();
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   @Test(enabled = false, description = "String literal escaping is not properly done yet")   //todo [anistor] fix disabled test
   public void testStringEscape() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      // all transactions that have a given description. the description contains characters that need to be escaped.
      Query q = qf.from(Account.class)
            .having("description").eq("John Doe's first bank account")
            .toBuilder().build();

      List<Account> list = q.list();
      assertEquals(1, list.size());
View Full Code Here

Examples of org.infinispan.query.dsl.QueryFactory.from()

   public void testSampleDomainQuery3() throws Exception {
      QueryFactory qf = Search.getQueryFactory(remoteCache);

      // all male users
      Query q = qf.from(User.class)
            .having("gender").eq(User.Gender.MALE)
            .toBuilder().build();

      List<User> list = q.list();
      assertEquals(2, list.size());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.