Package org.springframework.data.neo4j.support.path

Examples of org.springframework.data.neo4j.support.path.NodePath


        }
        return null;
    }

    protected Path toPath(Object value, Class<?> sourceType) {
        if (Node.class.isAssignableFrom(sourceType)) return new NodePath((Node) value);
        if (Relationship.class.isAssignableFrom(sourceType)) return new RelationshipPath((Relationship) value);
        return null;
    }
View Full Code Here


            @Override
            public String mapPath(EntityPath<Person, Person> entityPath) {
                return entityPath.<Person>startEntity().getName();
            }
        };
        String name = mapper.mapPath(new NodePath(getNodeState(michael)));
        Assert.assertEquals(michael.getName(), name);
    }
View Full Code Here

    @Test
    @Transactional
    public void shouldConvertNodePathToEntityPath() throws Exception {
        Person michael = persist(new Person("Michael", 36));
        Node node = getNodeState(michael);
        NodePath path = new NodePath(node);
        EntityPath<Person, Person> entityPath = new ConvertingEntityPath<Person, Person>(path, neo4jTemplate);

        Assert.assertEquals("start entity",michael, entityPath.startEntity());
        Assert.assertEquals("start node",node, path.startNode());
        Assert.assertEquals("end entity",michael, entityPath.endEntity());
        Assert.assertEquals("end node",node, path.endNode());
        Assert.assertNull("no relationship", entityPath.lastRelationshipEntity());
        Assert.assertNull("no relationship", path.lastRelationship());

        // todo all 6 iterators
    }
View Full Code Here

        }
        return null;
    }

    public Path toPath(Object value, Class<?> sourceType) {
        if (Node.class.isAssignableFrom(sourceType)) return new NodePath((Node) value);
        if (Relationship.class.isAssignableFrom(sourceType)) return new RelationshipPath((Relationship) value);
        if (Path.class.isAssignableFrom(sourceType)) return (Path) value;
        return null;
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.support.path.NodePath

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.