We are genuinely using a JDBC MSSQL driver available here:
http://technet.microsoft.com/en-us/library/ms378422.aspx
This driver needs to endure configured within jboss, the server I'm on.
First you lot demand to extend SQLServerDialect as well as override the VARCHAR definition.
package org.kbs.hibernate.dialect; import java.sql.Types; import org.hibernate.HibernateException; import org.hibernate.dialect.SQLServerDialect; populace course of written report MSSQLServerDialect extends SQLServerDialect { populace UnicodeSQLServerDialect() { super(); registerColumnType(Types.VARCHAR, "nvarchar($l)"); registerColumnType(Types.BIGINT, "bigint"); registerColumnType(Types.BIT, "bit"); } }
Second you lot demand to seat hibernate to role your novel class:
<property name="hibernate.dialect" value="org.kbs.hibernate.dialect.MSSQLServerDialect" />
Reference:
http://grepcode.com/file/repo1.maven.org/maven2/org.hibernate/hibernate-core/3.3.1.GA/org/hibernate/dialect/SQLServerDialect.java
0 komentar:
Please comment if there are any that need to be asked.