Hi,

I'm struggling to get my head around how the generated value object code works, specifically relating to aggregate relationships.

UserEntity has a collection of RoleEntities, in the value object there are 5 collections to manage the relationships.

Roles
addedRoles
onceAddedRoles
removedRoles
updatedRoles

are these documented anywhere? What I'm struggling to follow are the if then else interactions between these collections.

The problem I'm having is that I have the collection of roles that I'd like to set in the user. Simply calling setRoles() on the user vo doesn't cause the roles to be updated when I update the user. What is the easiest way to do this? I have tried calling removeRole for every role currently set in the user and then calling addRole for each of the new ones but it seems that remove overrides the add so any role that already exists in the user and is in new set of roles gets deleted. The only other option is to compare the full set of roles that a user has now, with the ones I'd like the user to have and then calling add/remove as appropriate. There must be an easier way......

cheers
Nathan

--
Nathan Coast
Managing Director
codeczar ltd
mobile: (852) 9049 5581
email:  mailto:[EMAIL PROTECTED]
web:    http://www.codeczar.com


------------------------------------------------------- This SF.Net email is sponsored by: Sybase ASE Linux Express Edition - download now for FREE LinuxWorld Reader's Choice Award Winner for best database on Linux. http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click _______________________________________________ xdoclet-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to