Skip to content

Commit 742fc4c

Browse files
dreab8beikov
authored andcommitted
Improve Sybase and SQLServer blob lob generation
1 parent 8f9d1a1 commit 742fc4c

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SQLServerLegacyDialect.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,13 @@ public Size resolveSize(
127127
case BLOB:
128128
case CLOB:
129129
case NCLOB:
130-
return Size.length( getDefaultLobLength() );
130+
return super.resolveSize(
131+
jdbcType,
132+
javaType,
133+
precision,
134+
scale,
135+
length == null ? getDefaultLobLength() : length
136+
);
131137
default:
132138
return super.resolveSize( jdbcType, javaType, precision, scale, length );
133139
}

hibernate-community-dialects/src/main/java/org/hibernate/community/dialect/SybaseLegacyDialect.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,13 @@ public Size resolveSize(
104104
case Types.NCLOB:
105105
case Types.CLOB:
106106
case Types.BLOB:
107-
return Size.length( getDefaultLobLength() );
107+
return super.resolveSize(
108+
jdbcType,
109+
javaType,
110+
precision,
111+
scale,
112+
length == null ? getDefaultLobLength() : length
113+
);
108114
case Types.FLOAT:
109115
// Sybase ASE allows FLOAT with a precision up to 48
110116
if ( precision != null ) {

hibernate-core/src/main/java/org/hibernate/dialect/SQLServerDialect.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ public Size resolveSize(
148148
case BLOB:
149149
case CLOB:
150150
case NCLOB:
151-
return Size.length( getDefaultLobLength() );
151+
return super.resolveSize(
152+
jdbcType,
153+
javaType,
154+
precision,
155+
scale,
156+
length == null ? getDefaultLobLength() : length
157+
);
152158
default:
153159
return super.resolveSize( jdbcType, javaType, precision, scale, length );
154160
}

hibernate-core/src/main/java/org/hibernate/dialect/SybaseASEDialect.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,13 @@ public Size resolveSize(
7272
case Types.NCLOB:
7373
case Types.CLOB:
7474
case Types.BLOB:
75-
return Size.length( getDefaultLobLength() );
75+
return super.resolveSize(
76+
jdbcType,
77+
javaType,
78+
precision,
79+
scale,
80+
length == null ? getDefaultLobLength() : length
81+
);
7682
case Types.FLOAT:
7783
// Sybase ASE allows FLOAT with a precision up to 48
7884
if ( precision != null ) {

0 commit comments

Comments
 (0)