Hibernate的配置

配置Hibernate

1、在项目中引入Hibernate的Jar包

在 WebContent/WEB-INF/lib 目录下 导入jar包

2、在Java Resources 下创建 hibernate.cfg.xml,并填写相应信息

创建:

配置:

修改 hibernate.cfg.xml  

复制代码
        <!-- 调试 -->
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        
        <!-- 自动建表方式 -->
        <property name="hibernate.hbm2ddl.auto">update</property>
复制代码

3、创建 Hibernate Console Configuration

4、创建 Hibernate Reverse Engineering File

原文地址:https://www.cnblogs.com/HRZJ/p/6064306.html