如何生成JPA实体元模型? [英] How to generate the JPA entity Metamodel?

查看:446
本文介绍了如何生成JPA实体元模型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本着与 CriteriaQuery JPA 2.0还具有支持元模型的API 实体的表示形式.

In the spirit of type safety associated with the CriteriaQuery JPA 2.0 also has an API to support Metamodel representation of entities.

有人知道此API的完整功能实现(生成元模型,而不是手动创建元模型类)吗?如果有人也知道在Eclipse中进行设置的步骤,那将是非常棒的(我认为这与设置注释处理器一样简单,但您永远不会知道).

Is anyone aware of a fully functional implementation of this API (to generate the Metamodel as opposed to creating the metamodel classes manually)? It would be awesome if someone also knows the steps for setting this up in Eclipse (I assume it's as simple as setting up an annotation processor, but you never know).

刚刚偶然发现 Hibernate JPA 2元模型生成器.但是问题仍然存在,因为我找不到该jar的任何下载链接.

Just stumbled across Hibernate JPA 2 Metamodel Generator . But the issue remains since I can't find any download links for the jar.

自从我问这个问题以来已经过去了一段时间,但是我想我会回来并添加一个链接到

EDIT 2: Awhile has passed since I asked this question, but I thought I'd come back and add a link to the Hibernate JPA Model Generator project on SourceForge

推荐答案

如果有人也知道在Eclipse中进行设置的步骤,那将是非常棒的(我认为这就像设置注释处理器一样简单,但您永远不会知道)

It would be awesome if someone also knows the steps for setting this up in Eclipse (I assume it's as simple as setting up an annotation processor, but you never know)

是的.以下是各种JPA 2.0实现的实现和说明:

Yes it is. Here are the implementations and instructions for the various JPA 2.0 implementations:

  • org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor
  • http://in.relation.to/2009/11/09/hibernate-static-metamodel-generator-annotation-processor
  • org.apache.openjpa.persistence.meta.AnnotationProcessor6
  • http://openjpa.apache.org/builds/2.4.1/apache-openjpa/docs/ch13s04.html
  • org.datanucleus.jpa.JPACriteriaProcessor
  • http://www.datanucleus.org/products/accessplatform_2_1/jpa/jpql_criteria_metamodel.html

最新的Hibernate实现可在以下位置获得:

The latest Hibernate implementation is available at:

较旧的Hibernate实现位于:

An older Hibernate implementation is at:

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆