Hi. I'm an experienced .net developer, but a newbie to nHibernate.
I've got an existing SQL Server table of existing stock items where
some items are considered "equivalent" to others, meaning they can be
substitued for each other on an order. This is implemented with an
EquivalenceId (a guid), where items that are equivalent all have the
same value in the EquivalenceId column.
Given the stock number of an item, I can find it and all
equivalences using this SQL:
select s.*
from stockitem s
where itemNo = @itemNo
union
select s2.*
from stockitem s1
inner join stockitem s2
on s1.EquivalenceID=s2.EquivalenceID
where s1.itemNo = @itemNo
I'd like to convert this to a detached criteria, but I'm not sure
how to begin. Could someone point me in the right direction, by
converting it and/or pointing me to a good reference so I can start to
understand more complex criteria construction? I've done some simple
detached criteria, but the union and join have me stumped.
Barring that, is there a better approach I should use to instantiate
the collection of stockitem entities this query would return?
Thanks,
Andrew
--
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=.