I'd recommend using two one-to-many relationships with a class in
between. Annoying for modeling, but you can make the collections
protected and publish public collections on your objects.

public class Trips
{
  public Trips() {
 ShipmentsOnTrip = new List<ShipmentsOnTrip>();
 }

  protected virtual IList<ShipmentsOnTrip> ShipmentsOnTrip {get;set;}

public virtual Shipments[] GetShipments()
                {
                        return (from c in ShipmentsOnTrip select 
c.Shipment).ToArray();
                }

}

etc

On Mon, Feb 9, 2009 at 10:01 AM, Dom <[email protected]> wrote:
>
> Hi,
> I don´t manage to sort out the mapping of my classes and would
> appreciate some guidance.
> I have 3 tables
> Trips (tripId PK)
> ShipmentsOnTrip(tripID, ShipmentId) , PK is composite of both
> Shipments(shipmentId, lineNo) PK is composite of both, lineNo=1 is
> like the main shipment record but their might be others (the parent
> info are on no 1 but this is irrelevant here)
> Shipment is mapped with a composite-id.
> I am trying to map a Trip.Shipments as a many-to-many relationship but
> I don´t manage to express it. I tried variations of the following:
> <key-column name = tripId>
> <many-to-many class = shipment>
>  <column name = shipmentID />
>  <column name = lineNo />         <-- will crash without (missing
> column on pk) and with when trying to join.
> </many..>
>
> (I might need to rework my model with the lineNo = 1 being a class
> holding som childs but that is another problem :) )
>
> Thanks for any pointer in direction of the solution.
> --
> Dom
>
> >
>

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