Fix some JSON function rendering issues on HANA
This commit is contained in:
parent
4a2ee83d0c
commit
bcd70a82c4
|
@ -115,7 +115,7 @@ public class HANAAggregateSupport extends AggregateSupportImpl {
|
|||
if ( SqlTypes.isBinaryType( column.getJdbcMapping().getJdbcType().getDdlTypeCode() ) ) {
|
||||
return template.replace(
|
||||
placeholder,
|
||||
"hextobin(json_value(" + parentPartExpression + columnExpression + "'))"
|
||||
"hextobin(replace(json_value(" + parentPartExpression + columnExpression + "'),'-',''))"
|
||||
);
|
||||
}
|
||||
// Fall-through intended
|
||||
|
|
|
@ -71,19 +71,13 @@ public class HANAJsonObjectAggFunction extends JsonObjectAggFunction {
|
|||
sqlAppender.appendSql( " as nvarchar(" + Integer.MAX_VALUE + "))" );
|
||||
}
|
||||
else {
|
||||
if ( nullBehavior != JsonNullBehavior.NULL ) {
|
||||
sqlAppender.appendSql( "nullif(" );
|
||||
}
|
||||
sqlAppender.appendSql( "json_query((select " );
|
||||
arg.accept( translator );
|
||||
sqlAppender.appendSql( " V from sys.dummy for json('arraywrap'='no'" );
|
||||
if ( nullBehavior != JsonNullBehavior.NULL ) {
|
||||
if ( nullBehavior == JsonNullBehavior.NULL ) {
|
||||
sqlAppender.appendSql( ",'omitnull'='no'" );
|
||||
}
|
||||
sqlAppender.appendSql( ") returns nvarchar(" + Integer.MAX_VALUE + ")),'$.V')" );
|
||||
if ( nullBehavior != JsonNullBehavior.NULL ) {
|
||||
sqlAppender.appendSql( ",'null')" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue