Skip to content

Commit 7e1a740

Browse files
jrenaatbeikov
authored andcommitted
HHH-18765 - fix error in the booleanarray_to_string auxiliary function for Oracle
Signed-off-by: Jan Schatteman <[email protected]>
1 parent 62b6ed5 commit 7e1a740

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public String[] getSqlCreateStrings(
6464
);
6565
final String valueExpression = determineValueExpression( "t.value", elementSqlTypeCode, elementDdlTypeCode, elementType );
6666
final String jsonElementType = determineJsonElementType( elementSqlTypeCode, elementDdlTypeCode, elementType );
67+
final boolean isBooleanType = elementType.equalsIgnoreCase( "boolean" );
6768
return new String[] {
6869
"create or replace type " + arrayTypeName + " as varying array(" + arrayLength + ") of " + elementType,
6970
"create or replace function " + arrayTypeName + "_cmp(a in " + arrayTypeName +
@@ -251,7 +252,7 @@ public String[] getSqlCreateStrings(
251252
"for i in 1 .. arr.count loop " +
252253
"if arr(i) is not null then " +
253254
"if length(res)<>0 then res:=res||sep; end if; " +
254-
"res:=res||arr(i); " +
255+
(!isBooleanType ? "res:=res||arr(i); " : "if arr(i) then res:=res||'true'; else res:=res||'false'; end if; ") +
255256
"elsif nullVal is not null then " +
256257
"if length(res)<>0 then res:=res||sep; end if; " +
257258
"res:=res||nullVal; " +

0 commit comments

Comments
 (0)