What I'm seeing is not a problem of persistent representation of a domain
but a problem of logic to retrieve a collection.

2009/6/10 JamesSpibey <[email protected]>

>
> Hi,
>
> Let's say I have a simple parent->child class structure as shown below
>
> Public Class Parent
>  Public ParentID As Integer
>  Public Children As IList(Of Child)
> End Class
>
> Public Class Child
>  Public ChildID As Integer
>  Public Parent As Parent
> End Class
>
> These are mapped to two tables using Fluent NHibernate. No problem.
>
> I now have a 3rd class, let's call 'User'. This class contains a list
> of Parent objects.
>
> Public Class User
>  Public UserID As Integer
>  Public Parents As IList(Of Parent)
> End Class
>
> However, the list of parents should be filtered to the user by a
> mapping table (UserParentMap) which contains UserID and ParentID.
> Furthermore, the 'Child' objects should be filtered in a similar way
> by a table called UserChildMap which contains UserID and ChildID.
>
> My question is - is it possible to get NHibernate to automatically use
> these mapping tables to filter the parent/child collection when
> mapping them to the user? Obviously when accessing the Parent/Child
> not through the user they should not be filtered
>
> Thanks
>
> James
>
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to