neo4j

custom propertyConverter in filter is getting overridden in Neo4j OGM

↘锁芯ラ 提交于 2020-03-05 03:06:08
问题 I am manually setting propertyConverter of a filter in Neo4j OGM. filter.setPropertyConverter(new EnumArrayStringConverter(VendorCostStatus.class)); filters.add(filter); But then when I call session.loadAll(DomainClass. class , filters), it is picked by LoadByTypeDelegate.loadAll(Class<T> type, Filters filters) But then LoadByTypeDelegate overrides the propertyConverter of the filter by calling resolvePropertyAnnotations(Class entityType, Iterable<Filter> filters) and sets the default

Neo4j在Linux服务器上的安装

ぐ巨炮叔叔 提交于 2020-02-27 15:08:16
注意: Neo4j是基于Java的图形数据库,运行Neo4j需要启动JVM进程,因此必须安装JAVA SE的JDK。 下载安装包: iunx环境Neo4j下载地址:https://neo4j.com/download/other-releases/#releases(社区版免费) 解压安装: tar -zxvf neo4j-community-3.4.5-unix.tar.gz 修改配置: 在安装目录下找到conf目录下的neo4j.conf文件,修改相关的配置: # 修改第22行load csv时l路径,在前面加个#,可从任意路径读取文件 #dbms.directories.import=import # 修改35行和36行,设置JVM初始堆内存和JVM最大堆内存 # 生产环境给的JVM最大堆内存越大越好,但是要小于机器的物理内存 dbms.memory.heap.initial_size=5g dbms.memory.heap.max_size=10g # 修改46行,可以认为这个是缓存,如果机器配置高,这个越大越好 dbms.memory.pagecache.size=10g # 修改54行,去掉改行的#,可以远程通过ip访问neo4j数据库 dbms.connectors.default_listen_address=0.0.0.0 # 默认 bolt端口是7687

How to control depth on custom Spring Data Neo4j repository methods?

℡╲_俬逩灬. 提交于 2020-02-27 06:40:18
问题 For example, if I want to get list of users by name: class UserRepository extands GraphRepository<User> { List<User> findByName(String name); } then how to set loading depth to 2? I tried to find answer in the SDN 4.0.0.RC2 docs, but it isn't contains anything about this issue. 回答1: Derived finders do not yet support a depth. You'll have to write a custom query or use the loadAllByProperty method on the Neo4jTemplate if applicable. This should have been mentioned in the docs, we'll add it.

SpringBoot+Neo4j在社交电商中,讲述你是怎么被绑定为下线的

孤者浪人 提交于 2020-02-26 23:02:52
上两篇文章我们主要讲解了Neo4j的基本知识以及Neo4j的基本使用,这篇文章我们就以实例来深入的理解一下,我们以社交电商中的绑定关系为例,使用SpringBoot+Neo4j来实现。 Neo4j文章回顾: 不懂Neo4j?没关系,一起学 不懂Neo4j?没关系,先学增删改查 一、分析 社交电商中,现在做的比较出色的就应该属于花生日记,以及最近比较火的芬香。或许你经常会收到朋友或者亲戚发来的分享出的商品,而当你点击这些分享出来的商品后,那么,恭喜你,你可能已经被绑定为下级(粉丝)了。当然,我们这里只是举例说明下。 下面我们就用SpringBoot+Neo4j实现别人分享出来的商品,你点击了,注册成为新用户,进而被绑定为下线来详细说明。 二、代码架构 代码架构如下,这里没有写controller和service,以test来测试,也是为了方便。 三、代码实现 1.引入Neo4j依赖 2.添加 neo4j 配置 3.添加Neo4j 节点类 这里添加一个MemberInvit节点,有点注解类似于Mysql中的table 映射的对象类,mysql中叫做ORM,neo4j中叫做OGM。这里要使用到的是 @NodeEntity 注解和 @Id注解。 @NodeEntity声明该类为Neo4j的节点类 @Id Neo4j的主键。 package com.xsjt.learn.neo4j

How to identify a sorted list

蹲街弑〆低调 提交于 2020-02-25 13:39:08
问题 I want to know whether a list "A" has already been sorted by its values (in strictly ascending order). I thought about making a copy of the list (=> "B") and comparing it to "A" ordered by its values (using ASC ). At the current state, I have no idea how to create a copy of a list. Maybe there is another easier way to solve this problem (using Cypher). 回答1: If you don't want to/can't use APOC you can sort the list by using UNWIND list as item WITH list,item ORDER BY item It is a bit clunky

How to identify a sorted list

非 Y 不嫁゛ 提交于 2020-02-25 13:36:25
问题 I want to know whether a list "A" has already been sorted by its values (in strictly ascending order). I thought about making a copy of the list (=> "B") and comparing it to "A" ordered by its values (using ASC ). At the current state, I have no idea how to create a copy of a list. Maybe there is another easier way to solve this problem (using Cypher). 回答1: If you don't want to/can't use APOC you can sort the list by using UNWIND list as item WITH list,item ORDER BY item It is a bit clunky

Neo4j-安装遇到的问题——填了个坑

爷,独闯天下 提交于 2020-02-14 17:55:27
Neo4j-安装遇到的问题——填了个坑 Neo4j :基于Java的图形数据库 照着教程安装,一切正常后 在启动的时候出现一下的错误: ERROR: JAVA_HOME is incorrectly defined as /usr/java/jdk1.8.0_211 (the executable /usr/java/jdk1.8.0_211/bin/java does not exist) 说是找不到JAVA_HOME 定义的地方,我就纳闷了,我的JAVA_HOME 根本不在这,它是怎么找到这个地址的 //JAVA_HOME地址 export JAVA_HOME=/usr/java/jdk/jdk1.8.0_211 把问题搁在这,先去研究一下 解决尝试 找了一圈,决定从JAVA_HOME开始找起(我大概率确定安装我没啥问题) 首先,Jdk,有,1.8,满足 (base) [root@izuf62e1aik19tck77y9qwz bin]# java -version java version "1.8.0_211" Java(TM) SE Runtime Environment (build 1.8.0_211-b12) Java HotSpot(TM) Client VM (build 25.211-b12, mixed mode) 接着$JAVA_HOME,问题所在了

multiple versions of neo4j server at the same machine

允我心安 提交于 2020-02-12 04:06:32
问题 I downloaded 2 versions of neo4j on Ubuntu 18.04 which are "neo4j-community-3.5.12" and "neo4j-community-3.5.8" I run 3.5.8 with default settings I can see it from the web. http://localhost:7474/ For 3.5.12 I changed conf/neo4j.conf file and set some other port numbers for not to conflict with the default ones. 3.5.8 version runs fine on :7474. When I start 3.5.12, the logs says it is running but when I check from browser it is not running. I tried 2 different port settings, none worked.

Graph database modelling: Should i use a collection node to avoid to many rel on a node

断了今生、忘了曾经 提交于 2020-02-07 12:42:03
问题 I'm currently working on my first application that uses a Graph database (Neo4J). I'm in the process of modelling my graph on a whiteboard. My colleague and I are in a pickle on whether or not we should introduce a 'collection node'. We have something like this (Cypher syntax, Fictive example): (parking:Parking) - Parking node (car:Car) - Car node Obviously, a Parking can have multiple Cars, let's say it can have up to 1mio cars. Is it, in this case, better to introduce a new node:

Graph database modelling: Should i use a collection node to avoid to many rel on a node

折月煮酒 提交于 2020-02-07 12:40:51
问题 I'm currently working on my first application that uses a Graph database (Neo4J). I'm in the process of modelling my graph on a whiteboard. My colleague and I are in a pickle on whether or not we should introduce a 'collection node'. We have something like this (Cypher syntax, Fictive example): (parking:Parking) - Parking node (car:Car) - Car node Obviously, a Parking can have multiple Cars, let's say it can have up to 1mio cars. Is it, in this case, better to introduce a new node: