@Target(value={METHOD,FIELD})
@Retention(value=RUNTIME)
public @interface Formula
// perform calculations
@Formula( "sub_total + (sub_total * tax)" )
long getTotalCost() { ... }
// call database functions ( e.g. MySQL upper() and substring() )
@Formula( "upper( substring( middle_name, 1 ) )" )
Character getMiddleInitial() { ... }
// this might be better handled through @ColumnTransformer
@Formula( "decrypt(credit_card_num)" )
String getCreditCardNumber() { ... }
ColumnTransformer| Modifier and Type | Required Element and Description |
|---|---|
java.lang.String |
value
The formula string.
|
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.