| I wonder if a simple solution would be an option to only qualify the named column. E.g. @ColumnTransformer(forColumn = "binary_value", ... explicitly tells us the column being transformed - we could use that as an indication to only qualify that column name in the read transformation fragment. Miguel MartÃn-Forero that would mean changing your example to:
@ColumnTransformer(
forColumn = "name",
read = "CAST(AES_DECRYPT(name, '"+ SecurityUtil.CIPHER_KEY +"') as CHAR(128))",
write = "AES_ENCRYPT(?, '"+ SecurityUtil.CIPHER_KEY + "')"
)
We could possibly also look at the name of the column the transformer is attached to either via placement or by explicit ColumnTransformer#forColumn. This might be overly simplistic though... WDYT? |