cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Giaccone <tgiacc...@gmail.com>
Subject Flattened relationships
Date Mon, 05 Aug 2013 23:03:55 GMT

I have a User a Role and a UserRole. UserRole represents the Join Table between the two.

The User has a flattened relationship through UserRole to Roles. It's marked as to many, list.

The Role had a flattened relationship to Users it's marked in the modeler as to many, read-only,
list.


I want to add a standard role to the user. I fetch the role, create the user. The use:

newUser.addToRoles(userRole);
context.commitChanges();

And an exception gets thrown.

Cannot set the read-only flattened relationship 'users' in ObjEntity 'Role'

What am I missing? Do I need accessors for the UserRole? I thought I could Dispose of that
class. I'm confused.

Tony Giaccone


Mime
View raw message