Package org.springframework.data.neo4j

Examples of org.springframework.data.neo4j.Group.persist()


      Person p = new Person( "David", 27 );
      people.add(p);

        assertEquals( Collections.singleton(p), group.getPersons() );
       
        group.persist();
    assertThat(group.getPersistentState(), hasRelationship("persons", p.getPersistentState()));
    assertThat(p.getPersistentState(), hasRelationship("persons", group.getPersistentState()));
    }

  @Test
View Full Code Here


      Person p = new Person( "David", 27 );
      people.add(p);

        assertEquals( Collections.singleton(p), group.getPersons() );
       
        group.persist();
    assertThat(group.getPersistentState(), hasRelationship("persons", p.getPersistentState()));
    assertThat(p.getPersistentState(), hasRelationship("persons", group.getPersistentState()));
    }

    @Test
View Full Code Here

    @Test
    public void testAddToOneToManyRelationshipOutsideOfTransaction() {
        Person michael = persistedPerson("Michael", 35);
        Group group = new Group().persist();
        group.getPersons().add(michael);
        group = group.persist();
        Collection<Person> personsFromGet = group.getPersons();
        assertEquals(new HashSet<Person>(Arrays.asList(michael)), personsFromGet);
    }

    @Test
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.