Examples of Mentorship


Examples of org.springframework.data.neo4j.aspects.Mentorship

        Group group;
        final Long firstMentorshipId;
        final Person mentor2;
        try (Transaction tx = neo4jTemplate.getGraphDatabaseService().beginTx()) {
            group = persist(new Group());
            group.setMentorship(new Mentorship(persist(new Person()), group));
            persist(group);
            firstMentorshipId = group.getMentorship().getId();
            mentor2 = new Person();
            group.setMentorship(new Mentorship(persist(mentor2), group));
            persist(group);
            tx.success();
        }
        final Node node = neo4jTemplate.getPersistentState(group);
        assertEquals(1, IteratorUtil.count(node.getRelationships(Direction.INCOMING, DynamicRelationshipType.withName("mentors"))));
View Full Code Here

Examples of org.springframework.data.neo4j.aspects.Mentorship

    @Test
    @Transactional
    public void testSingleRelatedToViaField() {
        Group group = persist(new Group());
        Person mentor = persist(new Person());
        group.setMentorship(new Mentorship(mentor,group));
        persist(group);
        final Node node = neo4jTemplate.getPersistentState(group);
        assertEquals(1,IteratorUtil.count(node.getRelationships(Direction.INCOMING,DynamicRelationshipType.withName("mentors"))));
        final Group loaded = neo4jTemplate.load(node, Group.class);
        assertEquals(group.getMentorship(),loaded.getMentorship());
View Full Code Here

Examples of org.springframework.data.neo4j.aspects.Mentorship

    @Test
    @Transactional
    public void testRemoveSingleRelatedToViaField() {
        Group group = persist(new Group());
        Person mentor = persist(new Person());
        group.setMentorship(new Mentorship(mentor,group));
        persist(group);
        group.setMentorship(null);
        persist(group);
        final Node node = neo4jTemplate.getPersistentState(group);
        assertEquals(0,IteratorUtil.count(node.getRelationships(Direction.INCOMING,DynamicRelationshipType.withName("mentors"))));
View Full Code Here

Examples of org.springframework.data.neo4j.aspects.Mentorship

    }
    @Test
    @Transactional
    public void testUpdateSingleRelatedToViaField() {
        Group group = persist(new Group());
        group.setMentorship(new Mentorship(persist(new Person()),group));
        persist(group);
        final Long firstMentorshipId = group.getMentorship().getId();
        final Person mentor2 = new Person();
        group.setMentorship(new Mentorship(persist(mentor2),group));
        persist(group);
        final Node node = neo4jTemplate.getPersistentState(group);
        assertEquals(1,IteratorUtil.count(node.getRelationships(Direction.INCOMING,DynamicRelationshipType.withName("mentors"))));
        final Group loaded = neo4jTemplate.load(node, Group.class);
        assertFalse(loaded.getMentorship().getId().equals(firstMentorshipId));
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.