<class name="Order">
...
<any name="Payment">
...
</any>
</class>
<class name="CreditCardPayment">
...
<many-to-one name="Order" />
</class>
<class name="WiredPayment">
...
<many-to-one name="Order" />
</class>
I don't see any reason why this would not work.
On Oct 5, 10:17 am, David McClelland <[email protected]>
wrote:
> I may be missing something, but here's a scenario (for the simple case
> of one payment per order):
>
> A user is viewing all the payments they've made in the last month, and
> they don't remember what a particular Credit Card payment is for, so
> they want to click on link next to the Payment that would take them to
> view the Order, so we want to traverse the relationship =>
> payment.Order
>
> In the CreditCardPayments table we may have:
>
> ID | IsSuccessful | Amount | CreditCardNumber
> ----------------------------------------------------
> 1 1 $111.11 1111111111111111
>
> In the WirePayments table we may have:
>
> ID | IsSuccessful | Amount | BankAccountNumber
> ----------------------------------------------------
> 1 1 $222.22 2222222222
>
> So in the Orders table:
>
> ID | PaymentType | PaymentId
> --------------------------------
> 1 CreditCard 1
> 2 Wire 1
>
> ... so my question is how would I write the mapping for the
> CreditCardPayment class to enable me to get the the Order it's
> associated with?
--
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.