Package org.springframework.data.repository.query.parser

Examples of org.springframework.data.repository.query.parser.Part


        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsQueryForGreaterThanPropertyReference() {
        Part part = new Part("ageGreaterThan", Person.class);
        query.addRestriction(part);
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here


        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsQueryForTwoPropertyExpressions() {
        query.addRestriction(new Part("ageGreaterThan", Person.class));
        query.addRestriction(new Part("info", Person.class));
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsQueryForIsNullPropertyReference() {
        Part part = new Part("ageIsNull", Person.class);
        query.addRestriction(part);
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsQueryForPropertyOnRelationShipReference() {
        Part part = new Part("group.name", Person.class);
        query.addRestriction(part);
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsQueryForMultipleStartClauses() {
        query.addRestriction(new Part("name", Person.class));
        query.addRestriction(new Part("group.name", Person.class));
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void createsSimpleWhereClauseCorrectly() {
        query.addRestriction(new Part("age", Person.class));
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

    }


    @Test
    public void createsSimpleTraversalClauseCorrectly() {
        query.addRestriction(new Part("group", Person.class));
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

    }


    @Test
    public void buildsComplexQueryCorrectly() {
        query.addRestriction(new Part("name", Person.class));
        query.addRestriction(new Part("groupName", Person.class));
        query.addRestriction(new Part("ageGreaterThan", Person.class));
        query.addRestriction(new Part("groupMembersAge", Person.class));
        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }
View Full Code Here

        assertThat(query.toString(), is( getExpectedQuery("trs-specific-test-subclass-expected-to-set-value")));
    }

    @Test
    public void buildsQueryWithSort() {
        query.addRestriction(new Part("name",Person.class));
        String queryString = query.buildQuery(new Sort("person.name")).toQueryString();
        assertThat(queryString, is("MATCH (`person`:`Person`) WHERE `person`.`name` = {0} RETURN `person` ORDER BY person.name ASC"));
    }
View Full Code Here

        assertThat(queryString, is("MATCH (`person`:`Person`) WHERE `person`.`name` = {0} RETURN `person` ORDER BY person.name ASC"));
    }

    @Test
    public void buildsQueryWithTwoSorts() {
        query.addRestriction(new Part("name",Person.class));
        Sort sort = new Sort(new Sort.Order("person.name"),new Sort.Order(Sort.Direction.DESC, "person.age"));
        String queryString = query.buildQuery(sort).toQueryString();
        assertThat(queryString, is("MATCH (`person`:`Person`) WHERE `person`.`name` = {0} RETURN `person` ORDER BY person.name ASC,person.age DESC"));
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.query.parser.Part

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.