Package io.micronaut.data.annotation.sql
Annotation Interface ColumnTransformer
Inspired by Hibernate's annotation of the same name. This annotation allows
for a custom SQL expression when reading and writing a property.
The write expression must contain exactly one '?' placeholder for the value.
For example: read="decrypt(payment_.credit_card_num)" write="encrypt(?)"
- Since:
- 1.0
- Author:
- graemerocher
-
Optional Element Summary
-
Element Details
-
read
A SQL expression used to the read the column. Note that to reference a column you must use the appropriate alias prefix, which is the table name followed by an underscore. For example for an entity calledProject
the alias would beproject_
.- Returns:
- A SQL expression used to read the column.
- Default:
- ""
-
write
A SQL expression used to write the column. Must have exactly one '?' placeholder.- Returns:
- The expression
- Default:
- ""
-