Home > Back-end >  Why can't generate JPA metamodel?
Why can't generate JPA metamodel?

Time:04-17


Want to use the JPA criteria structure dynamic query, in which the step is to class the entity to generate the corresponding class entity_, there are two methods:
1, in the Settings checked the annotation processors
2, in pom. Write maven plugin within XML

2, want to use the plugin online there are many types of writing, no matter which one to use, build project, rebuild project, maven compile, have generated class entity_

Have tried the following plugin writing (1-3 with maven - compiler - plugin) :

1,2.1. 2. The Usage with Maven
 

Maven - compiler - plugin

1.6 & lt;/source>
1.6 & lt;/target>

Org. Hibernate. Jpamodelgen. JPAMetaModelEntityProcessor





2, the JPA Criteria the Metamodel Generation and Usage Guide
 

Org, apache maven. Plugins
Maven - compiler - plugin
${maven - compiler - plugin. Version} & lt;/version>



Org. Hibernate
Hibernate - jpamodelgen
The ${hibernate. Version} & lt;/version>






3, Hibernate JAP Metamodel (the Metamodel)
 

Org, apache maven. Plugins
Maven - compiler - plugin
3.7.0 & lt;/version>

1.8 & lt;/source>
1.8 & lt;/target>


Org. Hibernate
Hibernate - jpamodelgen
5.4.3. Final


The target/metamodel




4, Hibernate Tips: How to automatically add the Metamodel classes to project
 

Org. Codehaus. Mojo
The build helper - maven - plugin
3.0.0 & lt;/version>


Add - source
The generate - sources

Add - source



The target/generated sources/annotations







5, JPA Hibernate the Metamodel generation through maven (master answer the main two are tried)

1-3 with maven - compiler - the plugin, always: [INFO] Nothing to compile - all classes are up to date
No matter use what kind of writing, in addition to hint to fill & lt; Version> The compiler, did not stop the ERROR or WARNING

Excuse me:
1, since can all sorts of writing are clear, I set up less?
2, maven -- the compiler plugin writing is concise, how to set up correctly?

Plagued, comment, thank you so much

Environment:
JDK 1.8
Kotlin 1.3.72
The IDEA of community edition 2018.3.6
Spring 5.2.13 (core, context, data - such as jpa, with the version number)
Hibernate 5.4.30 (core, jpamodelgen entitymanager etc., with the version number)
Maven 3.3.9

  • Related