| Generated classes recreated after delete [message #765087] |
Tue, 13 December 2011 06:46  |
Karsten Wutzke Messages: 110 Registered: July 2009 |
Senior Member |
|
|
Hello,
I've recently resetup a project of mine and I realized that there were "duplicate" classes in my model folder. These file end with an underscore, like EntityName_.java . There's one for each @Entity class. I have no idea where they come from.
When deleting these files they are immediately recreated.
How do you stop this?
Karsten
[Updated on: Tue, 13 December 2011 08:07] Report message to a moderator
|
|
|
|
|
| Re: Generated classes recreated after delete [message #766395 is a reply to message #765402] |
Thu, 15 December 2011 12:49  |
Neil Hauge Messages: 460 Registered: July 2009 |
Senior Member |
|
|
Quote:What's it for anyway? The code looked strange...
This functionality was introduced in JPA 2.0 primarily to provide a mechanism to write type-safe, dynamic queries. This generated metamodel would be referenced by your criteria queries, so if you had any and the metamodel was removed, those queries would no longer compile.
There is a lot of info on this topic on the web. I can also use this opportunity to plug my favorite JPA 2.0 book - "Pro JPA 2" by Keith/Schincariol.
Neil
|
|
|
Powered by
FUDForum. Page generated in 0.18590 seconds