I have an Abstract Entity. In Roo Shell I did something like this:
This worked fine, except the code that was generated in the AspectJ file corresponding to the Controller has an error in it:Code:controller scaffold --entity ~domain.AbstractEntity --class ~web.AbstractEntitytController
The gen-code wants to create an instance of an Abstract Class, a big no-no. In this case, I don't care about creating AbstractEntity's anyway, I only want the List functionality, so I whack the method...Code:@RequestMapping(params = "form", method = RequestMethod.GET) public String AbstractEntityController.createForm(Model model) { model.addAttribute("abstractEntity", new AbstractEntity()); addDateTimeFormatPatterns(model); return "abstractEntity/create"; }
...problem is, Roo re-generates the code next time I touch AbstractEntity again.
I know that by adding the following to your Controller:
You can instruct Roo to keep its hands off the Controller code...but this isn't a good option long-term. What would be nice is if I can instruct Roo somehow as to what Controller methods I want. For instance, I could say I want "list" and "delete", but not "insert".Code:@RooWebScaffold(automaticallyMaintainView = false)
Is this possible? Has anyone else ran into this problem? I can add the stated flag to the Controller for now, whack the offending method, and keep on about my day, but I would rather do this right.


Reply With Quote