hibernate show_sql value

hibernate, java

Solution

Set your logging leven to "TRACE". In your log4j.properties (assuming your using Log4J):

log4j.logger.org.hibernate=TRACE

Will result in lots of logging tough...

Problem

this is example of how sql is showed when using show_sql=true ``` Hibernate: select propertyse0_.entity_name as entity1_3_0_, propertyse0_.entity_id as entity2_3_0_, propertyse0_.entity_key as entity3_3_0_, propertyse0_.key_type as key4_3_0_, propertyse0_.boolean_val as boolean5_3_0_, propertyse0_.double_val as double6_3_0_, propertyse0_.string_val as string7_3_0_, propertyse0_.long_val as long8_3_0_, propertyse0_.int_val as int9_3_0_, propertyse0_.date_val as date10_3_0_ from OS_PROPERTYENTRY propertyse0_ where propertyse0_.entity_name=? and propertyse0_.entity_id=? and propertyse0_.entity_key=? ``` possible to show value to gather with the sql rather than '?'

Original source