3
我有一些需要直接访问neo4j的节点的逻辑,但为了简单起见,应用程序的其余部分使用Spring Data Neo4j(SDN)。我以为使用@Procedure的过程,但我不知道如何使用neo4j嵌入式驱动程序和SDN4时如何使用该过程。我的配置是如下非常准系统:当使用嵌入式驱动程序时,将程序部署到Neo4J
@Configuration
@EnableNeo4jRepositories(basePackages = "recommender.repository")
@ComponentScan(basePackages = "recommender")
@EnableTransactionManagement
public class MyNeo4jConfiguration extends Neo4jConfiguration {
@Bean
public SessionFactory getSessionFactory() {
System.out.println("******* GET SESSION FACTORY!!!!");
// with domain entity base package(s)
return new SessionFactory("recommender.model");
}
// needed for session in view in web-applications
@Bean
@Scope(value = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
public Session getSession() throws Exception {
return super.getSession();
}
随着属性文件位置:
#EmbeddedSetup
driver=org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver
#URI=file:/neo4j/data/graph.db
使用这个配置我在哪里可以放置与@Procedure和@Context的类(DB访问),其中SDN的实施可以在战争部署期间使用它。
请问为了清楚起见'getDatabase()'来自哪里? –
getDatabase()将返回在前面的行中设置的数据库服务 – Luanne