在 Eclipse Indigo 上对我的静态元模型类进行子打包
我目前正在使用 Eclipse Indigo,我希望在子包中自动生成元模型类,而不是将它们放在实体的同一包中。
我已按照JPA Canonical Model Generator 用户指南中的说明进行操作在 Eclipse Galileo 上,但它根本不适用于 Indigo。 :(
有人在子包中使用静态元模型类吗?有没有办法在 Eclipse Indigo 上配置它?
I'm currently using Eclipse Indigo and I'd like to have my meta-model classes to be automatically generated in a sub-package instead of having them in the same package of my entities.
I've followed the instructions in the JPA User Guide for Canonical Model Generator on Eclipse Galileo, but it's not working at all with Indigo. :(
Does anybody use the static meta-model classes in a sub-package? Is there any way to configure it on Eclipse Indigo?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
也许你不应该更改套餐
我建议反对它,因为将它们放在子包(或任何其他包)中违反了当前的 JPA 2 规范:
其他组织方式是常见的 JUnit 实践:相同的包位于不同的源目录中。
但如果您必须这样做,这就是完成的方式
以下至少适用于 Eclipse 版本:Indigo Service Release 1 20110916-0149 和 EclipseLink:eclipselink-2.3.0.v20110604-r9504。 JAR 的名称可能因版本而略有不同。
如果启用,请禁用生成到实体所在的同一包:
是
调整生成到其他包:
[x] 启用项目特定设置
[x] 启用注释处理
[x] 在编辑器中启用处理
生成的源目录:src(或源所在的位置)
key=eclipselink.canonicalmodel.subpackage
值=子 | (所需的包名称)
eclipselink/jlib/jpajavax.persistence_2.0.3.v201010191057.jar
eclipselink/jlib/jpaeclipselink-jpa-modelgen_2.3.0.v20110604-r9504.jar
eclipselink/jlib/eclipselink.jar
Maybe you should not change package
I would suggest against it, because having those in sub package (or any other) violates current JPA 2 specification:
Other way to organize is common JUnit practice: same package in different source directory.
But if you have to, this is how it is done
Following works at least with Eclipse version: Indigo Service Release 1 20110916-0149 and EclipseLink: eclipselink-2.3.0.v20110604-r9504. Names of the JARs can slightly vary from version to another.
If enabled, disable generating to the same package where entities are:
is
<None>
Adjusting generating to the other package:
[x] Enable project specific settings
[x] Enable annotation processing
[x] Enable processing in editor
Generated source directory: src (or wherever sources live)
key=eclipselink.canonicalmodel.subpackage
value=sub | (desired package name)
eclipselink/jlib/jpajavax.persistence_2.0.3.v201010191057.jar
eclipselink/jlib/jpaeclipselink-jpa-modelgen_2.3.0.v20110604-r9504.jar
eclipselink/jlib/eclipselink.jar