Package org.dayatang.domain

Examples of org.dayatang.domain.QueryCriterion


    /**
     * 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


    /**
     * Test of notBlank method, of class CriteriaQuery.
     */
    @Test
    public void testNotBlank() {
        QueryCriterion criterion1 = new NotNullCriterion("name");
        QueryCriterion criterion2 = new NotEqCriterion("name", "");
        QueryCriterion criterion3 = new AndCriterion(criterion1, criterion2);
       
        assertEquals(criterion3, instance.notBlank("name").getQueryCriterion());
    }
View Full Code Here

    /**
     * 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

    /**
     * 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

    /**
     * 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

        assertFalse(results.contains(undergraduate));
    }

    @Test
    public void testAnd() {
        QueryCriterion or = criterionBuilder.or(criterionBuilder.eq("code", "01"), criterionBuilder.eq("code", "02"));
        instance.and(or, criterionBuilder.eq("category", gender));
       
        System.out.println("--------------------------------");
        System.out.println(instance.getQueryString());
        System.out.println(instance.getParameters().getParams());
View Full Code Here

        assertFalse(results.contains(undergraduate));
    }

    @Test
    public void testOr() {
        QueryCriterion and = criterionBuilder.and(criterionBuilder.eq("code", "01"), criterionBuilder.eq("category", gender));
        instance.or(and, criterionBuilder.eq("category", education));
        List<Dictionary> results = repository.find(instance);
        assertTrue(results.contains(male));
        assertFalse(results.contains(female));
        assertTrue(results.contains(undergraduate));
View Full Code Here

TOP

Related Classes of org.dayatang.domain.QueryCriterion

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.