Annotation Type ColumnTransformer


  • @Target({FIELD,METHOD})
    @Retention(RUNTIME)
    public @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

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String read
      A SQL expression used to the read the column.
      java.lang.String write
      A SQL expression used to write the column.
    • Element Detail

      • read

        @AliasFor(annotation=DataTransformer.class,
                  member="read")
        java.lang.String 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 called Project the alias would be project_.
        Returns:
        A SQL expression used to read the column.
        Default:
        ""
      • write

        @AliasFor(annotation=DataTransformer.class,
                  member="write")
        java.lang.String write
        A SQL expression used to write the column. Must have exactly one '?' placeholder.
        Returns:
        The expression
        Default:
        ""