Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Dali » Metamodel gets regenerated on Windows/Ubuntu
Metamodel gets regenerated on Windows/Ubuntu [message #911304] Tue, 11 September 2012 10:23 Go to next message
Bastian Lemke is currently offline Bastian LemkeFriend
Messages: 5
Registered: September 2012
Junior Member
Hi all,

we have a project with some developers which use different operating systems (Windows 7 / Ubuntu 12.04 / OS X Mountain Lion). Whenever a metamodel file is created on a linux/mac system, it is regenerated on the windows systems and vice versa. The only change of the regenerated metamodel file is the new timestamp in the @Generated annotation.

Currently, the metamodel generation via Dali is completely unusable for us because for each of our ~300 entities, a changed metamodel file is listed in the team synchronize view of eclipse - either on all windows systems or on all linux/mac systems.

What are the criteria for metamodel regeneration (= when does Dali decide to recreate the metamodel)? How can Dali be configured to avoid this silly behaviour?

Thanks,
Bastian
Re: Metamodel gets regenerated on Windows/Ubuntu [message #912015 is a reply to message #911304] Wed, 12 September 2012 19:42 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
It sounds like the generated source files use different line separators during generation than the line separators in the pre-existing files (checked out of your code repository?). Dali uses a java.io.PrintWriter to generate the metamodel files whenever there is a change to the JPA mappings. As a result, the line separator is determined by the Java system property "line.separator"; which is platform-dependent.

The new files are rewritten only if the newly-created metamodel file is different than the current file (excluding the timestamp). It might be that the line separators are different. Could you verify this by looking at the original files' line separators and then the newly-generated files'?

If this is the problem, a possible work-around is to configure your code repository to adapt your text files' line separators to the platform where the files are checked out to. (Although, I know this problematic with EGit, for the time being.)

Another possible fix is that Dali generate the files with the line separator specified by the Eclipse preference (General > Workspace > New text file line delimiter). If you would like to see this, please submit a bug to Bugzilla.
Re: Metamodel gets regenerated on Windows/Ubuntu [message #912260 is a reply to message #912015] Thu, 13 September 2012 08:02 Go to previous messageGo to next message
Bastian Lemke is currently offline Bastian LemkeFriend
Messages: 5
Registered: September 2012
Junior Member
Thanks for the detailed explanations!

Yes, we are using a code repository (subversion) - sorry I forgot to mention this. And yes, I can see that the line separators differ. We tried your work-around (setting '*_.java = svn:eol-style=native' in the subversion config file of the windows boxes) and now everything works fine!

Thank you very much!
Re: Metamodel gets regenerated on Windows/Ubuntu [message #917045 is a reply to message #912260] Wed, 19 September 2012 19:13 Go to previous message
Brian Vosburgh is currently offline Brian VosburghFriend
Messages: 137
Registered: July 2009
Senior Member
For reference:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389940
Previous Topic:JPQL validation error: AS in SELECT (with constructor expession)
Next Topic:JPA Entity Not Found
Goto Forum:
  


Current Time: Tue Mar 19 07:47:54 GMT 2024

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

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

Back to the top