We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`import org.neo4j.ogm.session.SessionFactory; import org.springframework.boot.autoconfigure.domain.EntityScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories; import org.springframework.data.neo4j.transaction.Neo4jTransactionManager; import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
@author : yuting.hu
@Date : 2022/12/1 9:35 */ @configuration @EnableNeo4jRepositories(basePackages = "com.appleyk.repository")// 开启Neo4jRepositories的支持 @EntityScan(basePackages = "com.appleyk.model")// 开启实体类扫描 @EnableTransactionManagement // 开启事务 public class Neo4jConfig { @bean public SessionFactory sessionFactory() { // with domain entity base package(s) return new SessionFactory(configuration(), "com.appleyk.model"); }
@bean public org.neo4j.ogm.config.Configuration configuration() { //配置Neo4j连接 return new org.neo4j.ogm.config.Configuration.Builder() .uri("bolt://xxx.xxx.xxx.xxx:7687").credentials("neo4j", "xxxxx").build(); }
@bean public Neo4jTransactionManager transactionManager() { return new Neo4jTransactionManager(sessionFactory()); } } ` 如果不加如下代码 neo4j的配置可能读不到yaml而是直接默认localhost:7687
The text was updated successfully, but these errors were encountered:
你好,我运行完之后出现这种情况与你说的一样吗?
Sorry, something went wrong.
请问你解决了吗,我一直提示无法创建数据库实例:
No branches or pull requests
`import org.neo4j.ogm.session.SessionFactory;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories;
import org.springframework.data.neo4j.transaction.Neo4jTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
@author : yuting.hu
@Date : 2022/12/1 9:35
*/
@configuration
@EnableNeo4jRepositories(basePackages = "com.appleyk.repository")// 开启Neo4jRepositories的支持
@EntityScan(basePackages = "com.appleyk.model")// 开启实体类扫描
@EnableTransactionManagement // 开启事务
public class Neo4jConfig {
@bean
public SessionFactory sessionFactory() {
// with domain entity base package(s)
return new SessionFactory(configuration(), "com.appleyk.model");
}
@bean
public org.neo4j.ogm.config.Configuration configuration() {
//配置Neo4j连接
return new org.neo4j.ogm.config.Configuration.Builder()
.uri("bolt://xxx.xxx.xxx.xxx:7687").credentials("neo4j", "xxxxx").build();
}
@bean
public Neo4jTransactionManager transactionManager() {
return new Neo4jTransactionManager(sessionFactory());
}
}
`
如果不加如下代码 neo4j的配置可能读不到yaml而是直接默认localhost:7687
The text was updated successfully, but these errors were encountered: