I would like to ask a question regarding Lazy Fetching in Hibernate.
As far as I know, in order to implement Lazy Fetching, Hibernate creates a placeholder that is a proxy of the real property.
What if my entity includes a String property or other final class? How will CGLIB subclass it?
Telling the long story short:
Could not generate CGLIB subclass of class [class SomeClass]: Common causes of this problem include using a final class or a non-visible class
myEntity.getMyString() |_ proxy.getMyString() |_ lazyAttributeLoadingInterceptor.fetchAttribute(myEntity,"myString") |_ ... (actual call to underlying DB if required)
That is, everything you state here is correct:
Hibernate creates a placeholder that is a proxy of the real ...
if you end this phrase with the word entity/pojo instead of property