Daniel.Rodriguez wrote:
Tried the following HQL :
select cat
from Categoria cat
left outer join cat.subcategorias sc
where cat not in sc
-- Weird, it works in MySQL 3.23 (the query returns 1 result) and in MySQL 5
, the query turns up empty....
If you want to see exactly what SQL the hql gets translated into, stick
this in your log4j.properties file:
# All hibernate log output of "info" level or higher goes to stdout.
# For more verbose logging, change the "info" to "debug" on the last
# line.
#log4j.logger.org.hibernate.ps.PreparedStatementCache=WARN
log4j.logger.org.hibernate.ps.PreparedStatementCache=DEBUG
# Changing the log level to DEBUG will result in Hibernate generated
# SQL to be logged.
#log4j.logger.org.hibernate.SQL=ERROR
log4j.logger.org.hibernate.SQL=DEBUG
# Changing the log level to DEBUG will result in the PreparedStatement
# bound variable values to be logged.
#log4j.logger.org.hibernate.type=ERROR
log4j.logger.org.hibernate.type=DEBUG
Then you can determine whether the problem lies in the translation or in
the DB. Easiest solution: it's in the data in the two different DBs. :-)
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]