1. Is there a tool which shows the exact native SQL that Hibernate Generates. If we turn on show-sql, it displays SQL but with placeholders like ?.
You can turn on debug logging for org.hibernate.type and you'll see the bound values. Alternatively p6spy will expose bound parameters in PreparedStatements.
2. By default saveOrUpdate() or update() tries to update every possible column in the DB even though just a single column changed. This is not the best performance strategy. Is there a workaround?
No. This is just one of the trade offs of using an ORM. Is this much of a performance concern though? Unless your table uses very large data types or has a lot of indices I doubt it iwould be that bad. If you have a performance issue you could always swap to using HQL (or SQL) to do the update for the problematic table.
However, the log output produces for Hibernate queries is the same as the output produced by Hibernate logger. It shows all placeholders with ? not the actual vales. Is there any way to configure the same??
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
Devious Experiments for a Truly Passive Greenhouse!