Yes, we can make a Hibernate Entity class final, but that’s not a good practice. Since, hibernate use proxy classes for lazy loading of data which is done by extending the entity bean. If the entity bean will be final then lazy loading will not be possible which results into low performance.
- What are the core components are of hibernate architecture?
- What is SessionFactory?
- Is SessionFactory a thread-safe object?
- What is Session?
- Is Session a thread-safe object?
- What will happen if we don’t have no-args constructor in Entity bean?
- Can we make an hibernate entity class final?
- How to log hibernate generated sql queries in log files?