Hi,
I'm running Hibernate core 3.2.6 GA and Annotations 3.3.1 GA.
I have an HQL clause as follows:
em.createQuery("DELETE FROM DnsRecord r WHERE r.domain.name = ? AND r.name = ? " );
where DnsRecord contains a field named "domain" to an entity called DnsDomain. Both entities have a column called "name" in the database.
When executing the query, an exception gets thrown and the log shows:
****
Hibernate: delete from records, domains dnsdomain1_ where name=? and name=?|#]
[#|2008-04-09T12:21:40.375+0300|INFO|sun-appserver9.1|javax.enterprise.system.stream.out|_ThreadID=52;_ThreadName=p: thread-pool-1; w: 27;|
- SQL Error: 1064, SQLState: 42000
|#]
****
It seems that for some reason the table aliases are not used in the generated SQL and therefore the column names are ambiguous.
I'm using MySQL5 as the database backend.
Thanks,
-mjobanx
|