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());
    }
  • 相关阅读:
    织梦系统的安装与详细信息
    js 报错 :object is not a function
    css3中动画animation的应用
    js 中 setTimeout()的用法
    CSS3 Gradient-CSS3渐变
    css3 transform 变形
    CSS3 transition 属性
    只要有人的地方,世界就不是冰冷的。
    CSS层
    css区块定位之浮动与清除属性
  • 原文地址:https://www.cnblogs.com/fqybzhangji/p/9914132.html
Copyright © 2011-2022 走看看