Hibernate Interview QuestionsDownload Hibernate Interview Questions PDF
Hibernate Interview Questions
Please Provide an Answer
Difference between save and persist in Hibernate
|Return Type||Returns Serializable object||Returns Void|
Following are the concurrency strategies that can be implemented by the developer:
- Transactional: This strategy is used mostly to read data where the prevention of stale data is critical in concurrent transactions, in the unique case of an update.
- Read- Only: This strategy is compatible with the data that can’t be modified. We can use it for reference data only.
- Read-Write: It is similar to transactional strategy. where we read mostly data and prevention of stale data is critical.
- Non-strict-Read-Write: This strategy assures no guarantee of consistency between the database and cache. We can use this strategy only if the data can be modified and a small likelihood of stale data is not the critical concern.
- It is used to define specific mappings from Java classes to database tables.
- It is used to define the mapping of unique ID attribute in class to the primary key of the database table.
- It is used to generate the primary key values automatically.
- It is used to map a Java class property to a column in the database table.
- It is used to map a java.util.set, java.util.Sortedset property in hibernate.
- It is used to map a java.util.List property in hibernate.
- It is used to map a java.util.Collection property in hibernate.
- It is used to map a java.util.Map property in hibernate.
Session.createSQLQuery is used to create a new instance of a query for the SQL query string.
- Hibernates allows us to focus on business logic, eliminating all the boiler-plate code that comes with JDBC and handles the resources.
- Code implementation becomes independent as Hibernate framework provides the support for XML and also to the JPA annotations.
- HQL is powerful Query Language which is similar to SQL, and HQL understands the concepts of polymorphism, inheritance, and association, which makes it fully object-oriented.
- Better performance can be achieved by Hibernate cache.
- It supports Lazy initialization with the use of proxy objects and when required performs actual database queries.
- We can execute native SQL queries using hibernate for vendor specific feature.
On the whole, hibernate makes it a better choice in the current market for ORM tool, as it contains all the features that you will require in an ORM tool.
It is an Object-Oriented Query Language and is independent of the database.
- It allows business code access the objects rather than Database tables.
- It hides the details of SQL queries from OO logic.
- It is based on JDBC “under hood”.
- Dealing with database implementation is not required.
- Entities are based on business concepts rather than database structures.
- It generates the automatic key and Transaction management.
- Application development is faster.
- Session: It is used to get a physical network with a database.
- Transaction: It represents the unit of work with a database.
- Query: It uses SQL and HQL string to retrieve the data from the database and create objects.
- Criteria: It is used create and execute object-oriented queries and retrieve the objects.
- Configuration: It represents the properties of files required by Hibernate
- Session Factory: It configures hibernate for the application using the provided configuration file and instantiates the session object.
An instance of Query is used to bind query parameters, restrict the number of results returned by the query and finally to execute the query.
- HSQL Database Engine
- Microsoft SQL Server Database
- Sybase SQL Server
- Informix Dynamic Server
The One-to-Many mapping is implemented using a Set Java collection that does not have any redundant element.
A One-to-Many element of the set element indicates the relation of one object to multiple objects.
Related Interview Questions
Kotlin Interview Questions
Core Java interview questions
Vaadin interview questions
Scala interview questions
Maven interview questions
OpenXava Interview questions
Java Play interview Questions
Groovy interview questions
Hibernate Interview Questions
Java Grails Interview Questions
Apache Ant Interview questions
Apache Kafka Interview Questions
Gradle Interview Questions
JSF Interview Questions
JSP Interview Questions
JUnit Interview Questions
Spring interview questions
Struts interview questions
Spring Boot Interview questions
Servlet interview questions
JDBC interview questions
Subscribe Our NewsLetter
Never Miss an Articles from us.
- Common Interview Questions
- Python Flask Interview Questions
- NoSQL interview questions
- JQuery Interview Questions
- C programming interview questions
- AngularJS Interview Questions
- Node JS Interview Questions with Express
- Core Java interview questions
- HTML Interview Questions
- Laravel interview questions
- Wordpress Interview Questions
- Core PHP Interview Questions