日期:2014-05-16 浏览次数:20565 次
package com.sense.workflow.util; import java.sql.Types; import org.hibernate.Hibernate; import org.hibernate.dialect.MySQL5Dialect; /** * mysql注册类型映射 * @author Kevin12 * */ public class ExtMySQL5Dialect extends MySQL5Dialect{ public ExtMySQL5Dialect(){ super(); this.registerHibernateType(Types.LONGVARCHAR, Hibernate.STRING.getName()); } }
<property name="hibernate.connection.url"> jdbc:mysql://127.0.0.1:3306/myworkflow?characterEcoding/=utf-8 </property> <property name="hibernate.connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">root</property> <property name="hibernate.dialect"> [color=red]org.hibernate.dialect.MySQLInnoDBDialect[/color] </property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.url"> jdbc:mysql://127.0.0.1:3306/myworkflow?characterEcoding/=utf-8 </property> <property name="hibernate.connection.driver_class"> com.mysql.jdbc.Driver </property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password">root</property> <property name="hibernate.dialect"> <!-- org.hibernate.dialect.MySQLInnoDBDialect --> [color=red][b]com.sense.workflow.util.ExtMySQL5Dialect[/b][/color] </property> <property name="hibernate.hbm2ddl.auto">update</property> <property name="hibernate.show_sql">true</property>