improve code snippets in @Formula annotation jdoc

This commit is contained in:
Gavin 2023-05-14 12:37:24 +02:00
parent 31574081b8
commit 88fea9a2cf
1 changed files with 3 additions and 3 deletions

View File

@ -23,15 +23,15 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME;
* A formula may involve multiple columns and SQL operators:
* <pre>
* // perform calculations using SQL operators
* &#64;Formula("sub_total + (sub_total * tax)")
* long getTotalCost() { ... }
* &#64;Formula("sub_total * (1.0 + tax)")
* BigDecimal totalWithTax;
* </pre>
* <p>
* It may even call SQL functions:
* <pre>
* // call native SQL functions
* &#64;Formula("upper(substring(middle_name from 0 for 1))")
* Character getMiddleInitial() { ... }
* Character middleInitial;
* </pre>
* <p>
* For an entity with {@linkplain jakarta.persistence.SecondaryTable secondary tables},