]
Steve Ebersole closed HIBERNATE-99.
-----------------------------------
Resolution: Rejected
nested select doesn't work
--------------------------
Key: HIBERNATE-99
URL:
https://issues.jboss.org/browse/HIBERNATE-99
Project: Hibernate Integration
Issue Type: Bug
Environment: JBoss Seam with Hibernate
Reporter: Uros Majeric
Assignee: Steve Ebersole
I found this example somewhere:
Query q = em.createQuery("select o from Order o where exists (select li from o.items
li where li.price > 10000)");
this works fine if "items" id is basic type (Integer, Short, ...), but problems
happens if id is an EmbeddedId (embedded class) then the SQL is not generated as it should
be.
it generates SQL like this one:
select *
from
ORDER order0_
where
exists (
select
(item1_.id, item1_.name)
from
items item1_
where
order0_.id=item1_.id
and item1_.price > 10000
)
if id and name are primary keys of embedded class.
(item1_.id, item1_.name) should not have paranthesis.
Uros