enforce utf8 on mysql

This commit is contained in:
Athou
2013-04-14 09:12:16 +02:00
parent 8f7709b6c4
commit 03a5b54a5a
3 changed files with 12 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jpa.datasource.name>java:openejb/Resource/My DataSource</jpa.datasource.name>
<jpa.show_sql>false</jpa.show_sql>
<jpa.show_sql>true</jpa.show_sql>
</properties>
<build>

View File

@@ -0,0 +1,10 @@
package com.commafeed.backend;
import org.hibernate.dialect.MySQL5InnoDBDialect;
public class MySQL5Dialect extends MySQL5InnoDBDialect {
public String getTableTypeString() {
return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
}
}

View File

@@ -10,6 +10,7 @@
<properties>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="${jpa.show_sql}" />
<property name="hibernate.dialect" value="${jpa.dialect}" />
<property name="hibernate.default_batch_fetch_size" value="100" />
</properties>
</persistence-unit>