如何生成JPA 2.0元模型? [英] How to generate JPA 2.0 metamodel?

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

问题描述

本着与 CriteriaQuery JPA 2.0还有一个支持 Metamodel的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的全功能实现(生成Metamodel而不是手动创建元模型类)?如果有人也知道在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 Metamodel Generator 。但问题仍然存在,因为我找不到任何jar的下载链接。

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

编辑2:
自从我提出这个问题以来已过了一段时间,但我以为我会回来并在SourceForge上添加一个指向 Hibernate JPA模型生成器项目的链接

推荐答案


如果有人也知道设置这个的步骤会很棒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:

  • https://mvnrepository.com/artifact/org.hibernate/hibernate-jpamodelgen/

旧的Hibernate实现位于:

An older Hibernate implementation is at:

  • http://repository.jboss.com/maven2/org/hibernate/hibernate-jpamodelgen/1.0.0.Final/hibernate-jpamodelgen-1.0.0.Final.jar

这篇关于如何生成JPA 2.0元模型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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