简体   繁体   English

Spring数据Neo4j:persist()方法未定义

[英]Spring data Neo4j: persist() method undefined

Pretty new to graph databases, neo4j and spring. 图形数据库相当新,neo4j和spring。 I have a simple POJO annotated with @NodeEntity. 我有一个简单的POJO注释@NodeEntity。 But, against the wisdom of many online tutorials I read on the matter, my POJO doesn't have any persist() method to save it to the graph DB. 但是,根据我在这个问题上阅读的许多在线教程的智慧,我的POJO没有任何persist()方法将其保存到图形DB中。

What sort of black magic do I need to do to make this method available to my POJOs, or are the tutorials out of date and the way to save to DB has changed with the version of Spring I'm using (2.1.0-RELEASE)? 我需要做什么样的黑魔法才能使这个方法可用于我的POJO,或者教程已经过时,保存到DB的方式已经改变了我正在使用的Spring版本(2.1.0-RELEASE )?

The black magic you're referring to is AspectJ . 你所指的黑魔法是AspectJ The advanced mapping mode of Spring Data Neo4j uses aspectJ to enhance your pojos. Spring Data Neo4j的高级映射模式使用aspectJ来增强你的pojos。 "persist()" is one of the methods that the aspectj compiler adds to your pojos when building the project. “persist()”是构造项目时aspectj编译器添加到pojos的方法之一。

Check chapter 21 "Environment Setup" in the Spring Data Neo4j Guide Book to see how to setup your project to use the advanced mapping mode with aspectj. 检查Spring Data Neo4j指南中的第21章“环境设置” ,了解如何设置项目以使用带有aspectj的高级映射模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM