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

Steve Ebersole (JIRA) issues at jboss.org
Thu Nov 19 10:43:00 EST 2015


    [ https://issues.jboss.org/browse/HIBERNATE-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13130939#comment-13130939 ] 

Steve Ebersole commented on HIBERNATE-99:
-----------------------------------------

This is not the correct project to report Hibernate issues under. This Jira project is for reporting issues in the integration between Hibernate and WildFly. To report issues in Hibernate, please use https://hibernate.atlassian.net. Thanks.



> 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



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list