I’m using bytecode enhancements feature to lazy load parent side association of @*ToOne mappings. Is the getReference() proxy feature turned off because of bytecode enhancements on entities? In my case, it looks like each call to getReference (on entities not cached) will hit the database.
getReference() gives a proxy object and doen’t hit the database. Also, to use bytecode enhancement to enable lazy loading you need to add : hibernate.enhancer.enableLazyInitialization set it to true and also while initialising the list of second entity in the parent entity just in annotation @OneToMany(fetch = FetchType.LAZY)