在hibernate.cfg.xml中,当我们配置show_sql为true时:
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
执行测试文件,控制台会输出:
Hibernate: insert into Teacher (name, title, id) values (?, ?, ?)
当我们再配置format_sql时:
<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>
<property name="format_sql">true</property>
执行测试文件,控制台显示:
create table Teacher (
id integer not null,
name varchar(255),
title varchar(255),
primary key (id)
)
10:37:35,085 INFO SchemaExport:268 - schema export complete
Hibernate:
insert
into
Teacher
(name, title, id)
values
(?, ?, ?)
显示效果不同!