Skip to content
Advertisement

Why is there a class with entity name plus an underscore for JPA entity class

I am new to JPA, I have created a class like the following

JavaScript

I noted that there is another class with name as my entity java class Programme.java with an underscore i.e. Programme_.java. What is this class and why is this generated. Is there any way that I can stop its generation?

the code for the Programme_.java class is as following.

JavaScript

Advertisement

Answer

This is your “Canonical Metamodel”. It can be used with the JPA Criteria API, as described by the JPA 2.x spec (Section 6.2).

To stop Eclipse from generating these classes: edit your Eclipse project properties > JPA > Canonical metamodel (JPA 2.0) > Source folder – set the folder’s value to “”.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement