设置Hibernate 自动生成表字段

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/wpg_boke/article/details/82707049

设置Hibernate 自动生成表字段-配置文件

//2018-07-27:

//wpg:在配置文件:applicationContext.xml 的以下代码配置了Hibernate 自动生成数据库表字段:

<property name="jpaVendorAdapter">
	<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">

		//-----wpg:重要代码:---在控制台打印出sql的信息,链接mysql时候可用-------------------

		<property name="showSql" value="true" />

		//-----wpg:重要代码:---一般情况下,会在项目启动的过程中,自动检查注解的实体和数据表,如果数据库不存在的标,会根据实体自动生成---------

		<property name="generateDdl" value="true" />
	</bean>
</property>

猜你喜欢

转载自blog.csdn.net/wpg_boke/article/details/82707049