I\'m trying to capture the BeforeSaveEvent when setting up Neo4J in Spring, so that I can call a method beforeSave()
on the class that is being saved. Unfortuna
These events are fired by Neo4jTemplate (see http://docs.spring.io/spring-data/neo4j/docs/4.0.0.M1/reference/html/#_data_manipulation_events_formerly_lifecycle_events), so that's what you'll have to use to trigger the save.
In your configuration NitroNeo4jConfiguration
include
@Bean
public Neo4jOperations getNeo4jTemplate() throws Exception {
return new Neo4jTemplate(getSession());
}
and in your application,
@Autowired
private Neo4jOperations neo4jTemplate;
which is then used to save
neo4jTemplate.save(person);