zoukankan      html  css  js  c++  java
  • neo4j 学习笔记

    1.参考 https://blog.csdn.net/appleyk/article/category/7408344 系列文章 (不支持 spring boo 2.0 以下的,入门可做参考)

    2.底层驱动 https://github.com/neo4j/neo4j-ogm 

    3.数据库访问  https://neo4j.com/developer/spring-data-neo4j/ (支持 spring boo 2.0)

    常用命令

    //级联删除所有节点和关系
    Match(n) detach delete n;
    //删除所有阶段
    Match(n) delete n;
    //查询所有coder类型节点信息
    Match(n:coder) return n;

    从 1.0 升级到 2.0 踩坑

    1.招不到  org.neo4j:neo4j-ogm-http-driver  这个包,在 1.0 中 会自动安装该包,2.0 不会自动安装,该包功能具体参考上面的第二点,底层驱动

    2. 1.0 中 Repository 继承 GraphRepository ,2.0 中取消掉了,改成了 Neo4jRepository ,具体使用请看上面第三点。

    3.遇到奇奇怪怪的报错,就添加这段代码。

    @Value("${spring.data.neo4j.uri}")
    private String databaseUrl;
    
    @Value("${spring.data.neo4j.username}")
    private String userName;
    
    @Value("${spring.data.neo4j.password}")
    private String password;
    
    @Bean
    public SessionFactory sessionFactory() {
        Configuration configuration = new Configuration.Builder()
                .uri(databaseUrl)
                .credentials(userName, password)
                .build();
        return new SessionFactory(configuration, "com.xxx.xx.xx.neo4jnode"); //com.xxx.xx.xx.neo4jnode  neo4j节点的实体类的包
    }

     4 org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'transactionManager' available: No matching PlatformTransactionManager bean found for qualifier 'transactionManager' - neither qualifier match nor bean name match!

    原因是没有配置  neo4j 的transactionManager

    
    
    @Bean
    public Neo4jTransactionManager transactionManager() throws Exception {
    return new Neo4jTransactionManager(sessionFactory());
    }
  • 相关阅读:
    mongodb群集
    AtoS查看iOS Crash log中的16进制代码日志
    Info.plist 的字段解释
    IOS --关于粘贴板 ,剪切板 ,UILabel的复制
    UItableView 所有内容保存为图片
    ios 工程图片清理shell
    检查项目图片是否被使用
    ios 联网 在mac机器上进行抓包
    还在为不停build 烦恼么?看这里~~
    修复OS X的Finder中文档 打开方式中重复程序的问题
  • 原文地址:https://www.cnblogs.com/fqybzhangji/p/9914132.html
Copyright © 2011-2022 走看看