]
Emmanuel Bernard moved ANN-707 to HHH-3184:
-------------------------------------------
Affects Version/s: (was: 3.3.1.CR1)
3.2.6
Key: HHH-3184 (was: ANN-707)
Project: Hibernate3 (was: Hibernate Annotations)
Erroneous SQL goes to Oracle when using operator IN with composite
key
----------------------------------------------------------------------
Key: HHH-3184
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3184
Project: Hibernate3
Issue Type: Bug
Affects Versions: 3.2.6
Environment: Hibernate 3.2.6
Hibernate Annotations 3.3.1.CR1
Hibernate EntityManager 3.3.2.CR1
Oracle 10g
Reporter: botWi
entity Footballer has composite primary key defined via @IdClass and @Id getters (see
http://www.hibernate.org/hib_docs/annotations/reference/en/html_single/#e...)
entity Goal has property 'footballer' defined via @ManyToOne
query
select g from Goal g where g.footballer in (select f from Footballer f where f.age=22)
is translated to erroneous SQL
select goal0_.id as col_0_0_ from tgoal goal0_ where (goal0_.fb_firstname,
goal0_.fb_lastname) in (select (footballer1_.fb_firstname, footballer1_.fb_lastname) from
tfootballer footballer1_ where footballer1_.age=22)
it's strange, but the slightly modified query
select g from Goal g where g.footballer.id in (select f.id from Footballer f where
f.age=22)
is translated to valid SQL
select goal0_.id as col_0_0_ from tgoal goal0_ where (goal0_.fb_firstname,
goal0_.fb_lastname) in (select footballer1_.fb_firstname, footballer1_.fb_lastname from
tfootballer footballer1_ where footballer1_.age=22)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: