Kris,This should go to the NHUsers mailing list. http://ayende.com/Blog/archive/2009/05/04/nhibernate-filters.aspx
On Sun, Jun 28, 2009 at 3:20 PM, Kris-I <[email protected]> wrote: > > Hello, > > I have an object "Employee". This employees can have "DayOff". > > When I do this : > > EmployeeRepo emplRepo = new employRepo(); > Employee empl = remplRepo.Get(1); > > Emmployee has a property IList<DayOff> DayOff > > After this Get, empl.DayOff has ALL the dayoff for this person. > > How can I limit, the dayoff for the current year, or a specific year > and sort them. > > The mapping section in Employee is : > <bag name="DayOffs" generic="true" inverse="true" cascade="all" > table ="EmployeeDayOff"> > <key column="EmployeeId" foreign- > key="FK_Employee_EmployeeDayOff"/> > <one-to-many class="EmployeeDayOff"/> > </bag> > > If I change the inverse to false and do this : > > EmployeeRepo emplRepo = new employRepo(); > Employee empl = remplRepo.Get(1); > empl.DayOff = dayoffRepo.Get(employeeid, currentyear); > > What is the best way ? > > Thanks, > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Rhino Tools 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/rhino-tools-dev?hl=en -~----------~----~----~----~------~----~------~--~---
