As a completely different representation of aggregation I think it should be
collections of "User" and without cascade on delete (the Parent-Child should
have cascade on delete).User
ISet<CompanyOfUser> Companies{get;set;}
2009/6/10 JamesSpibey <[email protected]>
>
> My specific problem is that my customers are separated into
> 'companies' and within each company there are multiple delivery
> points. So for a given user, they will have access to one or more
> companies and for each of those companies they will have access to one
> or more delivery points. Should this be a property of the User object
> (i.e. User.Companies & User.Companies(0).DeliveryPoints) therefore
> allowing the collection to be easily modified and persisted back to
> the database, or should it be represented in a different way?
>
> Thanks again for your help
>
>
> On Jun 10, 3:20 pm, Fabio Maulo <[email protected]> wrote:
> > I don't know your domain... what I know is that a never need
> > session.CreateFilter for a collection and, in general, I don't use
> > "order-by" nor "where" as collection attributes.
> > Probably you need some other class to represent the association between
> User
> > and Parent or User is not associated to Parent but to some subClass...
> > Try to think in the concept... The Parent has Children whatever is the
> > association that Parent has the same Children...
> > Well... I known... in the real life perhaps that Parent can say, in some
> > special place, that he isn't married and he does not have children but
> you
> > know... it is a lie.
> >
> > 2009/6/10 JamesSpibey <[email protected]>
> >
> >
> >
> >
> >
> > > So are you saying I should not try to map the 'Parent' collection into
> > > my user object and instead retrieve it using a query/filter? Shouldn't
> > > I be trying to compose my domain objects entirely using mappings
> > > rather than issuing manual queries to retrieve the data?
> >
> > > On Jun 10, 2:53 pm, Fabio Maulo <[email protected]> wrote:
> > > > 2009/6/10 JamesSpibey <[email protected]>
> >
> > > > > Thanks for the reply, much appreciated. Can you explain what you
> mean?
> > > > > Am I going about this the wrong way?
> >
> > > > Probably yes.
> > > > Btw take a look to session.CreateFilter.
> > > > Yo to reference and find(using browser find): CreateFilterhttp://
> > > nhforge.org/doc/nh/en/index.html
> >
> > > > --
> > > > Fabio Maulo
> >
> > --
> > Fabio Maulo
> >
>
--
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
-~----------~----~----~----~------~----~------~--~---