[jboss-jira] [JBoss JIRA] Created: (HIBERNATE-99) nested select doesn't work

Uros Majeric (JIRA) jira-events at lists.jboss.org
Wed Jul 9 10:43:31 EDT 2008


nested select doesn't work
--------------------------

                 Key: HIBERNATE-99
                 URL: http://jira.jboss.com/jira/browse/HIBERNATE-99
             Project: Hibernate
          Issue Type: Bug
         Environment: JBoss Seam with Hibernate
            Reporter: Uros Majeric
         Assigned To: 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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list