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 06:23 Go to next message
Bastian Lemke is currently offline Bastian Lemke
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 15:42 Go to previous messageGo to next message
Brian Vosburgh is currently offline Brian Vosburgh
Messages: 132
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 04:02 Go to previous messageGo to next message
Bastian Lemke is currently offline Bastian Lemke
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 15:13 Go to previous message
Brian Vosburgh is currently offline Brian Vosburgh
Messages: 132
Registered: July 2009
Senior Member
For reference:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=389940
Previous Topic:JPQL validation errors in named-queries.xml not ignored
Next Topic:Dali 3.2 released as part of Eclipse Juno!
Goto Forum:
  


Current Time: Wed Aug 20 10:40:01 EDT 2014

Powered by FUDForum. Page generated in 0.02001 seconds