Spring data Neo4j @NodeEntiry 和 Roo @RooEntity 冲突
当我尝试使用 @NodeEntity 和 @RooEntity 注释 POJO 时,我在 *_Roo_Entity IDT 上收到以下错误:
can't override T org.springframework.data.neo4j.core.NodeBacked.persist() with void com m.foo.lib.model.MyPOJOClass.persist()
return types don't match
MyPOJOClass_Roo_Entity.aj
/foo/src/main/java/com/foo/lib/model line 34
现在有什么解决方法可以使用吗?
版本:
<properties>
<roo.version>1.1.5.RELEASE</roo.version>
<spring.version>3.0.5.RELEASE</spring.version>
<aspectj.version>1.6.12.M1</aspectj.version>
<slf4j.version>1.6.1</slf4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-security.version>3.0.5.RELEASE</spring-security.version>
<jackson.version>1.6.1</jackson.version>
<spring.data.mongodb.version>1.0.0.M3</spring.data.mongodb.version>
<spring.data.graph.version>1.1.0.M2</spring.data.graph.version>
<spring.data.commons.version>1.1.0.RELEASE</spring.data.commons.version>
<spring.webflow.version>2.3.0.RELEASE</spring.webflow.version>
</properties>
When i try to annotate a POJO with both @NodeEntity and @RooEntity i got following error on the *_Roo_Entity IDT:
can't override T org.springframework.data.neo4j.core.NodeBacked.persist() with void com m.foo.lib.model.MyPOJOClass.persist()
return types don't match
MyPOJOClass_Roo_Entity.aj
/foo/src/main/java/com/foo/lib/model line 34
Is there any workaround I can use right now?
Versions:
<properties>
<roo.version>1.1.5.RELEASE</roo.version>
<spring.version>3.0.5.RELEASE</spring.version>
<aspectj.version>1.6.12.M1</aspectj.version>
<slf4j.version>1.6.1</slf4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<spring-security.version>3.0.5.RELEASE</spring-security.version>
<jackson.version>1.6.1</jackson.version>
<spring.data.mongodb.version>1.0.0.M3</spring.data.mongodb.version>
<spring.data.graph.version>1.1.0.M2</spring.data.graph.version>
<spring.data.commons.version>1.1.0.RELEASE</spring.data.commons.version>
<spring.webflow.version>2.3.0.RELEASE</spring.webflow.version>
</properties>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您应该能够告诉 Roo 持久方法是如何命名的。由于它都是生成的代码,因此它应该尊重您的决定。
Spring Data Graph 实体有一个内置的固定持久方法。
可能会出现其他问题,如果您想实现跨存储持久性,您也许应该看看 Spring 数据图文档。
如果您不想使用 JPA,则可以删除 @RooEntity。
You should be able to tell Roo how the persist method is named. As it is all generated code it should honor your decision.
Spring Data Graph entities have a fixed persist method built in.
There might be other issues popping up, if you want to go for cross-store persistence you should perhaps have a look at the spring data graph docs.
If you don't want to use JPA you can just remove @RooEntity.