I'm getting a 'query did not return a unique result: x' error, where x
is the number of rows returned.
model:
-- Customer
--- List<TelNumber> (mapped as: Inverse, Join)
--- ExternalID (db column is unique)
so, when I ..
-- session.Load(customerID)
the sql executed looks like ..
-- select * from customers c left join telnumbers t on .. where c.id =
id ..
which works great.
HOWEVER, when I ..
-- session.CreateCriteria<Customer>()
.Add(Restrictions.Eq("ExtID", externalID)
.UniqueResult<Customer>()
the error is thrown when the customer has >= 2 telephone numbers.
the sql generated is the same as above.
I've tried putting a DistinctRootEntityTransformer in there before the
UniqueResult .. but it doesn't help.
--
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.