Env: JBoss Seam, JPA, Hibernate
We use the @PostLoad annotation to dynamically initialize some of the transient variables in our @Entity (sometimes this involves looking up the parent entity to initialize status - which is a costly operation).
But under certain circumstances, we don't want this @PostLoad to get triggered, since we will not rely on the transient variables.
Is there a way to control the data dynamically post load.
One way to solve this issue, is to call this method only on demand (i.e. by removing the @PostLoad annotation and manually calling this method), but this is also error prone.
Are there any other ways to resolve this issue.