D
David Veeneman
I'm relatively new to NHibernate, and I am trying to figure out how to map a
collection. I know how to map a collection that is held directly by a parent
class, such as an Order class with an OrderItems property that is a
List<OrderItem>. But what if the collection is held in an intermediate
class?
For example, what if I want to add some intelligence to my list of order
items? In that case, I might have an Order class with an OrderItems property
that is class of type OrderItems. The OrderItems class would have an Items
property that is a List<OrderItem>, along with other properties that provide
information about the list, such as number of items delivered, number of
items on hold, and so on.
I'm not sure how I would map this relation. The Order class is persisted,
but it looks like the OrderItems class wouldn't be. And it looks like the
OrderItem class (the individual order items in the list) would be. How would
I map this overall relation in NHibernate?
Thanks in advance for your help.
David Veeneman
Foresight Systems
collection. I know how to map a collection that is held directly by a parent
class, such as an Order class with an OrderItems property that is a
List<OrderItem>. But what if the collection is held in an intermediate
class?
For example, what if I want to add some intelligence to my list of order
items? In that case, I might have an Order class with an OrderItems property
that is class of type OrderItems. The OrderItems class would have an Items
property that is a List<OrderItem>, along with other properties that provide
information about the list, such as number of items delivered, number of
items on hold, and so on.
I'm not sure how I would map this relation. The Order class is persisted,
but it looks like the OrderItems class wouldn't be. And it looks like the
OrderItem class (the individual order items in the list) would be. How would
I map this overall relation in NHibernate?
Thanks in advance for your help.
David Veeneman
Foresight Systems