Skip to content

Commit 4cfd4db

Browse files
committed
HHH-18446 Simplifying
1 parent 89f5eb3 commit 4cfd4db

File tree

3 files changed

+9
-23
lines changed

3 files changed

+9
-23
lines changed

hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarbinaryJdbcType.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@
1414
public class LongVarbinaryJdbcType extends VarbinaryJdbcType {
1515
public static final LongVarbinaryJdbcType INSTANCE = new LongVarbinaryJdbcType();
1616

17-
private final int jdbcTypeCode;
18-
1917
private final int defaultSqlTypeCode;
2018

2119
public LongVarbinaryJdbcType() {
22-
this(Types.LONGVARBINARY);
23-
}
24-
25-
public LongVarbinaryJdbcType(int jdbcTypeCode) {
26-
this( jdbcTypeCode, jdbcTypeCode );
20+
this( Types.LONGVARBINARY );
2721
}
2822

29-
public LongVarbinaryJdbcType(final int jdbcTypeCode, final int defaultSqlTypeCode) {
30-
this.jdbcTypeCode = jdbcTypeCode;
23+
public LongVarbinaryJdbcType(final int defaultSqlTypeCode) {
3124
this.defaultSqlTypeCode = defaultSqlTypeCode;
3225
}
3326

@@ -43,6 +36,6 @@ public String toString() {
4336

4437
@Override
4538
public int getJdbcTypeCode() {
46-
return jdbcTypeCode;
39+
return Types.LONGVARBINARY;
4740
}
4841
}

hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/LongVarcharJdbcType.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,13 @@
1919
public class LongVarcharJdbcType extends VarcharJdbcType {
2020
public static final LongVarcharJdbcType INSTANCE = new LongVarcharJdbcType();
2121

22-
private final int jdbcTypeCode;
23-
2422
private final int defaultSqlTypeCode;
2523

2624
public LongVarcharJdbcType() {
27-
this(Types.LONGVARCHAR);
28-
}
29-
30-
public LongVarcharJdbcType(int jdbcTypeCode) {
31-
this( jdbcTypeCode, jdbcTypeCode );
25+
this( SqlTypes.LONGVARCHAR );
3226
}
3327

34-
public LongVarcharJdbcType(final int jdbcTypeCode, final int defaultSqlTypeCode) {
35-
this.jdbcTypeCode = jdbcTypeCode;
28+
public LongVarcharJdbcType(final int defaultSqlTypeCode) {
3629
this.defaultSqlTypeCode = defaultSqlTypeCode;
3730
}
3831

@@ -43,7 +36,7 @@ public String toString() {
4336

4437
@Override
4538
public int getJdbcTypeCode() {
46-
return jdbcTypeCode;
39+
return SqlTypes.LONGVARCHAR;
4740
}
4841

4942
@Override

hibernate-core/src/main/java/org/hibernate/type/descriptor/jdbc/internal/JdbcTypeBaseline.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public static void prime(BaselineTarget target) {
8585
target.addDescriptor( BinaryJdbcType.INSTANCE );
8686
target.addDescriptor( VarbinaryJdbcType.INSTANCE );
8787
target.addDescriptor( LongVarbinaryJdbcType.INSTANCE );
88-
target.addDescriptor( new LongVarbinaryJdbcType(SqlTypes.LONGVARBINARY, SqlTypes.LONG32VARBINARY) );
88+
target.addDescriptor( new LongVarbinaryJdbcType( SqlTypes.LONG32VARBINARY) );
8989

9090
target.addDescriptor( CharJdbcType.INSTANCE );
9191
target.addDescriptor( VarcharJdbcType.INSTANCE );
9292
target.addDescriptor( LongVarcharJdbcType.INSTANCE );
93-
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONGVARCHAR, SqlTypes.LONG32VARCHAR) );
93+
target.addDescriptor( new LongVarcharJdbcType( SqlTypes.LONG32VARCHAR) );
9494

9595
target.addDescriptor( BlobJdbcType.DEFAULT );
9696
target.addDescriptor( ClobJdbcType.DEFAULT );
@@ -101,7 +101,7 @@ public static void prime(BaselineTarget target) {
101101
target.addDescriptor( Types.NVARCHAR, VarcharJdbcType.INSTANCE );
102102
target.addDescriptor( Types.LONGNVARCHAR, LongVarcharJdbcType.INSTANCE );
103103
target.addDescriptor( Types.NCLOB, ClobJdbcType.DEFAULT );
104-
target.addDescriptor( new LongVarcharJdbcType(SqlTypes.LONGVARCHAR, SqlTypes.LONG32NVARCHAR) );
104+
target.addDescriptor( new LongVarcharJdbcType( SqlTypes.LONG32NVARCHAR) );
105105

106106
target.addDescriptor( RowIdJdbcType.INSTANCE );
107107
}

0 commit comments

Comments
 (0)