如果不存在Hibernate4和spring4 for mysql,则不会自动创建架构 [英] Schema is not created automatically if not exist Hibernate4 and spring4 for mysql
问题描述
hibernate属性
hibernate.dialect = org.hibernate.dialect.MySQLDialect
hibernate.show_sql = true
hibernate.hbm2ddl.auto = create-update **我也单独使用这些关键字//创建或//更新**
** xml配置**
< bean id =sessionFactory>
class =org.springframework.orm.hibernate4.LocalSessionFactoryBean>
< property name =dataSourceref =dataSource>
< property name =packagesToScanvalue =com.testing.domain>
< property name =hibernateProperties>
< props>
< prop key =hibernate.dialect> $ {hibernate.dialect}
< prop key =hibernate.show_sql> $ {hibernate.show_sql}
< prop key =hibernate.hbm2ddl.auto> $ {hibernate.hbm2ddl.auto}
hibernate properties
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=create-update ** i use these keyword seperately also //create or//update**
**xml configuration**
<bean id="sessionFactory">
class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource">
<property name="packagesToScan" value="com.testing.domain">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}
<prop key="hibernate.show_sql">${hibernate.show_sql}
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}
推荐答案
{hibernate.dialect}
< prop key =hibernate.show_sql>
{hibernate.dialect}
<prop key="hibernate.show_sql">
{hibernate.show_sql}
< prop key =hibernate.hbm2ddl.auto>
{hibernate.show_sql}
<prop key="hibernate.hbm2ddl.auto">
{hibernate.hbm2ddl.auto}
{hibernate.hbm2ddl.auto}
这篇关于如果不存在Hibernate4和spring4 for mysql,则不会自动创建架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!