Examples of CypherQuery


Examples of org.neo4j.cypherdsl.CypherQuery

public class CypherQueryTest2 extends AbstractCypherTest
{
    @Test
    public void testDSL()
    {
        assertQueryEquals( CYPHER + "START john=node(0) RETURN john", new CypherQuery()
        {{
                starts( nodesById( "john", 0 ) ).returns( identifier( "john" ) );
            }}.toString() );

        assertQueryEquals( CYPHER + "START john=node(0) MATCH r=(john)-[:KNOWS*1..3]->(x) RETURN x", new CypherQuery()
        {{
                starts( nodesById( "john", 0 ) ).
                        match( path( "r", node( "john" )
                                .out( "KNOWS" )
                                .hops( 1, 3 )
                                .node( "x" ) ) ).
                        returns( identifier( "x" ) );
            }}.toString() );

        assertQueryEquals( CYPHER + "START n=node(3,1) WHERE (n.age<30 and n.name=\"Tobias\") or not(n" +
                ".name=\"Tobias\") RETURN n", new CypherQuery()
        {{
                starts( nodesById( "n", 3, 1 ) ).
                        where( identifier( "n" ).property( "age" ).lt( 30 ).and( identifier( "n" ).string( "name" )
                                .eq( "Tobias" ) )
                                .or( not( identifier( "n" ).string( "name" ).eq( "Tobias" ) ) ) ).
View Full Code Here

Examples of org.neo4j.cypherdsl.CypherQuery

    @Test
    public void testAndOrPrecedence()
    {
        assertQueryEquals( CYPHER + "START n=node(1) WHERE n.value=0 and (n.title=\"ololo\" or n.value=1) RETURN n",
                new CypherQuery()
                {{
                        starts( nodesById( "n", 1 ) ).
                                where( identifier( "n" ).number( "value" ).eq( 0 )
                                        .and( identifier( "n" ).string( "title" ).eq( "ololo" ).or( identifier( "n" )
                                                .number( "value" ).eq( 1 ) ) ) ).
View Full Code Here

Examples of org.neo4j.cypherdsl.CypherQuery

    @Test
    public void testLabel()
    {
        assertQueryEquals( CYPHER + "CREATE (n:Person:Swedish)",
                new CypherQuery()
                {{
                        creates( node("n").labels( label("Person"), label("Swedish") ) );
                    }}.toString() );
    }
View Full Code Here

Examples of org.springframework.data.neo4j.repository.query.CypherQuery

        delete(findAll());
    }

    @Override
    public Result<T> findAll(Sort sort) {
        CypherQuery cq = new CypherQuery(template.getEntityType(clazz).getEntity(),template, template.isLabelBased());
        return query(cq.toQueryString(sort), Collections.EMPTY_MAP);
    }
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.