Incomplete setter for the given field + mappedBy

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 creates standard CRUD scaffolding for people and teams. When creating / updating a team, there is a list for the participants, but the changes are not saved.

The 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, you need to update these dereferenced names ...)

Why do we need changes to this [template] code?

+3
source share
1 answer

I think this is the famous Spring Roo Blocker: https://jira.springsource.org/browse/ROO-2365 .

+2
source

All Articles