spring-data-neo4j


Audits with Spring Data Neo4j

一世执手 提交于 2020-01-29 09:44:07
问题 I'm currently working on a project that makes use of Spring Data Neo4j. Whenever a NodeEntity is created, I would like to create a referenced Audit NodeEntity that contains the creation date and user. A solution that I've come up with, is to write an AOP Aspect which hooks in on the create method of my service layer. This works fine for entities that aren't cascaded, but what about the cascaded ones? That are not explicitly passed in my service layer so my AOP class will not intercept them.

Unknown persistent entity Error" after upgrade to 3.0.1.Release

别来无恙 提交于 2020-01-25 00:16:09
问题 Recently upgraded to Spring Neo4j 3.0.1.Release. I am now getting an Exception "MappingException: Unknown persistent entity". Not sure what could be causing this as I have not made any changes to the application. I have created a small test project to recreate the error message. You can download it from here - http://www.filebin.ca/1S2rAXPJE199/Store.zip Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'accountService':

Cypher query vs cypher dsl in spring data neo4j

╄→尐↘猪︶ㄣ 提交于 2020-01-16 19:18:08
问题 I want to know about neo4j dsl recommendation in Spring data neo4j framework. As of now I used to create repository interface extending from GraphRepository , NamedIndexRepository etc. and write my custom methods with my custom cypher query with @Query annotation as below: @Query(value="START root=node:__types__(className='com.data.EntityNode') WHERE root.id={0} and " + "root.type={1} return root") T findByIdAndType(String id, String type); above method works nicely as far as I consider the

equivalent of template.createRelationBetween in SDN4

人走茶凉 提交于 2020-01-15 07:37:19
问题 My project is currently use Spring-Data-Neo4J 3.3.0 and I'm trying to use the new 4.0.0.Release version. In my code I have the following code : neo4jTemplate.createRelationshipBetween(eltOrRel, attribute, valueClass, GraphRelationType.HAS_ATT_VALUE, true) What is the equivalent of this code (which is use this method in api in the new version of SDK please ? More especially I don't know how to create a relation of a given type but for a specific class. How can I write such a creation in cypher

Spring Data Neo4j Repository Composition error: No property XXXX found for type YYYY

江枫思渺然 提交于 2020-01-14 10:37:57
问题 This should be a simple question about something that I'm probably missing from the Spring Data documentation. I'm trying to implement a repository extension as described in: http://docs.spring.io/spring-data/data-neo4j/docs/3.0.2.RELEASE/reference/html/programming-model.html#d0e2970. The code is really simple. I just have a repository and an extension interface (and implementation). First a repository for MyType class: public interface MyTypeRepository extends GraphRepository<MyType>,

How to configure neo4j and cassandra repositories in same spring boot application

点点圈 提交于 2020-01-11 12:35:24
问题 I have configured neo4j and cassandra repositories separately with spring boot using spring-data. However, when I try to use two repositories in the same projects it doesn't work as expected. This is my folder structure. -----org.test.project -----controller BarController FooController -----models -----dao -----cassandra BarDAO FooDAO -----neo4j BarDAO FooDAO -----repositories -----cassandra BarRepository FooRepository -----neo BarRepository FooRepository -----services CassandraService (Has

Lazy Loading using Spring Data Neo4j 4 + AspectJ LTW running on Tomcat

我的梦境 提交于 2020-01-06 20:08:31
问题 I went through all the possibilities trying to make my project running on Tomcat and point cut the model (getters) and woven them using AspectJ Load Time Weaver. Basically, I followed all the steps in the Spring Documentation http://docs.spring.io/spring/docs/current/spring-framework-reference/html/aop.html#aop-atconfigurable. I also followed the same approach mentioned Lazy/Eager loading/fetching in Neo4j/Spring-Data. My project is divided in two main project: - core: spring-data-neo4j

Spring Data Neo4j- using transactions causes infinite loop

时光怂恿深爱的人放手 提交于 2020-01-06 15:57:07
问题 I am trying to integrate SDN with my spring-hibernate app. With minimal <neo4j:config> and <neo4j:repositories> configuration, it works fine. But when i include either @Neo4jTransactional or write a custom transactionManager i get an infinite loop in creating nodeEntityStateFactory bean in the intercept method in ConfigurationClassEnhancer class. Here is the exception i get. java.lang.IllegalStateException: Singleton 'nodeEntityStateFactory' isn't currently in creation Here is the intercept

How to do relative node ordering using Neo4J Cypher?

假装没事ソ 提交于 2020-01-06 07:16:07
问题 I'm building a Maven dependency graph using Neo4J. One of the queries I need to support is finding all nodes that depend on a particular dependency. So if C depends on B and A, and B depends on A, findByDependency(A) should return B and C. I implemented this using the following query, and it's working: MATCH (v1)-[:DEPENDS_ON]->(v2) WHERE EXISTS (v1.gav) AND v2.gav = "A" RETURN DISTINCT v1.gav However, in my example above, C also depends on B in addition to depending on A. I'd like the result

Spring Data Neo4j: filter by LocalDate doesn't work

时光毁灭记忆、已成空白 提交于 2020-01-06 06:52:10
问题 My small Neo4j playground application (based on Spring Boot 2, Spring Data Neo4j and the embedded driver) is a small note-keeping software. The users can filter their notes by creation date. To get a better understanding of Cypher I wrote the Cypher query using SDN's @Query ( NoteRepo.findByDay(day) ). However I can't get the filtering working. I'm confused that the LocalDate was transformed into a map (last line of the console output). In the previous query ( NoteRepo.findBySnoozeUntil(day)

工具导航Map