I realize you are using NHibernate, not Fluent NHibernate, but I'd
just like to point out that FNH would Automap your classes almost as-
is (you'd just have to add an Id member to each of them, and change
your List to an IList).  There would be no need for you do ANY manual
mapping with XML files!

Take a look at http://wiki.fluentnhibernate.org/Auto_mapping if you're
interested in this approach.

-Tom Bushell

On Apr 6, 11:36 pm, Brad <[email protected]> wrote:
> I am new to nHibernate and I am getting very frustrated with the
> Mappings.  The issue at hand is dealing with classes that contain
> list<T>.
>
> For example I have a clients that make orders.  The orders contain
> products. So I make a class for Clients, Client Orders, Products, then
> a Class to hold the Clients ordered products.
>
> Classes:
>
>  public class ClientOrder
>     {
>         public int ClientOrderId { get; set; }
>         public Client Client { get; set; }
>         public DateTime OrderDate { get; set; }
>         public Party Party { get; set; }
>         public List<ClientOrderProduct> OrderProducts { get; set; }
>
>     }
>
> public class ClientOrderProduct
>     {
>         public Product Product { get; set; }
>         public int OrderAmount { get; set; }
>         public decimal Price { get; set; }
>     }
>
> How would the List<ClientOrderProduct> be created in the
> ClientOrder.hbm.xml file?  I've seen examples for list, bag, and set
> but none seem to fit.

-- 
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.

Reply via email to