[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-1106) HQL "not in" generatad wrong SQL

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Mar 21 13:01:09 EDT 2011


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1106?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Steve Ebersole closed HHH-1106.
-------------------------------


Closing stale resolved issues

> HQL "not in" generatad wrong SQL
> --------------------------------
>
>                 Key: HHH-1106
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1106
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.0.5
>         Environment: 3.0.5, DB2
>            Reporter: Jarle Rudihagen
>            Assignee: Gavin King
>             Fix For: 3.1 rc3
>
>
> HQL:
> select distinct soknadLinjeDO.soknadDO.soknId  from SoknadLinjeDO as soknadLinjeDO
> where soknadLinjeDO.soknStatKode in (<list of code params>)
>  	and not (soknadLinjeDO.grKombKode in (<list of code params>) 
>  						and soknadLinjeDO.soknadDO.soknGrKode = :PARAM)
> Generates SQL:
>  select distinct soknadlinj0_.SOKN_ID as col_0_0_ from T_SOKNAD_LINJE 
>  soknadlinj0_, T_SOKNAD soknaddo1_ where 
>  soknadlinj0_.SOKN_ID=soknaddo1_.SOKN_ID
>  	and (soknadlinj0_.SOKN_STAT_KODE in (?,?,?.....)) 
>  	and (soknadlinj0_.GR_KOMB_KODE in (?, ?.....) 
>  		or soknaddo1_.SOKN_GR_KODE<>?)
> Here the problem is that it negates the "not in" clause and forgets to put in the "not in" in the following soknadlinj0_.GR_KOMB_KODE in (?, ?.....). There is one to many relationship between SoknadDO and SoknadLinjeDO.

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

        


More information about the hibernate-issues mailing list