Author Topic: Automatic code generation Java class deletion  (Read 5022 times)

christian

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Automatic code generation Java class deletion
« on: April 20, 2008, 07:20:21 pm »
If I generate code for Java classes, the Eclipse Link analyses the project and gives the user the possibility to check the classes to generate or sync. In my case, I want classes not in code be deleted from the model. This is not possible. Or did I missed something? That would be a great feature....  :)

Christian

Martin Terreni

  • EA User
  • **
  • Posts: 672
  • Karma: +0/-0
  • Sorry, I can't write
    • View Profile
Re: Automatic code generation Java class deletion
« Reply #1 on: April 21, 2008, 10:51:36 pm »
When importing/synchronizing choose in to always delete classes not in code in the sycn dialog.
Recursion definition:
If you don’t understand the definition read "Recursion definition".

christian

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Automatic code generation Java class deletion
« Reply #2 on: April 22, 2008, 07:27:32 am »
Thanx Martin, but I can only find the option for methods and attributes. Not for class files. I had a look at the "Tools->Options->SourceCode Engineering" pane. I also had a look at other places, but I guess it must be stated somewhere here. Could you please show me where to set the option?
Thanx,
Christian

christian

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Automatic code generation Java class deletion
« Reply #3 on: April 22, 2008, 07:35:38 am »
Hi,
maybe I found what you mentioned: I have to "import" a source code tree and there I can set the option "remove classes not found in code". But I am a bit surprised, because I would expect that this is done on every synchronization. But maybe I can always do an import, what looks a bit strange to me in my development cycles. I will test it. Thanx.
Christian

christian

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Automatic code generation Java class deletion
« Reply #4 on: April 24, 2008, 06:58:27 pm »
Hi,
ok, I've tested it now. It is not the feature I want. Because importing classes is not the same as synchronizing. Therefore I expect that during synchronizing I get the option to delete all classe not in code/model. So, this feature is not available as I can see. So I have to delete them manually.

Thanx
Christian

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8083
  • Karma: +118/-20
    • View Profile
Re: Automatic code generation Java class deletion
« Reply #5 on: April 28, 2008, 09:51:08 am »
The feature should be what you want.  On the same dialog there is an option for synchronizing.  If it's creating duplicate classes, check your file paths (and do a search in this forum for duplicates on import).

EA doesn't do this automatically because it doesn't really know if the classes have been added into the model or deleted from the code.
« Last Edit: April 28, 2008, 09:51:55 am by simonm »