Hi,
I am using Hibernate 3.1.1 and annotations beta 8. I am trying to do an insert into select, but I am getting abiguous columns. There is a cross join in my select and it is ignoring the reference to the second table, but the query works fine in oracle.
Here is an example HQL query
insert into c (id, a, b, c) select a.id, a.a, a.b, c.c
from aa as a, bb as b
where a.a=b.a and a.b=b.b
the generated query looks like this
insert into cc (id, a, b, c) select a.id, a.a, a.b, c.c
from aa as a, bb as b
where a=a and b=b.
As you can see, hibernate strips the table alias from the where clause. The columns a=a and b=b are ambiguous. Does anyone know how to remedy this? Is this a bug?
The classes/tables have no reference to each other in the mapping files.
|