Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@Configuration
@EnableNeo4jRepositories(basePackages="com.magaton.reco.repository.neo4j", transactionManagerRef = "neo4jTransactionManager")
@EnableTransactionManagement
@EnableConfigurationProperties(Neo4jProperties.class)
public class Neo4jConfiguration extends WebMvcConfigurerAdapter {
private final Logger log = LoggerFactory.getLogger(Neo4jConfiguration.class);
@Bean
public org.neo4j.ogm.config.Configuration configuration(Neo4jProperties properties) {
return properties.createConfiguration();
}
@Bean
public SessionFactory sessionFactory(org.neo4j.ogm.config.Configuration configuration) {
return new SessionFactory(configuration, "com.magaton.reco.domain.neo4j");
}
@Bean
public Neo4jTransactionManager neo4jTransactionManager(org.neo4j.ogm.config.Configuration configuration) {
return new Neo4jTransactionManager(sessionFactory(configuration));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment