Originally posted by Andles Jurgen:
When I saw the ? in the hibernate generated SQL I thought only half the job was being done and that I had done something wrong in my mapping file(because I didn't see where the 'PreparedStatement' class substitutions were being done.) By the way, why do I not see these setXXX() calls? Because it's not relavant, not efficient???
Thanks for the help guys.
In your log4j.properties you should see an entry like this:
### log JDBC bind parameters ###
#log4j.logger.net.sf.hibernate.type=info
Simply uncomment the line and set the value to 'debug' like so:
### log JDBC bind parameters ###
log4j.logger.net.sf.hibernate.type=debug
When you do this, you'll be able to see the bind parameter values that hibernate will use to complete the SQL that it has written. I'm guessing that Hibernate executes the SQL (in my mind, at least) using PreparedStatements in JDBC. So, it binds the values retrieved from your objects to the '?' place holders much like you would if you were using JDBC.
Hope this helps.