【发布时间】:2014-11-02 10:13:20
【问题描述】:
Schema不存在不自动创建如何解决,如果数据库名存在表示自动创建表但schema不存在表示在运行时没有创建schema怎么办。
休眠属性
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>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
</prop>
</props>
</property>
</bean>
【问题讨论】:
标签: java mysql spring hibernate