Spring data Neo4j @NodeEntiry 和 Roo @RooEntity 冲突

发布于 2024-11-29 07:02:37 字数 1187 浏览 2 评论 0原文

当我尝试使用 @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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

听不够的曲调 2024-12-06 07:02:37

您应该能够告诉 Roo 持久方法是如何命名的。由于它都是生成的代码,因此它应该尊重您的决定。

@RooEntity( persistMethod = "save")
@NodeEntity(partial=true)
public class Actor {
   String name;
} 

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.

@RooEntity( persistMethod = "save")
@NodeEntity(partial=true)
public class Actor {
   String name;
} 

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文