neo4j-ogm

How to configure spring-data-neo4j embedded server properties?

笑着哭i 提交于 2019-12-12 04:48:50
问题 I have setup using spring-data-neo4j v 4.2.1, neo4j-ogm v 2.1.2. I need embedded neo4j server with specific configuration for testing. cypher.forbid_shortestpath_common_nodes=false . I tried this without success in spring @Configuration bean: @Bean public org.neo4j.ogm.config.Configuration getConfiguration() { org.neo4j.ogm.config.Configuration config = new org.neo4j.ogm.config.Configuration(); config.driverConfiguration().setDriverClassName("org.neo4j.ogm.drivers.embedded.driver

Spring Data | Neo4J | Querying for the path in the correct order

北城余情 提交于 2019-12-12 04:38:15
问题 Versions: <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-core</artifactId> <version>2.1.1</version> </dependency> <dependency> <!-- If you're using the HTTP driver --> <groupId>org.neo4j</groupId> <artifactId>neo4j-ogm-http-driver</artifactId> <version>2.1.1</version> </dependency> <!-- https://mvnrepository.com/artifact/org.springframework.data/spring-data-neo4j --> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-neo4j</artifactId> <version>4

SDN 4 Session.query doesn't work for @QueryResult

谁都会走 提交于 2019-12-12 03:37:18
问题 In my SDN 4 project I have a @QueryResult POJO: @QueryResult public class WeightedDecision { private Decision decision; private double weight; public Decision getDecision() { return decision; } public void setDecision(Decision decision) { this.decision = decision; } public double getWeight() { return weight; } public void setWeight(double weight) { this.weight = weight; } } And a lot of Spring Data Neo4j repository methods that work fine with this WeightedDecision query result. Right now I'm

neo4j java node dynamic properties

纵然是瞬间 提交于 2019-12-12 03:06:49
问题 I am trying to create nodes of a specific type with properties which can be dynamic . For Example : I can create a Person node with name,age,address properties. But these need not be the only properties when I create another Person node. This node can have name,age,address and an additional property salary. Using spring data or query DSL needs me to create Java POJO class Person with fixed number of instance variables name,age and address . @NodeEntity public class Person { @GraphId private

@Index annotation in SDN4

我怕爱的太早我们不能终老 提交于 2019-12-12 02:28:05
问题 Why there is an @Index annotation in SDN4 if it does not manage Neo4j indexes anymore? In SDN3 it was used to populate indexes in the database, but now, taking into account the documentation, it is not. 回答1: It shouldn't be there any more- it isn't used and will be removed. 来源: https://stackoverflow.com/questions/33637661/index-annotation-in-sdn4

Always loading certain child object in neo4j

好久不见. 提交于 2019-12-11 14:53:15
问题 class Node { Long id; String name; @Relationship(type="NodeToCategory") Address address; List<NodeB> nodeBList; } //node B CLass class NodeB { Long id; String someOther; @Relationship(type="NodeToCategory") Address address; List<NodeC> nodeCList; } class Address { Long id; String name; } When I run a query with depth 2 on the Node it returns nodeBList but it does not return addresses of NodeB. I want to make sure whenever there is an address object it will always return address no matter the

Why does Neo4j OGM with Spring Boot 2.0.0.M4 apparently require the embedded driver?

自作多情 提交于 2019-12-11 14:26:50
问题 I have been trialling Spring Boot 2 (2.0.0.M4 at this stage) with the latest Spring Data Neo4j (currently 5.0.0.RC3) and can't seem to get it running. I get the following error: org.neo4j.ogm.exception.ConfigurationException: Could not load driver class org.neo4j.ogm.drivers.embedded.driver.EmbeddedDriver I don't ask for an embedded driver, nor do I want one. I only want to use the bolt driver, which is already a dependency of spring-data-neo4j. I've published a project to Github that was

SDN 4 + OGM 1.1.1 @Index(unique = true) is not working

核能气质少年 提交于 2019-12-11 11:28:02
问题 I know this question has been asked before, but looks like not with SDN 4 and OGM 1.1.1 Here is my code on the @NodeEntity @NodeEntity public class Company { @GraphId private Long id; @Index(unique = true) private String name; private String description; Here is the repo @Repository public interface CompanyRepository extends GraphRepository<Company> { Company findByName(String name); and I have a unit test class with methods @Autowired private CompanyRepository companyRepository; @Before

Neo4j Factory method 'sessionFactory' threw exception; nested exception is NullPointerException

随声附和 提交于 2019-12-11 07:58:00
问题 I am using following things in my application: 1.Spring Boot 2. MySQL 3. Neo4j 4. Activiti BPM Pom.xml <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId>

How to pass Collection Parameters to Repository Queries for Neo4J

ぃ、小莉子 提交于 2019-12-11 06:18:55
问题 Using Spring Data for Neo4J I want to pass a collection as a parameter to a repository query: @Query("MATCH (product:Product) WHERE ANY(c IN product.categories WHERE c IN {categories}) RETURN product") Iterable<Product> findAllWithCategories(@Param("categories") List<String> categories); On the command line the corresponding query runs successfully and delivers the right results: MATCH (product:Product) WHERE ANY(c IN product.categories WHERE c IN ["Märklin","Fleischmann"]) RETURN product But