Hibernate uses Reflection API to create instance of Entity beans. The method Class.newInstance() is used for creating the instance of Entity beans which requires no-args constructor. So if we won’t have no-args constructor in entity beans, hibernate will fail to instantiate it and we will get HibernateException.
- 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?