简体   繁体   English

将DataNucleus JDO与Gradle和IntelliJ结合使用

[英]Using DataNucleus JDO with Gradle and IntelliJ

I'm working on a small REST application server and I'm trying to be able to save a Java bean using DataNucleus JDO with MySQL. 我正在使用小型REST应用程序服务器,并且尝试使用DataNucleus JDO和MySQL保存Java bean。

My only problem is that I can't find any examples of any application that uses DataNucleus JDO and is built using Gradle. 我唯一的问题是,找不到使用DataNucleus JDO并使用Gradle构建的应用程序的任何示例。

I'm new to using Java and I have essentially no idea how to go about doing this. 我是使用Java的新手,我基本上不知道该怎么做。 At this moment I'm just considering going with Hibernate JPA instead but I feel like JDO would be better for me in the long run. 目前,我只是考虑使用Hibernate JPA,但从长远来看,我觉得JDO对我来说会更好。 I would really appreciate any help pointing me in the right direction. 我真的很感谢为我指明正确方向的任何帮助。

I followed Adrian's solution I found here with a minor edit: I modified the task to depend on processResources instead of compileJava and made classes depend on datanucleusEnhance, otherwise it didn't work for me. 我按照此处找到的Adrian解决方案进行了少量编辑:我修改了任务,使其依赖于processResources而不是compileJava,并使依赖于datanucleusEnhance,否则对我不起作用。

I would normally tell you the error I got but I couldn't see the enhancer's error output. 我通常会告诉您我收到的错误,但看不到增强程序的错误输出。

The solution essentially calls an ant task to enhance the classes instead of using Gradle only. 该解决方案实质上是调用ant任务来增强类,而不是仅使用Gradle。 It's not the most elegant but it worked. 它不是最优雅的,但确实有效。

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

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