spring-data-neo4j

Spring Data Neo4j 4 : Failed to convert from type java.util.LinkedHashSet<?> to type org.springframework.data.domain.Page<?>

核能气质少年 提交于 2019-12-11 11:46:03
问题 Having this Repository method @Query("MATCH (i:`Interest`) WHERE not(i-[:PARENT]->()) return i") public Page<Interest> findAllByParentIsNull(Pageable pageRequest); It cause (it didn't respect the specification): org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.util.LinkedHashSet<?> to type org.springframework.data.domain.Page<?> for value '[com.nearofme.model.Interest@12a4479, com.nearofme.model.Interest@15bdfb3, com.nearofme.model.Interest@1af6067,

How to configure the Neo4j repository with Spring Data Neo4j 3.4.0?

梦想与她 提交于 2019-12-11 10:43:20
问题 I tried to upgrade from the 3.3.2 to the 3.4.0 version of spring data neo4j on search.maven.org but the build now gives the following exception: AnnotationFormatError: Invalid default: public abstract java.lang.Class org.springframework.data.neo4j.config.EnableNeo4jRepositories.repositoryBaseClass() The application works just fine in 3.3.2. Here is the configuration class: @Configuration @EnableNeo4jRepositories(basePackages = { "it.data.neo4j.repository" }) @EnableTransactionManagement

“Cannot extract single value from Iterable” with custom query result object

落爺英雄遲暮 提交于 2019-12-11 10:06:13
问题 I'm using SpringDataNeo4J 3.0.0-M1 with Neo4J 2.00-M0.6 . I have BetDAO nodes, linked to a collection of BetAnswerDAO nodes with BET_ANSWER relationship. I'm trying to retrieve a bet and all its answers on the same request. I have a BetRepository with the following request : @Query("start bet=node:BetDAO(id = {betId}) " + "match (bet)-[:BET_ANSWER]->(betAnswer) " + "return bet, collect(betAnswer) as betAnswers") BetWithInfo getByIdWithInfo(@Param("betId") String id); My BetWithInfo object :

Neo4jServer in Neo4jConfiguration - 4.1.0?

懵懂的女人 提交于 2019-12-11 09:59:35
问题 I've been using the latest code in 4.1.0-BUILD-SNAPSHOT as I need some of the new bug fixes in the 4.1 branch and just noticed that "neo4jServer()" is no longer a method exposed by Neo4jConfiguration. What is the new way to initialize a server connection and an in-memory version for unit tests? Before I was using "RemoteServer" and "InProcessServer", respectively. 回答1: Please note, the official documentation will be updated shortly. In the meantime: What's changed SDN 4.1 uses the new Neo4j

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>

java.lang.NoSuchMethodError: org.neo4j.ogm.session.SessionFactory.metaData()Lorg/neo4j/ogm/MetaData;

丶灬走出姿态 提交于 2019-12-11 07:24:59
问题 Here are my code in PersistenceContext.java package yuzhaoLiu.project.testNeo4j; import org.neo4j.ogm.config.ClasspathConfigurationSource; import org.neo4j.ogm.config.ConfigurationSource; import org.neo4j.ogm.config.FileConfigurationSource; import org.neo4j.ogm.session.Session; import org.neo4j.ogm.session.SessionFactory; import org.springframework.context.annotation.*; import org.springframework.data.neo4j.config.Neo4jConfiguration; import org.springframework.data.neo4j.repository.config

Spring Data Neo4j - Indexing and Inheritance

浪子不回头ぞ 提交于 2019-12-11 07:23:45
问题 Lets say i have the following data model: public class A { @Indexed(indexType = IndexType.FULLTEXT, indexName = "property1") String property1; } public class B extends A { @Indexed(indexType = IndexType.FULLTEXT, indexName = "property2") String property2; } Can i tell the Spring framework to index property1 of class B under a different index name? If not, what would you do in such case? I mean, what would you do if you have few classes that all extends the same base class, but in the same

Can not explore database created by an embedded neo4j

一笑奈何 提交于 2019-12-11 06:59:36
问题 I encounter a strange problem. I created an database using embedded neo4j whose path is "/Users/bondwong/Documents/workspace/pamela/target/data/pamela.db". Here is the Spring configuration: <bean id="graphDbBuilder" factory-bean="graphDbFactory" factory-method="newEmbeddedDatabaseBuilder"> <constructor-arg value="target/data/pamela.db" /> </bean> Then I changed this line of neo4j-server.properties: org.neo4j.server.database.location=/Users/bondwong/Documents/workspace/pamela/target/data

Why is neo4j's insert speed so low in this example?

狂风中的少年 提交于 2019-12-11 06:49:34
问题 I wanted to test insert speed with the latest spring-data neo4j 4 . I modified the movies example to make things simple and comparable. Try running the test class: movies.spring.data.neo4j.repositories.PersonRepositoryTest here. It takes 5sec to add 400 nodes in this example. https://github.com/fodon/neo4j-spring-data-speed-demo This is a speed test with the older version of neo4j https://github.com/fodon/gs-accessing-data-neo4j-speed The hello.Application class is about 40x faster than

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