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();
}