hibernate mysql 方言使用的问题
2013-04-08 20:35
148 查看
今天在使用hibernate 自动建表时出现 建表错误 ;现总结一下:
如果mysql数据库版本为5.0以上的 建表类型为type=InnoDB的话 则创建不成功
如果mysql数据库版本为5.0以上的 建表类型为type=InnoDB的话 则创建不成功
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name = "hibernateProperties" > <props > <!-- 这里注意mysql的方言 当为 MySQL5InnoDBDialect 表示支持mysql5.0以上版本 自动创建的表 类型为engine=InnoDB 如果为MySQLInnoDBDialect 表示支持mysql5.0以下的版本 自动创建的表类型为 type=InnoDB 请注意自己的mysql数据库版本 是否与方言匹配 --> <prop key = "hibernate.dialect" > org.hibernate.dialect.MySQL5InnoDBDialect </prop > <prop key = "hibernate.show_sql" > true </prop > <prop key = "hibernate.format_sql" > true </prop > <prop key = "hibernate.hbm2ddl.auto" > update </prop > </props > </property > <property name="configLocations"> <list> <value>classpath:hibernate.cfg.xml</value> </list> </property> </bean>
相关文章推荐
- 不同MySql版本问题需要的Hibernate 方言问题
- 关于配置了数据库方言为MySQLInnoDBDialect后Hibernate不能自动建表的问题
- 使用hibernate时MySql内数据乱码问题
- mysql版本导致的hibernate 方言问题
- 使用Hibernate和Mysql中文乱码问题解决
- 关于配置了数据库方言为MySQLInnoDBDialect后Hibernate不能自动建表和建库的问题
- 关于配置了数据库方言为MySQLInnoDBDialect后Hibernate不能自动建表的问题
- 初学者使用hibernate连接MySQL出现unable to create connection check your url问题
- MySQL之—— 使用Hibernate连接MySQL数据库,MySQL连接超时断开的问题
- 使用Hibernate连接MySQL数据库,MySQL连接超时断开的问题
- 使用hibernate时由mysql移植到oracle上时可能出现的问题
- Hibernate | Spring JPA | MySQL 使用过程遇到的一些问题
- spring hibernate mysql 使用中的问题及解决方法
- 使用hibernate时由mysql移植到oracle上时可能出现的问题
- 使用hibernate读写mysql中文乱码问题(变?号)~
- Hibernate | Spring JPA | MySQL 使用过程遇到的一些问题
- 使用hibernate连接mysql自动中断的问题
- mysql版本导致的hibernate 方言问题
- 使用hibernate造成的MySql 8小时问题解决方案