1. Introduction Hibernate
Introduction Hibernate
- It is invented by Gavin King in 2001.
- Hibernate Implement specifiaction of JPA ( Java Persistence API ) for the data persistence.
- Hibernate is non-inversive framework , means it wont forces to programmer to extend / implement any class/interface.
- We can build any type of application using hibernate.(like standalone, servlets , desktop etc)
- It is a java framework which is used to develop persistence logic. Persistence logic means to store and process the data for long use.
Advantages of Hibernates
- Hibernate takes care of mapping Java classes to database tables using XML files and without writing any line of code.
- If there is change in the database or in any table, then you need to change the XML file properties only.
- Minimizes database access with smart fetching strategies.
- Fast Performace : The performance of hibernate framework is fast because cache is internally used in hibernate framework.
- Database Independent Query : HQL (Hibernate Query Language) is the object-oriented version of SQL.
- Automatic Table Creation : Hibernate framework provides the facility to create the tables of the database automatically.
What is Persistence ?
- Persistance means process storing and managing tha data for long time.
Persistent classes
- Java classes whose objects or instances will be stored in database tables are called persistent classes in Hibernate.
- Hibernate works best if these classes follow some simple rules, also known as the Plain Old Java Object (POJO) programming model.
- Peristence store : place where the data will be store.
- Peristent Data : the data of persistence is called persistence data Ex : file info , DB table & record
-Persistence operation : insert , update , delete and select operations performed on persistent data. CRUD operation.
- Persitence Logic - The logic that is written to perform crud operation.
JPA : Java Persistence API
- JPA stand for Java Persistence API.
- The JPA specifcation was developed by java as a stadard way to map object to relational tables.
- It is used to save data between java object and relational database. JPA acts as a bridge between object-orinted domain models and relational database system.
- JPA just provides the specification, it does not provide the implementation.
- So we cannot use JPA by itself , u will need to use a JPA provider that implements the JPA framwork.
- Eclipselink, TopLink ,iBatis and Hibernate are some frameworks that implement the JPA specificatoin.
- The advantage of using a framwork that implements the JPA specification is that you can easily switch the framekwork.
Comments
Post a Comment