-
Oct 20th, 2009, 07:24 AM
#1
Custom code generation rules (e.g. for setters/getters)
Dear all,
I'm currently making my first steps with Spring Roo. In this context, I'm wondering whether there is a way to customize the rules applied when e.g. setters and getters for an entity field are generated by Roo.
E.g. if my project uses the "f" prefix convention for field names (like "fAmount" instead of "amount"), I want to have a "setAmount()" and "getAmount()" generated, not a "setFAmount()" / "getFAmount()".
Preferred option would be to have this defined project-global.
Thank you for your help!
Regards,
Christian
-
Oct 21st, 2009, 11:25 AM
#2
Christian,
Roo tries to follow conventions as much as possible. In this case we follow normal JavaBean conventions where this kind of convention for accessors and mutators is not used. I suspect it would also get us in trouble when using these methods in Spring MVC which does also follow JavaBean conventions.
From a technical perspective it would certainly not be hard to provide such a feature but I am not sure if this makes sense as part of the current JavaBean add-on. Maybe you want to implement your own add-on to do that which could run right beside the Spring Roo JavaBean add-on. To get started you can simply take a look at the current 'standard' add-on.
Cheers,
Stefan
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules