Scenario:
entity --class ~.domain.Team
entity --class Person
field reference --fieldName team --type Team
focus --class Team
field set --fieldName members --type Person --mappedBy team
controller all --package ~.web
This generates standard CRUD scaffolding for People and Teams. When creating/updating a Team, there is a list selector for members, but changes are not persisted.
A workaround for this is to change setMembers in Team_Roo_JavaBean.aj:
public void Team.setMembers(Set<Person> members) {
this.members = members;
for (Person person : members) {
person.setTeam(this);
}
}
(added loop to update all referenced People, need to update those dereferenced as well...)
Why are changes to this [boilerplate] code necessary?
I think this is a known blocker Spring Roo bug: https://jira.springsource.org/browse/ROO-2365.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With