Hibernate Interview Questions And Answers

Hibernate's primary feature is mapping from Java classes to database tables (and from Java data types to SQL data types). Hibernate also provides data query and retrieval facilities. Hibernate generates the SQL calls and relieves the developer from manual result set handling and object conversion, keeping the application portable to all SQL databases, with database portability delivered at very little performance overhead.

Hibernate provides transparent persistence for Plain Old Java Objects (POJOs). The only strict requirement for a persistent class is a no-argument constructor, not compulsorily public. (Proper behavior in some applications also requires special attention to the equals() and hashCode() methods.)

Hibernate provides a dirty checking feature that avoids unnecessary database write actions by performing SQL updates only on the modified fields of persistent objects.

Hibernate can be used both in standalone Java applications and in Java EE applications using servlets or EJB session beans.



<< Previous               

 

41. What J2EE design problems does Hibernate solves apart from Data Base in-dependency and being an ORM tool?

 1.The persistency complexety is migrated from DAO design pattern we just access pojo for the data


42. What the Core interfaces are of hibernate framework?

 There are many benefits from these. Out of which the following are the most important
one.
i. Session Interface ? This is the primary interface used by hibernate applications.
The instances of this interface are lightweight and are inexpensive to create and destroy.
Hibernate sessions are not thread safe.
ii. SessionFactory Interface ? This is a factory that delivers the session objects to
hibernate application. Generally there will be a single SessionFactory for the whole
application and it will be shared among all the application threads.
iii. Configuration Interface ? This interface is used to configure and bootstrap
hibernate. The instance of this interface is used by the application in order to specify the
location of hibernate specific mapping documents.
iv. Transaction Interface ? This is an optional interface but the above three interfaces
are mandatory in each and every application. This interface abstracts the code from any
kind of transaction implementations such as JDBC transaction, JTA transaction.
v. Query and Criteria Interface ? This interface allows the user to perform queries
and also control the flow of the query execution.


43. Why do you need ORM tools like hibernate?

It will help us to create, fetch, Update and delete using simple pojo (plain java Object).
The hiernate ORM's main benifit comes when we are using collection of databases or when we want to move from one database to the other
we need Hibernate like tools for the purpose of developing the application in short period of time.


44. why Hibernate came in to picture?

To make the application development more productive. Its saves development time and also mainly it deals with Objects(POJO) . and .xml file is nothing but mapping between database column and POJO variable. you can easily switch the database like MySql to Oracle you need not to change any of your code... just you can change a simple dialect in cfg file of hibernate to oracle it works with no error.


45. How does hibernate code looks like?

Session session = getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
MyPersistanceClass mpc = new MyPersistanceClass ("Sample App");
session.save(mpc);
tx.commit();
session.close();
The Session and Transaction are the interfaces provided by hibernate. There are many
other interfaces besides this.


Your Ad Here

46. What are the different types of property and class mappings?

 Typical and most common property mapping

Or



Derived properties

Typical and most common property mapping

Controlling inserts and updates


47. What should SessionFactory be placed so that it can be easily accessed?

As far as it is compared to J2EE environment, if the SessionFactory is placed in JNDI
then it can be easily accessed and shared between different threads and various
components that are hibernate aware. You can set the SessionFactory to a JNDI by
configuring a property hibernate.session_factory_name in the hibernate.properties file.


Your Ad Here

<< Previous               

 
Databases Questions and Answers
 
DB2 Interview Questions and Answers
IMS Interview Questions and Answers
MYSQL Interview Questions and Answers
Oracle Interview Questions and Answers
PL/SQL Interview Questions And Answers
Quel Interview Questions and Answers
SQL Interview Questions and Answers

 
 
.NET Interview Questions and Answers
 
ASP Interview Questions and Answers
C# Interview Questions and Answers
Visual Basic Interview Questions and Answers
 
J2EE Interview Questions and Answers
 
Enterprise Java Beans (EJB) Interview Questions And Answers
Hibernate Interview Questions And Answers
Jave Messaging Service (JMS) Interview Questions And Answers
Jave Server Faces (JSF) Interview Questions And Answers
Java Server Pages (JSP) Interview Questions And Answers
Servlets Interview Questions And Answers
Spring Framework Interview Questions And Answers
Struts Framework Interview Questions And Answers
 
JAVA Interview Questions and Answers
 
Core Java Interview Questions and Answers
Java Platform, Micro Edition (Java ME) Interview Questions And Answers
JAVA GUI Interview Questions and Answers
Java Performance Tuning Interview Questions And Answers
JUnit Interview Questions And Answers
Remote Method Invocation (RMI) Interview Questions And Answers
Unified Modeling Language (UML) Interview Questions And Answers
 
Java Application Server Interview Questions And Answers
 
Tomcat Application Server Interview Questions And Answers
WebLogic Application Server Interview Questions And Answers
 
Mainframe Interview Questions and Answers
 
CICS Interview Questions and Answers
COBOL Interview Questions and Answers
IMS Interview Questions and Answers
JCL Interview Questions and Answers
REXX Interview Questions and Answers
TELON Interview Questions and Answers
VSAM Interview Questions and Answers
 
Object Oriented Language Questions and Answers
 
C Interview Questions and Answers
C++ Interview Questions and Answers
Eiffel Interview Questions and Answers
J2EE Interview Questions and Answers
JAVA Interview Questions and Answers
Sather Interview Questions and Answers
Small talk Interview Questions and Answers
 
Operation Systems Interview Questions and Answers
 
MS DOS Interview Questions and Answers
Unix OS Interview Questions and Answers
Windows Interview Questions and Answers
 
Scripting languages Interview Questions and Answers
 
Java Script Interview Questions and Answers
Practical Extraction and Reporting Language Interview Questions and Answers
PHP Interview Questions and Answers
VBScript Interview Questions and Answers
 
UserInterfaces Questions and Answers
 
Foxit Interview Questions and Answers
Glade Interview Questions and Answers
Tweak Interview Questions and Answers
 
WEB Technologies Questions and Answers
 
AJAX Interview Questions and Answers
HTML Interview Questions and Answers
WML Interview Questions and Answers
XML Interview Questions and Answers
 
Interview Tips And Some Common Questions
 
Behavioral Interview Questions And Answers


Your Ad Here