Skip to content

Commit

Permalink
HHH-18446 Added default SQL type code to LongVarbinaryJdbcType abd Lo…
Browse files Browse the repository at this point in the history
…ngVarcharJdbcType
  • Loading branch information
cigaly committed Oct 17, 2024
1 parent f3f154b commit 89f5eb3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@ public class LongVarbinaryJdbcType extends VarbinaryJdbcType {

private final int jdbcTypeCode;

private final int defaultSqlTypeCode;

public LongVarbinaryJdbcType() {
this(Types.LONGVARBINARY);
}

public LongVarbinaryJdbcType(int jdbcTypeCode) {
this( jdbcTypeCode, jdbcTypeCode );
}

public LongVarbinaryJdbcType(final int jdbcTypeCode, final int defaultSqlTypeCode) {
this.jdbcTypeCode = jdbcTypeCode;
this.defaultSqlTypeCode = defaultSqlTypeCode;
}

@Override
public int getDefaultSqlTypeCode() {
return defaultSqlTypeCode;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@ public class LongVarcharJdbcType extends VarcharJdbcType {

private final int jdbcTypeCode;

private final int defaultSqlTypeCode;

public LongVarcharJdbcType() {
this(Types.LONGVARCHAR);
}

public LongVarcharJdbcType(int jdbcTypeCode) {
this( jdbcTypeCode, jdbcTypeCode );
}

public LongVarcharJdbcType(final int jdbcTypeCode, final int defaultSqlTypeCode) {
this.jdbcTypeCode = jdbcTypeCode;
this.defaultSqlTypeCode = defaultSqlTypeCode;
}

@Override
Expand All @@ -39,6 +46,11 @@ public int getJdbcTypeCode() {
return jdbcTypeCode;
}

@Override
public int getDefaultSqlTypeCode() {
return defaultSqlTypeCode;
}

@Override
public JdbcType resolveIndicatedType(
JdbcTypeIndicators indicators,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ public static void prime(BaselineTarget target) {
target.addDescriptor( BinaryJdbcType.INSTANCE );
target.addDescriptor( VarbinaryJdbcType.INSTANCE );
target.addDescriptor( LongVarbinaryJdbcType.INSTANCE );
target.addDescriptor( new LongVarbinaryJdbcType(SqlTypes.LONG32VARBINARY) );
target.addDescriptor( new LongVarbinaryJdbcType(SqlTypes.LONGVARBINARY, SqlTypes.LONG32VARBINARY) );

target.addDescriptor( CharJdbcType.INSTANCE );
target.addDescriptor( VarcharJdbcType.INSTANCE );
target.addDescriptor( LongVarcharJdbcType.INSTANCE );
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONG32VARCHAR) );
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONGVARCHAR, SqlTypes.LONG32VARCHAR) );

target.addDescriptor( BlobJdbcType.DEFAULT );
target.addDescriptor( ClobJdbcType.DEFAULT );
Expand All @@ -101,7 +101,7 @@ public static void prime(BaselineTarget target) {
target.addDescriptor( Types.NVARCHAR, VarcharJdbcType.INSTANCE );
target.addDescriptor( Types.LONGNVARCHAR, LongVarcharJdbcType.INSTANCE );
target.addDescriptor( Types.NCLOB, ClobJdbcType.DEFAULT );
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONG32NVARCHAR) );
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONGVARCHAR, SqlTypes.LONG32NVARCHAR) );

target.addDescriptor( RowIdJdbcType.INSTANCE );
}
Expand Down

0 comments on commit 89f5eb3

Please sign in to comment.