They should still show up in the dump as far as I know, are you sure you
didn't just miss them?

On Fri, Mar 20, 2009 at 11:28 AM, Jonathan Burnham <
[email protected]> wrote:

> That did the trick, and I see what you mean about the nomenclature.
>
> Thanks Bob!
>
> Why, when I dumped the user object did I not see the add* functions, are
> those created on the fly?
>
> On Fri, Mar 20, 2009 at 9:44 AM, Bob Silverberg 
> <[email protected]>wrote:
>
>> You need to use the addRoles() method, which Transfer will generate for
>> you on your user object.
>>
>> See here:
>> http://docs.transfer-orm.com/wiki/Managing_Relationships_and_Compositions.cfm#ManyToManyfor
>>  a detailed explanation of how to work with ManyToMany.
>>
>> Btw, I'd probably call the relationship "role" rather than "roles".
>>
>> Bob
>>
>>
>> On Fri, Mar 20, 2009 at 7:55 AM, Jonathan Burnham <
>> [email protected]> wrote:
>>
>>> I'm afraid I am missing something here.  On my site I have a 'sign up'
>>> form that should ultimately end with a new user having been created.  Users
>>> have a manytomany relationship with roles.  Like this:
>>>
>>> <object name="user" table="security_user"
>>> decorator="model.decorators.user">
>>>     <id name="UserID" type="numeric" generate="false" />
>>>     <property name="Password" type="string" nullable="false" />
>>>     <property name="Email" type="string" nullable="false" />
>>>     <manytomany name="roles" table="security_user_role">
>>>         <link to="security.user" column="UserID"/>
>>>         <link to="security.role" column="RoleID"/>
>>>         <collection type="struct">
>>>             <key property="RoleID"/>
>>>         </collection>
>>>     </manytomany>
>>> </object>
>>>
>>> When I create a new user, I want to give them a default SiteUser role
>>> (roleId 2), then do a cascade save to put it all in the database at once.  I
>>> dumped the User object after I created it to see how to add the role
>>> association, and only saw set&getRolesMemento.  I couldn't figure out what
>>> to do with that and didn't find any documentation.  So the question is, how
>>> do I create a new object, add a manytomany property, then do a cascadesave
>>> on the whole thing?
>>>
>>> Thanks!
>>> Jonathan
>>>
>>>
>>>
>>
>>
>> --
>> Bob Silverberg
>> www.silverwareconsulting.com
>> >>
>>

--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer

You received this message because you are subscribed to the Google Groups 
"transfer-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to