Hi, We are using mappings via ClassMapping for Parent/Child relationship via bag and most examples we have found will just load all children (disregard lazy). We have the following structure (simplified): Parent: Team (*Id, Name, People) Child: Person (*Id, Name) Association: TeamPerson (*TeamId, *PersonId, *EffDate, EffStatus) (* = primary key)
The following SQL is used to get the people that are currently active within the team: select PersonId from TeamPerson TP where TeamId = 'MyTeam' and EffDate = (select max(TP_ED.EffDate) from TeamPerson TP_ED where TP_ED.TeamId = TP.TeamId and TP_ED.PersonId = TP.PersonId and TP_ED.EffDate <= GETDATE()) and TP.EffStatus = 'A' My question: What is the best way to do this in ClassMapping, and is it best to have the parent load a child collection, or have the child load it's parent, or are both possible? Do I also need to do something special to update the association table when a person moves teams? Hope this makes sense, and thanks in advance for the help. -- 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.
