[hibernate-issues] [Hibernate-JIRA] Commented: (EJB-309) compile query differences when running a count verses a standard query. VIA EJB3 entity manager
Emmanuel Bernard (JIRA)
noreply at atlassian.com
Mon Aug 13 22:52:13 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/EJB-309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27809 ]
Emmanuel Bernard commented on EJB-309:
--------------------------------------
can you attach a runnable test case please.
> compile query differences when running a count verses a standard query. VIA EJB3 entity manager
> -----------------------------------------------------------------------------------------------
>
> Key: EJB-309
> URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-309
> Project: Hibernate Entity Manager
> Issue Type: Bug
> Affects Versions: 3.2.1
> Environment: JBoss 4.0.5.GA - EJB3
> Reporter: Grant Quimby
>
> Difference SQL generated where clause from count to normal query.
> Count Query (Works properly)
> where
> (exists
> (select distinct facility1_.FACILITY_ID from LUCI_FACILITY facility1_
> where emissionsr0_.FACILITY_ID=facility1_.FACILITY_ID
> and (upper(facility1_.JURISDICTION_FACILITY_ID) like upper('%00003977%') escape '\')
> and facility1_.STANDALONE_FLAG='Y'
> and facility1_.ACTIVE_FLAG='Y'
> and facility1_.CURRENT_FLAG='Y')
> or exists
> (select distinct facility3_.FACILITY_ID
> from LUCI_FACILITY facility2_ inner join LUCI_FACILITY facility3_ on facility2_.CURRENT_FACILITY_ID=facility3_.FACILITY_ID
> where emissionsr0_.FACILITY_ID=facility2_.FACILITY_ID
> and (upper(facility3_.JURISDICTION_FACILITY_ID) like upper('%00003977%') escape '\')
> and facility3_.STANDALONE_FLAG='Y'
> and facility3_.ACTIVE_FLAG='Y'
> and facility3_.CURRENT_FLAG='Y'))
> and emissionsr0_.ACTIVE_FLAG='Y'
> Normal Query (Fails)
> where emissionsr0_.FACILITY_ID=facility2_.FACILITY_ID
> and
> (exists
> (select distinct facility2_.FACILITY_ID
> from LUCI_FACILITY facility2_
> where (upper(facility2_.JURISDICTION_FACILITY_ID) like upper('%00003977%') escape '\')
> and facility2_.STANDALONE_FLAG='Y'
> and facility2_.ACTIVE_FLAG='Y'
> and facility2_.CURRENT_FLAG='Y')
> or exists
> (select distinct facility2_.FACILITY_ID
> from LUCI_FACILITY facility2_
> where (upper(facility2_.JURISDICTION_FACILITY_ID) like upper('%00003977%') escape '\')
> and facility2_.STANDALONE_FLAG='Y'
> and facility2_.ACTIVE_FLAG='Y'
> and facility2_.CURRENT_FLAG='Y'))
> and emissionsr0_.ACTIVE_FLAG='Y'
--
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