Package org.springframework.data.neo4j.support

Examples of org.springframework.data.neo4j.support.Neo4jTemplate.save()


            if (car != null) {
                delete = true;
                assertEquals(Volvo.class, car.getClass());
            } else {
                Transaction tx = template.getGraphDatabase().beginTx();
                Volvo volvo = template.save(new Volvo());
                assertEquals(1, volvo.id.intValue());
                tx.success();
                tx.close();
            }
        } catch (Exception e) {
View Full Code Here


        MappingInfrastructureFactoryBean factoryBean = new MappingInfrastructureFactoryBean(db, null);
        factoryBean.setTypeRepresentationStrategy(TypeRepresentationStrategyFactory.Strategy.SubRef);
        factoryBean.afterPropertiesSet();
        Neo4jTemplate template = new Neo4jTemplate(factoryBean.getObject());
        Transaction tx = db.beginTx();
        Person person = template.save(new Person());
        person.setName("Bar");
        template.save(person);
        tx.failure();
        tx.close();
    }
View Full Code Here

        factoryBean.afterPropertiesSet();
        Neo4jTemplate template = new Neo4jTemplate(factoryBean.getObject());
        Transaction tx = db.beginTx();
        Person person = template.save(new Person());
        person.setName("Bar");
        template.save(person);
        tx.failure();
        tx.close();
    }
}
View Full Code Here

    @Test
    public void testInstantiateEntity() throws Exception {
        Neo4jTemplate template = new Neo4jTemplate(graphDatabase,transactionManager);
        Transaction tx = template.getGraphDatabase().beginTx();
        try {
            Person michael = template.save(new Person("Michael", 37));
            assertNotNull(michael.getId());
        } finally {
            tx.success();tx.close();
        }
    }
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.