Package org.springframework.data.neo4j.aspects

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


        try (Transaction tx = neo4jTemplate.getGraphDatabase().beginTx()) {
            assertEquals( 35, nodeFor( p ).getProperty("age") );
            tx.success();
        }

        p.persist();

        try (Transaction tx = neo4jTemplate.getGraphDatabase().beginTx()) {
            assertEquals( 25, nodeFor( p ).getProperty("age") );
            tx.success();
        }
View Full Code Here


    @Test
    public void testEntityIsStillDetachedAfterValidationException() {
        Person p = new Person("Foo", 2);
        try {
            p.setName("A");
            p.persist();
            fail("should fail to validate");
        } catch(ValidationException ve) {
            System.out.println(ve.getClass());
        }
        assertEquals("A",p.getName());
View Full Code Here

    @Test
    @Transactional
    public void testSetTransientPropertyBeforePersist() {
        Person p = new Person();
        p.setThought("detached");
        p.persist();
        // test asserts that no NPE is thrown
    }

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