How to lazily load non-relational attributes in a portable way
|

How to lazily load non-relational attributes in a portable way

JPA’s @Basic annotation supports a fetch attribute that you can use to define the FetchType of an entity attribute. That seems to be the same approach as you use to define the fetching behavior of an entity association. So, lazy loading of non-relational entity attributes should be easy, right? Well, unfortunately, it isn’t that easy….