开发者

hibernate show_sql value

this is exa开发者_开发问答mple 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 '?'


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...


You need to set up your logging framework to log this level of details. See here for the various loggers that Hibernate uses, and how to use them.

The particular one that you want is:

  • org.hibernate.type - Log all JDBC parameters


not directly. you can use log4jdbc to log all the data that is sent over jdbc. It has a logger that inlines the prepared statement values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜