Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Generated classes recreated after delete
Generated classes recreated after delete [message #765087] Tue, 13 December 2011 11:46 Go to next message
Karsten Wutzke is currently offline Karsten WutzkeFriend
Messages: 112
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 13:07]

Report message to a moderator

Re: Generated classes recreated after delete [message #765124 is a reply to message #765087] Tue, 13 December 2011 13:13 Go to previous messageGo to next message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
Registered: July 2009
Senior Member
Sounds like the metamodel generation is enabled. Go to the project properties->JPA, at the bottom of the page there is a Canonical metamodel source folder selection. Change the selected source folder to <None>. This should stop the regeneration of those classes.

Neil
Re: Generated classes recreated after delete [message #765402 is a reply to message #765124] Wed, 14 December 2011 01:12 Go to previous messageGo to next message
Karsten Wutzke is currently offline Karsten WutzkeFriend
Messages: 112
Registered: July 2009
Senior Member
Yup, that did it. What's it for anyway? The code looked strange...

Thanks
Karsten
Re: Generated classes recreated after delete [message #766395 is a reply to message #765402] Thu, 15 December 2011 17:49 Go to previous message
Neil Hauge is currently offline Neil HaugeFriend
Messages: 470
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
Previous Topic:Why so few users for such a fantastic project ?
Next Topic:Help with Porting over to Indigo
Goto Forum:
  


Current Time: Thu Dec 18 21:00:35 GMT 2014

Powered by FUDForum. Page generated in 0.01576 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software