-
Jul 22nd, 2009, 04:22 PM
#1
Custom getters
I like to use custom getters to show full data. eg:
class Person {
String fisrtName;
String lastName;
// my custom getter
public String getFullName() {
return firstName + " " + lastName;
}
}
Which are the best options to add this kind of getters? Does @RooJavaBean support this?
-
Jul 22nd, 2009, 05:35 PM
#2
Roo's automatic getter/setter creators just follow the JavaBean standard in terms of exposing a single field. You're best off to just write the method inside your entity's normal .java file. It won't cause any Roo problems, and indeed you'll notice Roo's toString() add-on automatic detects your new getter and includes it in the generated toString() method!
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