mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-06 19:36:03 +00:00
Fix some JSON function rendering issues on HANA
This commit is contained in:
parent
4a2ee83d0c
commit
bcd70a82c4
@ -115,7 +115,7 @@ public String aggregateComponentCustomReadExpression(
|
||||
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 @@ protected void renderArgument(
|
||||
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…
x
Reference in New Issue
Block a user