Hibnate SQL Output Configuration

Source: Internet
Author: User

Hibernate configuration file Hibernate.cfg.xml provides three configuration items for displaying SQL, and if it is federated with spring, it can also be configured in spring configuration. Their value is a Boolean value.

1) Hibernate.show_sql-whether the generated SQL statements are displayed, we most often deal with it
2) Hibernate.format_sql-whether to format the generated SQL statements, to increase readability, or to squeeze them all in one line
3) Hibernate.use_sql_comments-Whether a comment is displayed to indicate what operation generated the SQL statement

<prop key= "Hibernate.show_sql" >true</prop> <prop key= "Hibernate.format_sql" >true</prop> <prop key= "Hibernate.use_sql_comments" >true</prop>


Hibnate SQL Output Configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.