|
When a transformer function with nontrivial syntax is used, ColumnTransformer adds the table alias prefix ("<table_alias>.") to more than just the actual column. Example:
@ColumnTransformer(forColumn = "binary_value", read = "XMLSerialize(DOCUMENT binary_value as CLOB)", write = "?")
is transformed to
select /* ... */, XMLSerialize (binaryvalu1_.DOCUMENT binaryvalu1_.binary_value as binaryvalu1_.CLOB) as binary2_9_0_
from table2 binaryvalu1_ /* ... */
In this case the table alias is added to the column itself ("binary_value") as well as to two keywords around it ("DOCUMENT" and "CLOB").
Workaround: In this case the "as CLOB" is the default and can be omitted, leaving only one keyword. Making it look like a function still works for oracle and at the same time tricks ColumnTransformer into the correct behavior:
@ColumnTransformer(forColumn = "binary_value", read = "XMLSerialize(DOCUMENT(binary_value))", write = "?")
|