Ok, thanks for answering! But we would like to have this as part of
the mapping, so that I automatically get PreviousEditions initiated
with the previous editions when I get the Book entity using GetById
from the repository.
Do you mean I have to explicitly query for the previous editions in
the BookRepository's GetById method, and then assign the resulting
list to the PreviousEditions property "manually"?
In that case I would not get a true mapping, so changing a value in a
previous Edition would not get persisted when I tell the session to
save the "current" Book/edition which obviously is the aggregate root
(and which might have business methods that needs to change state on
some previous version).
Hmm, as I have managed to initiate (via the mapping HasMany(x =>
x.PreviousEditions).AsBag().KeyColumn("NAME").PropertyRef("Name")) a
List with ALL editions of the current Book (having the same name), I
could always add a property 'PreviousVersions' that filters this list
and returns only those Books that have an edition number lower (=
previous) than the current (this) book.
But it would be nice if it was possible to handle this using a
mapping, as I have no use case that is really interested in subsequent
editions (which get fetched the way the unfiltered mapping works now).
Please observe that I'm quite new to NH/Fluent, if that was not
apparent already ;-)
Regards/
AC
> >
fluent-nhibern...@googlegroups.com<fluent-nhibernate%2Bunsubscr
i...@googlegroups.com>
> > .
> > For more options, visit this group at
> >
http://groups.google.com/group/fluent-nhibernate?hl=en.- Hide quoted text -
>
> - Show quoted text -