Loading the transition field of a JPA object
1 answer
You can use JPA lifecycle listeners. You can define listener callback methods inside your object or in your own class.
Since you want to filter the data coming from the DB, you must use a callback PostLoad
.
The easiest way is to add a listener method to your entity class:
@PostLoad
public/protected void calcLimit() {
// calculate limit
}
+4
source to share