Eclipse kuinka käytät JPA:n staattisia metamalliluokkia kirjoittaessasi kriteerikyselyitä lepotilassa

When you use Maven you have to add in your POM following dependency:

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

Now you have to add folder target\generated-sources\annotations to your classpath as by default, the classes will be generated in this folder only. You go in

Project Build Path -> Configure Build Path -> Java Build Path -> Source and there make add folder

Now you can use the metamodel entity classes as User_ made from entity User

Jätä vastaus

Tutustu lisää Velislav Krastev -blogista

Tilaa nyt jatkaaksesi lukemista ja saadaksesi pääsyn koko arkistoon.

Jatka lukemista