Package org.springframework.data.neo4j.aspects

Examples of org.springframework.data.neo4j.aspects.Person.addLabel()


        String[] labelNames = {"Person", "Developer", "Father","_Person"};
        Person p = new Person("Michael",39).persist();
//        assertThat(p.getLabels(), hasItems(labelNames[0],labelNames[3]));
        p = neo4jTemplate.findOne(p.getId(), Person.class);
        assertThat(p.getLabels(), hasItems(labelNames[0],labelNames[3]));
        p.addLabel(labelNames[1]);
        p.addLabel(labelNames[2]);
        neo4jTemplate.save(p);
        System.out.println("p.getLabels() = " + p.getLabels());
        assertEquals(4, IteratorUtil.count(getNodeState(p).getLabels()));
        for (Label l : getNodeState(p).getLabels()) {
View Full Code Here


        Person p = new Person("Michael",39).persist();
//        assertThat(p.getLabels(), hasItems(labelNames[0],labelNames[3]));
        p = neo4jTemplate.findOne(p.getId(), Person.class);
        assertThat(p.getLabels(), hasItems(labelNames[0],labelNames[3]));
        p.addLabel(labelNames[1]);
        p.addLabel(labelNames[2]);
        neo4jTemplate.save(p);
        System.out.println("p.getLabels() = " + p.getLabels());
        assertEquals(4, IteratorUtil.count(getNodeState(p).getLabels()));
        for (Label l : getNodeState(p).getLabels()) {
            assertEquals("Wrong label "+l.name(),true, asList(labelNames).contains(l.name()));
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.