Created
February 6, 2017 09:53
-
-
Save magaton/da0e98ed7cf7fcf7852cf51baf167e40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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