I think what are looking for are the SQL statements used by Hibernate. To get those, add the following entry to your persistence.xml file:
<persistence ...> <persistence-unit ...> ... <properties> <property name="hibernate.show_sql" value="true"/>
i have switched it on too. I can see statements, but i also want to see the parameter values and this, as i know, can be done by setting loging properly.
Also i want to write hibernate output log to the specified file.
i have found a problem.
hibernate entity manager 3.4.0 use slf4j as logger (that was new for me).
My project is maven driven, so i have only a hibernate-entitymanager dependency.
maven returns a slf4j-api.jar but not a log4j adapter for slf. It must be done explicitly with dependency slf4j-log4j12.
Also it is important to get the right version. Hibernate use slf4j 1.4.2 so the log4j adapter must also be in this vesion.
So, now i have slf4j-api and log4j adapter in the classpath and my log4j configuration will be used correctly.
I dug through the Hibernate source code and did not see any place where the parameter values are printed, but then I could have missed it. Perhaps you can ask on the hibernate forum if there is any way to do this.
Now the parameters all will be printed.
The only thing to do is to configure the logger.
Logger for org.hibernate.type must be configured with trace/debug.