Created
September 18, 2015 18:53
-
-
Save squarepegsys/49de5ceae745a2523a73 to your computer and use it in GitHub Desktop.
Taming SQLServer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.sql.Types | |
public class MySqlServerDialect extends org.hibernate.dialect.SQLServerDialect { | |
public MySqlServerDialect() { | |
registerColumnType(Types.BIGINT, "bigint"); | |
registerColumnType(Types.BIT, "bit"); | |
registerColumnType(Types.CHAR, "nchar(1)"); | |
registerColumnType(Types.VARCHAR, 4000, "nvarchar(\$l)"); | |
registerColumnType(Types.VARCHAR, "nvarchar(max)"); | |
registerColumnType(Types.VARBINARY, 4000, "varbinary(\$1)"); | |
registerColumnType(Types.VARBINARY, "varbinary(max)"); | |
registerColumnType(Types.BLOB, "varbinary(max)"); | |
registerColumnType(Types.CLOB, "nvarchar(max)"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment