Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: christian on April 20, 2008, 07:20:21 pm

Title: Automatic code generation Java class deletion
Post by: christian 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
Title: Re: Automatic code generation Java class deletion
Post by: Martin Terreni on April 21, 2008, 10:51:36 pm
When importing/synchronizing choose in to always delete classes not in code in the sycn dialog.
Title: Re: Automatic code generation Java class deletion
Post by: christian 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
Title: Re: Automatic code generation Java class deletion
Post by: christian 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
Title: Re: Automatic code generation Java class deletion
Post by: christian 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
Title: Re: Automatic code generation Java class deletion
Post by: Eve 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.