File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
hibernate-core/src/main/java/org/hibernate/dialect Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,18 @@ public String[] getSqlCreateStrings(
6565 dialect
6666 );
6767 final String valueExpression = determineValueExpression ( "t.value" , elementSqlTypeCode , elementType );
68+ boolean isBooleanType = elementType .equalsIgnoreCase ( "boolean" );
6869 return new String [] {
6970 "create or replace type " + arrayTypeName + " as varying array(" + arrayLength + ") of " + elementType ,
71+ !isBooleanType ? "" :
72+ "create or replace function boolean_to_char(bool in boolean) return varchar2 is begin " +
73+ "return " +
74+ "case bool " +
75+ "when true then 'true' " +
76+ "when false then 'false' " +
77+ "else 'null' " +
78+ "end; " +
79+ "end;" ,
7080 "create or replace function " + arrayTypeName + "_cmp(a in " + arrayTypeName +
7181 ", b in " + arrayTypeName + ") return number deterministic is begin " +
7282 "if a is null or b is null then return null; end if; " +
@@ -252,7 +262,7 @@ public String[] getSqlCreateStrings(
252262 "for i in 1 .. arr.count loop " +
253263 "if arr(i) is not null then " +
254264 "if length(res)<>0 then res:=res||sep; end if; " +
255- "res:=res||arr(i); " +
265+ (! isBooleanType ? "res:=res||arr(i); " : "res:=res||boolean_to_char(arr(i)); " ) +
256266 "elsif nullVal is not null then " +
257267 "if length(res)<>0 then res:=res||sep; end if; " +
258268 "res:=res||nullVal; " +
You can’t perform that action at this time.
0 commit comments