final String lockHint = appendLockHint( aliasedLockOptions, alias ); buffer.replace( start, end, lockHint );
public AbstractTransactSQLDialect() { super(); registerColumnType( Types.BINARY, "binary($l)" ); registerColumnType( Types.BIT, "tinyint" ); registerColumnType( Types.BIGINT, "numeric(19,0)" ); registerColumnType( Types.SMALLINT, "smallint" ); registerColumnType( Types.TINYINT, "smallint" ); registerColumnType( Types.INTEGER, "int" ); registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.DOUBLE, "double precision" ); registerColumnType( Types.DATE, "datetime" ); registerColumnType( Types.TIME, "datetime" ); registerColumnType( Types.TIMESTAMP, "datetime" ); registerColumnType( Types.VARBINARY, "varbinary($l)" ); registerColumnType( Types.NUMERIC, "numeric($p,$s)" ); registerColumnType( Types.BLOB, "image" ); registerColumnType( Types.CLOB, "text" ); registerFunction( "ascii", new StandardSQLFunction( "ascii", StandardBasicTypes.INTEGER ) ); registerFunction( "char", new StandardSQLFunction( "char", StandardBasicTypes.CHARACTER ) ); registerFunction( "len", new StandardSQLFunction( "len", StandardBasicTypes.LONG ) ); registerFunction( "lower", new StandardSQLFunction( "lower" ) ); registerFunction( "upper", new StandardSQLFunction( "upper" ) ); registerFunction( "str", new StandardSQLFunction( "str", StandardBasicTypes.STRING ) ); registerFunction( "ltrim", new StandardSQLFunction( "ltrim" ) ); registerFunction( "rtrim", new StandardSQLFunction( "rtrim" ) ); registerFunction( "reverse", new StandardSQLFunction( "reverse" ) ); registerFunction( "space", new StandardSQLFunction( "space", StandardBasicTypes.STRING ) );
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { switch (sqlCode) { case Types.BLOB: return BlobTypeDescriptor.PRIMITIVE_ARRAY_BINDING; case Types.CLOB: // Some Sybase drivers cannot support getClob. See HHH-7889 return ClobTypeDescriptor.STREAM_BINDING_EXTRACTING; default: return super.getSqlTypeDescriptorOverride( sqlCode ); } }
public AbstractTransactSQLDialect() { super(); registerColumnType( Types.BINARY, "binary($l)" ); registerColumnType( Types.BIT, "tinyint" ); registerColumnType( Types.BIGINT, "numeric(19,0)" ); registerColumnType( Types.SMALLINT, "smallint" ); registerColumnType( Types.TINYINT, "smallint" ); registerColumnType( Types.INTEGER, "int" ); registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.DOUBLE, "double precision" ); registerColumnType( Types.DATE, "datetime" ); registerColumnType( Types.TIME, "datetime" ); registerColumnType( Types.TIMESTAMP, "datetime" ); registerColumnType( Types.VARBINARY, "varbinary($l)" ); registerColumnType( Types.NUMERIC, "numeric($p,$s)" ); registerColumnType( Types.BLOB, "image" ); registerColumnType( Types.CLOB, "text" ); getDefaultProperties().setProperty( Environment.STATEMENT_BATCH_SIZE, NO_BATCH ); }
@Override public IdTableStrategy getDefaultIdTableStrategy() { final StandardIdTableSupport idTableSupport = new StandardIdTableSupport( getIdTableExporter() ) { @Override protected String determineIdTableName(String baseName) { return "#" + baseName; } }; return new LocalTemporaryTableStrategy( idTableSupport ); }
@Override public void initializeFunctionRegistry(SqmFunctionRegistry registry) { super.initializeFunctionRegistry( registry ); registry.registerPattern( "second", "datepart(second, ?1)", StandardSpiBasicTypes.INTEGER ); registry.registerPattern( "minute", "datepart(minute, ?1)", StandardSpiBasicTypes.INTEGER ); registry.registerPattern( "hour", "datepart(hour, ?1)", StandardSpiBasicTypes.INTEGER ); registry.namedTemplateBuilder( "locate", "charindex" ) .setInvariantType( StandardSpiBasicTypes.INTEGER ) .setArgumentCountBetween( 2, 3 ) .register(); registry.registerPattern( "extract", "datepart(?1, ?3)", StandardSpiBasicTypes.INTEGER ); registry.registerPattern( "mod", "?1 % ?2", StandardSpiBasicTypes.INTEGER ); registry.registerPattern( "bit_length", "datalength(?1) * 8", StandardSpiBasicTypes.INTEGER ); registry.register( "trim", new AnsiTrimEmulationFunctionTemplate() ); }
public AbstractTransactSQLDialect() { super(); registerColumnType( Types.BINARY, "binary($l)" ); registerColumnType( Types.BIT, "tinyint" ); registerColumnType( Types.BIGINT, "numeric(19,0)" ); registerColumnType( Types.SMALLINT, "smallint" ); registerColumnType( Types.TINYINT, "smallint" ); registerColumnType( Types.INTEGER, "int" ); registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.DOUBLE, "double precision" ); registerColumnType( Types.DATE, "datetime" ); registerColumnType( Types.TIME, "datetime" ); registerColumnType( Types.TIMESTAMP, "datetime" ); registerColumnType( Types.VARBINARY, "varbinary($l)" ); registerColumnType( Types.NUMERIC, "numeric($p,$s)" ); registerColumnType( Types.BLOB, "image" ); registerColumnType( Types.CLOB, "text" ); registerFunction( "ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER) ); registerFunction( "char", new StandardSQLFunction("char", StandardBasicTypes.CHARACTER) ); registerFunction( "len", new StandardSQLFunction("len", StandardBasicTypes.LONG) ); registerFunction( "lower", new StandardSQLFunction("lower") ); registerFunction( "upper", new StandardSQLFunction("upper") ); registerFunction( "str", new StandardSQLFunction("str", StandardBasicTypes.STRING) ); registerFunction( "ltrim", new StandardSQLFunction("ltrim") ); registerFunction( "rtrim", new StandardSQLFunction("rtrim") ); registerFunction( "reverse", new StandardSQLFunction("reverse") ); registerFunction( "space", new StandardSQLFunction("space", StandardBasicTypes.STRING) );
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.TINYINT ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); }
final String lockHint = appendLockHint( lockMode, alias ); buffer.replace( start, end, lockHint ); correction += ( lockHint.length() - alias.length() );
public AbstractTransactSQLDialect() { super(); registerColumnType( Types.BINARY, "binary($l)" ); registerColumnType( Types.BIT, "tinyint" ); registerColumnType( Types.BIGINT, "numeric(19,0)" ); registerColumnType( Types.SMALLINT, "smallint" ); registerColumnType( Types.TINYINT, "smallint" ); registerColumnType( Types.INTEGER, "int" ); registerColumnType( Types.CHAR, "char(1)" ); registerColumnType( Types.VARCHAR, "varchar($l)" ); registerColumnType( Types.FLOAT, "float" ); registerColumnType( Types.DOUBLE, "double precision" ); registerColumnType( Types.DATE, "datetime" ); registerColumnType( Types.TIME, "datetime" ); registerColumnType( Types.TIMESTAMP, "datetime" ); registerColumnType( Types.VARBINARY, "varbinary($l)" ); registerColumnType( Types.NUMERIC, "numeric($p,$s)" ); registerColumnType( Types.BLOB, "image" ); registerColumnType( Types.CLOB, "text" ); registerFunction( "ascii", new StandardSQLFunction("ascii", StandardBasicTypes.INTEGER) ); registerFunction( "char", new StandardSQLFunction("char", StandardBasicTypes.CHARACTER) ); registerFunction( "len", new StandardSQLFunction("len", StandardBasicTypes.LONG) ); registerFunction( "lower", new StandardSQLFunction("lower") ); registerFunction( "upper", new StandardSQLFunction("upper") ); registerFunction( "str", new StandardSQLFunction("str", StandardBasicTypes.STRING) ); registerFunction( "ltrim", new StandardSQLFunction("ltrim") ); registerFunction( "rtrim", new StandardSQLFunction("rtrim") ); registerFunction( "reverse", new StandardSQLFunction("reverse") ); registerFunction( "space", new StandardSQLFunction("space", StandardBasicTypes.STRING) );
/** * {@inheritDoc} * * @see org.hibernate.dialect.Dialect#getSqlTypeDescriptorOverride(int) */ @Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride( int sqlCode ) { return sqlCode == Types.TINYINT ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride(sqlCode); } }
final String lockHint = appendLockHint( aliasedLockOptions, alias ); buffer.replace( start, end, lockHint );
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.BOOLEAN ? TinyIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); } }
final String lockHint = appendLockHint( lockMode, alias ); buffer.replace( start, end, lockHint ); correction += ( lockHint.length() - alias.length() );
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.TINYINT ? SmallIntSqlDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); }
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { switch (sqlCode) { case Types.BLOB: return BlobSqlDescriptor.PRIMITIVE_ARRAY_BINDING; case Types.CLOB: // Some Sybase drivers cannot support getClob. See HHH-7889 return ClobSqlDescriptor.STREAM_BINDING_EXTRACTING; default: return super.getSqlTypeDescriptorOverride( sqlCode ); } }
@Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride(int sqlCode) { return sqlCode == Types.BOOLEAN ? TinyIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride( sqlCode ); } }
/** * {@inheritDoc} * * @see org.hibernate.dialect.Dialect#getSqlTypeDescriptorOverride(int) */ @Override protected SqlTypeDescriptor getSqlTypeDescriptorOverride( int sqlCode ) { return sqlCode == Types.TINYINT ? SmallIntTypeDescriptor.INSTANCE : super.getSqlTypeDescriptorOverride(sqlCode); } }