@Target(value={METHOD,FIELD}) @Retention(value=RUNTIME) public @interface Formula
     // perform calculations
     @Formula( "sub_total + (sub_total * tax)" )
     long getTotalCost() { ... }
 
 
     // call functions
     @Formula( "upper( substring( middle_name, 1 ) )" )
     Character getMiddleInitial() { ... }
 
 
     // this might be better handled through @ColumnTransformer
     @Formula( "decrypt(credit_card_num)" )
     String getCreditCardNumber() { ... }
 ColumnTransformerpublic abstract String value
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.