Set Table character-set/collation using Hibernate Dialect?
I use Hibernate MySQLInnoDB Dialect to generate DDL's.
hibernate.cfg.x开发者_如何学Pythonml :
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
How can I configure the character-set/Collation to 'utf8_general_ci' for the generated table?
I had the same requirement before and used this article which provides the solutions in great detail. You need to subclass MySQLInnoDBDialect and override the getTableTypeString method. More in the article.
精彩评论