|
|
|
|
Re: Composite Key OneToOne Join [message #846652 is a reply to message #842373] |
Mon, 16 April 2012 10:17  |
Eclipse User |
|
|
|
Your Supplier has a OneToMany to Account, so there are many accounts for a Supplier.
You are querying all Suppliers who have "any" account with division='Something', so you will get these back.
The accounts of a Supplier are always the same for that Supplier object, it does not matter how you queried it. You cannot change an object just by a query.
Perhaps use,
SELECT s, a FROM Supplier s
JOIN s.account a
WHERE s.pk.accountNumber = 1
AND (s.stat = '20' OR s.stat= '90')
AND a.pk.division='Something'
This will give you back Suppliers and Accounts.
|
|
|
Powered by
FUDForum. Page generated in 0.03049 seconds