Eclipse cách sử dụng các lớp siêu mô hình tĩnh JPA trong khi viết các truy vấn tiêu chí trong Hibernate

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

Để lại một câu trả lời