Examples of EqCriterion


Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of eq method, of class CriteriaQuery.
     */
    @Test
    public void testEq() {
      assertEquals(new EqCriterion("name", "abc"), instance.eq("name", "abc").getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of isTrue method, of class CriteriaQuery.
     */
    @Test
    public void testIsTrue() {
      assertEquals(new EqCriterion("name", true), instance.isTrue("name").getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of isFalse method, of class CriteriaQuery.
     */
    @Test
    public void testIsFalse() {
      assertEquals(new EqCriterion("name", false), instance.isFalse("name").getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

     * Test of isBlank method, of class CriteriaQuery.
     */
    @Test
    public void testIsBlank() {
        QueryCriterion criterion1 = new IsNullCriterion("name");
        QueryCriterion criterion2 = new EqCriterion("name", "");
        QueryCriterion criterion3 = new OrCriterion(criterion1, criterion2);
       
        assertEquals(criterion3, instance.isBlank("name").getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of not method, of class CriteriaQuery.
     */
    @Test
    public void testNot() {
        QueryCriterion criterion1 = new EqCriterion("name", "abc");
        QueryCriterion criterion2 = new NotCriterion(criterion1);
       
        assertEquals(criterion2, instance.not(criterion1).getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of and method, of class CriteriaQuery.
     */
    @Test
    public void testAnd() {
        QueryCriterion criterion1 = new EqCriterion("name", "abc");
        QueryCriterion criterion2 = new GtCriterion("id", 5);
        QueryCriterion criterion3 = new AndCriterion(criterion1, criterion2);
       
        assertEquals(criterion3, instance.and(criterion1, criterion2).getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

    /**
     * Test of or method, of class CriteriaQuery.
     */
    @Test
    public void testOr() {
        QueryCriterion criterion1 = new EqCriterion("name", "abc");
        QueryCriterion criterion2 = new GtCriterion("id", 5);
        QueryCriterion criterion3 = new OrCriterion(criterion1, criterion2);
       
        assertEquals(criterion3, instance.or(criterion1, criterion2).getQueryCriterion());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

        assertEquals("abc", instance.singleResult());
    }
   
    @Test
    public void testGetQueryString() {
      EqCriterion criterion1 = new EqCriterion("name", "abc");
      InCriterion criterion2 = new InCriterion("age", Arrays.asList(1, 2));
        instance.eq("name", "abc")
                        .isEmpty("post")
                        .notNull("birthday")
                        .in("age", Arrays.asList(1, 2))
                        .getQueryString();       
        assertEquals("select distinct(rootEntity) from org.dayatang.domain.entity.MyEntity as rootEntity  "
                + "where rootEntity.name = :rootEntity_name" + criterion1.hashCode() + " "
                + "and rootEntity.post is empty "
                + "and rootEntity.birthday is not null "
                + "and rootEntity.age in :rootEntity_age" + criterion2.hashCode(),
                instance.getQueryString());
        assertEquals(NamedParameters.create()
                .add("rootEntity_name" + criterion1.hashCode(), "abc")
                .add("rootEntity_age" + criterion2.hashCode(), Arrays.asList(1, 2)),
                instance.getParameters());
    }
View Full Code Here

Examples of org.dayatang.domain.internal.EqCriterion

                instance.getParameters());
    }
   
    @Test
    public void testGetQueryString2() {
      EqCriterion criterion1 = new EqCriterion("name", "abc");
      InCriterion criterion2 = new InCriterion("age", Arrays.asList(1, 2));
     
     
        assertEquals("select distinct(rootEntity) from org.dayatang.domain.entity.MyEntity as rootEntity  "
                + "where rootEntity.name = :rootEntity_name" + criterion1.hashCode() + " "
                + "and rootEntity.post is empty "
                + "and rootEntity.birthday is not null "
                + "and rootEntity.age in :rootEntity_age" + criterion2.hashCode() + " "
                + "order by rootEntity.name asc",
                instance.eq("name", "abc")
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.