package com.atlassian.stash.internal.hibernate.dialect;

import org.hibernate.dialect.SQLServerDialect;

import java.sql.Types;

/**
 * Overrides the types for {@code CHAR}, {@code LONGVARCHAR} and {@code VARCHAR} to use Unicode-ready SQL types.
 *
 * @since 2.1
 */
public class CustomSqlServerDialect extends SQLServerDialect {

    public CustomSqlServerDialect() {
        registerColumnType(Types.CHAR, "nchar($l)");
        registerColumnType(Types.VARCHAR, "nvarchar($l)");
        registerColumnType(Types.LONGVARCHAR, "ntext");
    }
}
