I am new to NHibernate and not sure how to map a ZeroToOne
relationship:
There are 3 tables involved
Discounts
DiscountRequests
Requests
The primary keys of both are stored as a pairs in DiscountRequests
, not all discounts have a request and not all requests have a discount.
Each primary key only appears once in DiscountRequests
so Discount
has a one to one relationship to DiscountRequests
and that is the same for Requests
.
Anyone have any idea how to map this so a Discount object can hold a reference to it request if it has one and a Request object holds a reference to a Discount if it has one. Otherwise they will hold a null object.