Hibernate:MySQLDialect和MySQLInnoDBDialect有什么区别? [英] Hibernate: what's the difference between MySQLDialect and MySQLInnoDBDialect?

查看:242
本文介绍了Hibernate:MySQLDialect和MySQLInnoDBDialect有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySQLDialect和MySQLInnoDBDialect有什么区别?我曾经使用过MySQLDialect,现在我想知道以上是如何不同的。

What's the difference between MySQLDialect and MySQLInnoDBDialect? I've used MySQLDialect ever since, now I wonder how the above are different.

任何人?

推荐答案

MySQL中的默认存储引擎是 的MyISAM 。如果您需要事务和行级锁定,则通常选择 InnoDB

The default storage engine in MySQL is MyISAM. If you need transactions and row-level locking, you often chose InnoDB.

使用 MySQLInnoDBDialect , Hibernate将 type = InnoDB 添加到表创建语句中。这明确创建了一个 InnoDB 表。 MySQLDialect 不会附加引擎字符串,因此会创建 MyISAM 表。

Using MySQLInnoDBDialect, Hibernate appends type=InnoDB to the table creation statement. This explicitly creates an InnoDB table. MySQLDialect does not append an engine string, thus, would create a MyISAM table.

但是,您还可以通过在 my.cnf ,MySQL配置文件中使用以下行来更改MySQL服务器的默认存储引擎。

However, you can also change the default storage engine of the MySQL server by using the following line in your my.cnf, MySQL configuration, file.

default-storage-engine=innodb

这篇关于Hibernate:MySQLDialect和MySQLInnoDBDialect有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆