nancom (12) [Avatar] Offline
#1
Now i use Spring roo 1.5 and create my project.
I need to change some bug of finder with Set<Object> parameter.
1. I move finder method to Main class
2. i delete method from .aj file

i seem ok but after i start roo shell it's re-create finder method in .aj file

how to fix this problems ?
jbbarquero (84) [Avatar] Offline
#2
Re: can i modify Controller_finder.aj
As a general rule, don't ever modify the .aj files, they're managed by Roo.

If you want to move some contents from the aspects (.aj) to the classes (.java) you can copy-from-aj/create-by-yourself in the java file (the Entity) and start a Roo shell: it'll remove the duplicate content from the aspect, and even the aspect if it's necessary (try with toString)

If you want to manage the aspects without Roo, you can use the STS feature Refactor-> Push in...: right click in the content that you want to move, for instance the finder method, and its related content (for example, if you want to move a test method from the _integration aspect to the integration test, you would probably have to move the dataOnDemand, dod, attribute too)

Regarding your issue, take care with the Roo annotations, Roo uses them to manage the files.

See if @RooEntity has the finder name in the finders attribute, that is a list of the finders that Roo has to manage.
nancom (12) [Avatar] Offline
#3
Re: can i modify Controller_finder.aj
thaks a lot
ken.rimple (246) [Avatar] Offline
#4
Re: can i modify Controller_finder.aj
BTW if you don't want to mess with the IDE refactor command, just cut and paste the method into your .java file, removing the classname prefix, and run the Roo shell. Roo will then remove the method from the .aj file.

I do this sometimes as it's only a few seconds and less clicking around.