1) what is Hibernate?
Hibernate is a popular java framework which allows a efficient Object Relation Mapping using configuration files in XML format. It is Handle the database without writing any complex queries.
2) what is ORM?
Object Relational Mapping is the concepts of Hibernate framework which it used to map object and a database and provides a various API to perform a different types of operations on the database tables.
3 )The usage of Configuration Interface in hibernate?
Configuration interface of hibernate framework is used to configure hibernate. Mapping documents of hibernate are located using this interface
4)How do we create session factory in hibernate?
Configuration config = new Configuration();
SessionFactory sessions = config.buildSessionFactory();
5) What are POJOs and what’s their significance?
POJOs( Plain Old Java Objects) are java beans with proper getter and setter methods for each and every properties.
Use of POJOs instead of simple java classes results in an efficient and well constructed code.
POJO is a objects which encapsulates business logic
6)What are the benefits of using Hibernate template?
- Session closing is automated.
- Interaction with hibernate session is simplified.
- Exception handling will be handled automatically.
7)What the benefits are of hibernate over JDBC?
a. Hibernate can be used seamlessly with any type of database as its database independent while in case of JDBC, developer has to write database specific queries.
b. Using hibernate, developer doesn’t need to be an expert of writing complex queries as HQL simplifies query writing process while in case of JDBC, its job of developer to write and execute queries.(each and everytime we have to write the queries).
c. In case of hibernate, there is no need to create connection pools as hibernate does all connection handling automatically while in case of JDBC, connection pools need to be created and also must have to close the connection.
8) How can we reduce database write action times in Hibernate?
Hibernate provides dirty checking feature which can be used to reduce database write times. Dirty checking feature of hibernate updates only those fields which require a change while keeps others unchanged. By using the dirty checking features we can reduce the writing action into the database.
9) What’s the usage of callback interfaces in hibernate?
Callback interfaces of hibernate are useful in receiving event notifications from objects.
For example, when an object is loaded or deleted, an event is generated and notification is sent using callback interfaces.
Comments
Post a Comment