My problem is with the composite key. Should I be using the
CompositeKeyColumnKeys property on the HasMany attribute?

On Thu, Jan 22, 2009 at 10:05 PM, Jonathon Rossi <[email protected]> wrote:

> Thanks. I thought I tried that and it still didn't work. I'll take another
> look at that tomorrow.
>
>
> On Thu, Jan 22, 2009 at 9:57 PM, Simon Laroche <[email protected]>wrote:
>
>> I think you have to specify a relation type, a table and a key column
>> attribute int the HasMany attribute.
>>
>> //Simon
>>
>>
>> On Thu, Jan 22, 2009 at 6:40 AM, Jonathon Rossi <[email protected]>wrote:
>>
>>> I am trying to work out how to set up this relationship with ActiveRecord
>>> attributes but can't work it out.
>>>
>>> http://www.hibernate.org/hib_docs/nhibernate/html/components.html#components-incollections
>>>
>>> This is basically the type of model I have. The child table has a
>>> composite key (ParentType and User) with some extra data.
>>>
>>> class ParentType
>>> {
>>>     [PrimaryKey(PrimaryKeyType.GuidComb)]
>>>     Guid Id { get; set; }
>>>
>>>     [HasMany(DependentObjects = true, MapType = typeof(ChildType))]
>>>     ISet<ChildType> Children { get; }
>>> }
>>> class ChildType
>>> {
>>>     [BelongsTo]
>>>     ParentType Parent { get; set; }
>>>     User Owner { get; set; }
>>>     ... a few properties ...
>>> }
>>> class User
>>> {
>>>     Guid Id { get; set; }
>>> }
>>>
>>> Any hints on how to get this working will be appreciated. I have just
>>> been trying to get the relation between parent and child working so far
>>> without any luck.
>>> --
>>> Jono
>>>
>>>
>>>
>>
>> >>
>>
>
>
> --
> Jono
>



-- 
Jono

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" 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/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to