Package org.springframework.data.neo4j.fieldaccess

Examples of org.springframework.data.neo4j.fieldaccess.DynamicProperties


    @Test
    @Transactional
    public void testRemoveProperty() {
      Person p = createTestPerson();
   
    DynamicProperties props = p.getPersonalProperties();
    props.removeProperty("s");
    p.persist();
    Node node = nodeFor(p);
    assertEquals(2, IteratorUtil.count(p.getPersonalProperties().getPropertyKeys()));
    assertFalse(node.hasProperty("personalProperties-s"));
    assertEquals(100, node.getProperty("personalProperties-x"));
View Full Code Here


    @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 = john.getPersistentState().getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
     
    assertProperties(rel, "Friendship.");
    }
View Full Code Here

    @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 = john.getPersistentState().getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
      assertProperties(rel, "Friendship.");
      john.persist();
     
      props.removeProperty("s");
      rel = john.getPersistentState().getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);
     
      final String prefix = "Friendship.";
    assertEquals(100, rel.getProperty(prefix + "personalProperties-x"));
    assertEquals(3.1415, ((Double)rel.getProperty(prefix + "personalProperties-pi")).doubleValue(), 0.000000001);
View Full Code Here

    @Test
    @Transactional
    public void testRemoveProperty() {
        Person p = createTestPerson();

        DynamicProperties props = p.getPersonalProperties();
        props.removeProperty("s");
        persist(p);
        Node node = nodeFor(p);
        assertEquals(2, IteratorUtil.count(p.getPersonalProperties().getPropertyKeys()));
        assertFalse(node.hasProperty("personalProperties-s"));
        assertEquals(100, node.getProperty("personalProperties-x"));
View Full Code Here

    @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);

        assertProperties(rel, "Friendship.");
    }
View Full Code Here

    @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);
        assertProperties(rel, "Friendship.");
        persist(john);

        props.removeProperty("s");
        rel = getNodeState(john).getSingleRelationship(DynamicRelationshipType.withName("knows"), Direction.OUTGOING);

        final String prefix = "Friendship.";
        assertEquals(100, rel.getProperty(prefix + "personalProperties-x"));
        assertEquals(3.1415, ((Double) rel.getProperty(prefix + "personalProperties-pi")).doubleValue(), 0.000000001);
View Full Code Here

TOP

Related Classes of org.springframework.data.neo4j.fieldaccess.DynamicProperties

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.