spring-data-neo4j

how to avoid deadlocks with neo4j

泄露秘密 提交于 2019-12-21 17:27:33
问题 I just learnt that when I create a relationship between 2 nodes in neo4j, both of them are locked (http://docs.neo4j.org/chunked/stable/transactions-locking.html). However, in our project, we have elements that we can instanciate and we finnaly have two nodes in the graph linked by a "INSTANCE_OF" relationship. For exemple if I instanciate element B, I have a new element B1. They are stored in the graph like B<-INSTANCE_OF-B1. My problem is that many users can instanciate element B on same

org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component

不羁岁月 提交于 2019-12-21 07:55:17
问题 Getting following error while running maven test on project. I am building a test application using Spring Data Neo4j. java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) at org.springframework.test.context.support

Depth in custom Cypher queries with OGM always 0?

邮差的信 提交于 2019-12-21 05:04:33
问题 I'm currently evaluating OGM / Spring Data Neo4j for a use case and came upon the following problem: When executing a custom Cypher query either via Spring Data @Query annotation or directly via the Neo4j Session , the result contains only the nodes directly queried for and not the related nodes (relationships are null in the resulting node objects). I.e. the depth for these queries seems to be 0 and not 1, as I would have expected from the docs. How can I execute a custom Cypher query via

Neo4j how to delete nodes recursively from some start node

有些话、适合烂在心里 提交于 2019-12-20 03:23:54
问题 In my Neo4j database I have a following entities: @NodeEntity public class Product { private final static String CONTAINS = "CONTAINS"; private final static String DEFINED_BY = "DEFINED_BY"; private final static String VOTED_FOR = "VOTED_FOR"; private final static String PARENT = "PARENT"; private final static String CREATED_BY = "CREATED_BY"; @GraphId private Long id; @RelatedTo(type = PARENT, direction = Direction.INCOMING) private Product parent; @RelatedTo(type = CONTAINS, direction =

Spring Data Neo4j - repository.save and @Indexed(unique=true)

廉价感情. 提交于 2019-12-20 01:38:20
问题 Today I tried Spring Data Neo4j, I finally got it working somehow ... I'm using: Spring 4.0.2 Spring Data Neo4j 3.0.0 QueryDSL 3.3.1 Neo4j 2.0.1 Here's my config: @Configuration @EnableNeo4jRepositories(includeFilters=@Filter(value=GraphRepository.class, type=FilterType.ASSIGNABLE_TYPE)) public class Neo4jConfig extends Neo4jConfiguration { public Neo4jConfig() { setBasePackage("my.base.package"); } @Bean public GraphDatabaseService graphDatabaseService() { return new GraphDatabaseFactory()

Spring Data Neo4J repository findAll() results in a nullpointerexception

我的未来我决定 提交于 2019-12-19 08:32:42
问题 I have made a simple Repository containing all the persons in my system, everything seems to work fine. I can add, remove and even retrieve single persons based on a given key and value but for some reason i can't retrieve all persons stored in the Repository directly. I tried do it by using the findAll() method, which should return an iterable. I then try to iterate with the iterable and store each person in an arraylist which i want the function to return. public List<Person> getAllPersons(

Compatibility neo4j-spatial with spring-data-neo4j-rest and neo4j CE 2.2.1 server mode?

Deadly 提交于 2019-12-13 19:20:20
问题 I'm trying to make neo4j-spatial version 0.14-neo4j-2.2.0, works with spring-data-neo4j-rest version 3.3.0.RELEASE with neo4j CE 2.2.1 in server mode. It looks like they are not compatible. Trying to create new instance of class EditableLayer throws NoSuchMethod exception. For instance: EditableLayer layer = (EditableLayer) spatialDb.getOrCreateLayer( "layer",SimplePointEncoder.class, EditableLayerImpl.class); I get the exception: SEVERE: Servlet.service() for servlet [com.stampy.foundation

Spring Data Neo4j - @Autowired Repository == null

試著忘記壹切 提交于 2019-12-13 15:24:01
问题 I try to write a webapp using Spring Data Neo4j. I have an Repository: public interface UserRepository extends GraphRepository<Neo4jUser> {} an applicationcontext.xml: ... <context:component-scan base-package="de.wilke.test.neo4j" > <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan> <!-- REST Connection to Neo4j server --> <bean id="restGraphDatabase" class="org.springframework.data.neo4j.rest.SpringRestGraphDatabase">

Spring data neo4j : count relation By EndNode ID

﹥>﹥吖頭↗ 提交于 2019-12-13 07:46:32
问题 I'm using a spring data neo4j 5.0.0. My model is a (user)-[:ATTEND]-(meeting) and ATTEND is a RelationshipEntity. user have attend relationship, meeting does not have relationship. @Relationship(type = "ATTEND") Set<AttendMeeting> attendMeetings = new HashSet<>(); RelationshipEntity code. @Setter @Getter @ToString @NoArgsConstructor @RelationshipEntity(type = "ATTEND") public class AttendMeeting { @GraphId private Long id; @JsonIgnore @StartNode private User user; @EndNode private Meeting

Cannot configure @Transaction to work with Spring Data Neo4j

若如初见. 提交于 2019-12-13 06:02:02
问题 I'm trying to move away from manually-managed transactions to annotation based transactions in my Neo4j application. I've prepared annotation-based Spring configuration file: @Configuration @EnableNeo4jRepositories("xxx.yyy.neo4jplanetspersistence.repositories") @ComponentScan(basePackages = "xxx.yyy") @EnableTransactionManagement public class SpringDataConfiguration extends Neo4jConfiguration implements TransactionManagementConfigurer{ public SpringDataConfiguration() { super();