Book a Demo

Author Topic: Model and java code aren't synchronizing properly  (Read 3815 times)

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Model and java code aren't synchronizing properly
« on: April 27, 2014, 10:15:16 am »
I have a class where I'm adding a private attribute, along with having EA generate the setters and getters.  I then attempt to synchronize with the existing Java code and instead of having the new attribute and methods added to the code, they're being removed from the model.  

I was using EA10 and upgraded to EA11 in the hope it would behave differently, but it's doing the same thing.

Any suggestions?

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Model and java code aren't synchronizing prope
« Reply #1 on: April 27, 2014, 04:26:20 pm »
Use the setting in Tools -> Options -> source Code Engineering -> Attributes / Operations to influence how the import should work. (On reverse synch, delete model methods not in code)

jjyoung

  • EA User
  • **
  • Posts: 25
  • Karma: +0/-0
    • View Profile
Re: Model and java code aren't synchronizing prope
« Reply #2 on: April 30, 2014, 06:58:24 am »
What you suggested worked to a point. The other part of the problem was that I didn't realize that the "generate code" would not delete my existing code but would add to it.
« Last Edit: April 30, 2014, 07:01:00 am by jjyoung »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Model and java code aren't synchronizing prope
« Reply #3 on: April 30, 2014, 08:36:57 am »
There's an option on the same page for that too. EA doesn't delete from code or model by default when synchronizing with code.
« Last Edit: April 30, 2014, 08:37:27 am by simonm »