Examples of from()


Examples of org.h2.jaqu.Db.from()

    public void test() throws Exception {
        Db db = Db.open("jdbc:h2:mem:", "sa", "sa");
        db.insertAll(Product.getList());

        Product p = new Product();
        List<Product> products = db
            .from(p)
            .where(p.unitsInStock).is(9)
            .orderBy(p.productId).select();

        assertEquals("[]", products.toString());
View Full Code Here

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

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

      //test for parenthesis, "and" should have higher priority
      Query q = qf.from(User.class)
            .having("name").eq("Spider")
            .or(qf.having("name").eq("John"))
            .and(qf.having("surname").eq("Man"))
            .toBuilder().build();
View Full Code Here

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").contains(42)
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAll(1, 2)
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAll(Collections.singleton(1))
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAll(1, 2, 3)
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAll(Collections.emptySet())
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .orderBy("id", SortOrder.ASC)
            .having("accountIds").containsAny(2, 3)
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAny(4, 5)
            .toBuilder().build();

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

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

   }

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

      Query q = qf.from(User.class)
            .having("accountIds").containsAny(Collections.emptySet())
            .toBuilder().build();

      List<User> list = q.list();
      assertEquals(3, 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.