Package org.springframework.data.neo4j.aspects

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


    @Test
    @Transactional
    public void testFindRelationshipEntity() {
        Person p1 = persistedPerson("Michael", 35);
        Person p2 = persistedPerson("David", 27);
        Friendship friendship = p1.knows(p2);
        assertEquals("Wrong friendship count.", 1L, (long) friendshipRepository.count());
        assertEquals(friendship, friendshipRepository.findOne(getRelationshipId(friendship)));
        assertEquals("Did not find friendship.", Collections.singleton(friendship), new HashSet<Friendship>(IteratorUtil.asCollection(friendshipRepository.findAll())));
    }
View Full Code Here


    @Test
    @Transactional
    public void testRelationshipProperties() {
        Person james = persistedPerson("James", 36);
        Person john = persistedPerson("John", 36);
        Friendship f = john.knows(james);
        DynamicProperties props = f.getPersonalProperties();
        props.setProperty("s", "String");
        props.setProperty("x", 100);
        props.setProperty("pi", 3.1415);

        Relationship rel = getNodeState(john).getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
View Full Code Here

    @Test
    @Transactional
    public void testRelationshipRemoveProperty() {
        Person james = persistedPerson("James", 36);
        Person john = persistedPerson("John", 36);
        Friendship f = john.knows(james);
        DynamicProperties props = f.getPersonalProperties();
        props.setProperty("s", "String");
        props.setProperty("x", 100);
        props.setProperty("pi", 3.1415);

        Relationship rel = getNodeState(john).getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
View Full Code Here

    @Transactional
    @Ignore
    public void testCanIndexIntFieldsOnRelationshipEntities() {
        Person p = persistedPerson(NAME_VALUE, 35);
        Person p2 = persistedPerson(NAME_VALUE2, 25);
        Friendship friendship = p.knows(p2);
        friendship.setYears(1);
        GraphRepository<Friendship> friendshipFinder = neo4jTemplate.repositoryFor(Friendship.class);
        assertEquals(friendship, friendshipFinder.findByPropertyValue("Friendship.years", 1));
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.aspects.Friendship

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.