开发者

Build fails with Groovy 1.8, Hibernate JPA annotations

Build fails with Groovy 1.8, Hibernate JPA annotations

I've been stuck using Groovy 1.7.0 and unable to upgrade to the numerous updates due to a JPA Annotation build error.

My code is pretty standard JPA Annotations and has worked fine with the past groovy versions. I would like to be able to upgrade to Groovy 1.8.0. If anyone has seen and solved this issue, I will appreciate your help!

It seems to be failing to compile on the @JoinTable parts of all of my @ManyToMany annotations.

It fails with a "annotation value must be an annotation" message. I have looked through the JPA javadocs and I don't appear to be missing any required fields. My annotations worked fine in past versions.

Also, I'm using Gant for my build and I wouldn't rule that out as being a possible problem??

Here is an example mapping:

@ManyToMany(mappedBy='topics')
@JoinTable(name="screencast_topic",
 joinColumns=[@JoinColumn(name="topicId")],
 inverseJoinColumns=[@JoinColumn(name="screenCastId")])
@Sort(type=SortType.NATURAL)

Compile output:

[groovyc] Compiling 412 source files to /Users/ben/workspace/nofluff/build/webapps/ROOT/WEB-INF/classes
 [groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
 [groovyc] Abnormal termination of javac.
 [groovyc] /var/folders/rs/rsmW8feBHJyH6EPl+V3XME+++TI/-Tmp-/groovy-generated-1581380806855929206-java-source/nfjs/mod开发者_高级运维el/Topic.java:84: <b>annotation value must be an annotation</b>
 [groovyc] @org.apache.struts2.json.annotations.JSON(serialize=false) @javax.persistence.ManyToMany(mappedBy="topics") @javax.persistence.JoinTable(inverseJoinColumns={"org.codehaus.groovy.ast.AnnotationNode@7997f538"}, name="screencast_topic", joinColumns={"org.codehaus.groovy.ast.AnnotationNode@67646de5"}) @org.hibernate.annotations.Sort(type=org.hibernate.annotations.SortType.NATURAL) public  java.util.SortedSet<nfjs.model.screencast.Screencast> getScreencasts() { return (java.util.SortedSet<nfjs.model.screencast.Screencast>)null;}


the groovy devs are aware of this issue (http://jira.codehaus.org/browse/GROOVY-4768). Looks like a fix is in place for the next release. The current workaround is to make your own Groovy build and test it out.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜