I have 2 entities that are described below.  I want to map many credit
cards to one policy.  There is no proper FK between them in our Oracle
DB (I can't change the DB at all).  They do match up on the
PolicyNumber->PolNbr properties though.

I can't figure out how to map this relationship.  Here's what I have
so far, but I'm not sure how to specify the Key in the containing
entity that doesn't match.

mapping.HasMany<CreditCard>(x => x.CreditCards)
                .KeyColumn(PolNbr )
//where to map CreditCard.PolNbr to Policy.PolicyNumber


Policy
{
PolicyNumber : string (PK)
PolicyDate : date (PK)
CreditCards : IList<CreditCard>
}

CreditCard
{
PolNbr : String (PK)
CcType : String (PK)
ExpDt : String (PK)
//3 more columns that are the PK
}
-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" 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/fluent-nhibernate?hl=en.


Reply via email to