[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2593?page=c...
]
Frederic Leitenberger commented on HHH-2593:
--------------------------------------------
For the time being, i found another solution for my query without UNION:
@Filter(name = "resellerFilter", condition = "(select distinct
cu.resellerId from Customer cu, GeoNumber gn where cu.id = gn.customerId AND gn.id =
geoNumberId OR cu.detemeTemplateId = id) in (null, :resellerIds)")
... results in ...
select
...
from
ICCS6.DeTeMe this_
where
(
select
distinct cu.resellerId
from
Customer cu,
GeoNumber gn
where
cu.id = gn.customerId
AND gn.id = this_.geoNumberId
OR cu.detemeTemplateId = this_.id
) in (
null, ?
)
and this_.id = ?
But the execution-time is even worse ...
Best would be HHH-298 to be reopened and solved.
Keyword UNION is prefixed with "this_." in filter
conditions
------------------------------------------------------------
Key: HHH-2593
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2593
Project: Hibernate3
Issue Type: Bug
Components: query-hql, query-sql
Affects Versions: 3.2.1
Environment: Oracle 10g: org.hibernate.dialect.OracleDialect
Suse Linux
Hibernate: 3.2.1.ga
Hibernate Annotations: 3.2.1.GA
Reporter: Frederic Leitenberger
Priority: Trivial
I need to use a UNION-Subquery in a Filter condition unless HHH-298 is solved.
But anyway, when using the keyword "union" in the Filter condition it is
prefixed with "this_.".
For instance, this ...
@Filter(name = "resellerFilter", condition = "(select cu.resellerId from
Customer cu, GeoNumber gn where (cu.id = gn.customerId and gn.id = this_.geoNumberId)
UNION select cu.resellerId from Customer cu where cu.detemeTemplateId = this_.id) in
(null, :resellerIds)")
... produces this ...
select
...
from
DeTeMe this_
where
(
select
cu.resellerId
from
Customer cu,
GeoNumber gn
where
(
cu.id = gn.customerId
and gn.id = this_.geoNumberId
) this_.UNION select
cu.resellerId
from
Customer cu
where
cu.detemeTemplateId = this_.id
) in (
null, ?
)
and this_.id = ?
--
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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira