简体   繁体   中英

Cannot generate JPA Hibernate Metamodel classes in IntelliJ IDEA

In my Java project, I get " java: cannot find symbol " errors pointing Metamodel classes eg Company_ .

So, first I checked my-project\\target\\generated-sources\\annotations and see that it is empty. Then, after several search on the web and SO, I see that the necessary settings seems to be ok and this is the first time I get this problem.

Here is corresponding settings in pom.xml :

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-jpamodelgen</artifactId>
    <version>5.3.7.Final</version>
</dependency>

And I have already had this settings and these have not been changed:

Settings

Settings > Build execution, Deployment > Compiler > Annotation Processors > my-project (selected) :
Enable annotation processing (checked)
Obtain processors from project classpath (selected)
Store generated sources relative to: Module content root
Production sources directory: target\\generated-sources\\annotations
Test sources directory: target\\generated-test-sources\\test-annotations

I tried to rebuild project, module, etc. but there is still nothing in my-project\\target\\generated-sources\\annotations directory. So, how can I generate these JPA Hibernate Metamodel classes in IntelliJ IDEA?

尝试从版本中删除 .Final 或仅使用其他版本

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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