Native Hibernate and Hibernate JPA

Source: Internet
Author: User

Native Hibernate and Hibernate JPA

 

According to the official Hibernate website, native Hibernate APIs and Hibernate JPA implementations are available. What is the difference between the two? What are advantages and disadvantages?

 

Hibernate website says there is a native Hibernate API as well as an implementation of JPA. What is the difference between the Native API and JPA implementation? Advantages, disadvantages?

When using Spring MVC to build applications, tomcat is used as the server and mysql is used as the persistent database. For spring, I am a newbie and have never used Hibernate, my team wants to use the ORM solution, and Hibernate is quite popular. I'm not sure. How does Hibernate work? Or should I use native Hibernate or hibernate's JPA implementation? Applications are data-driven and show entities and reports.

 

I am working on a Spring MVC application, using Tomcat as the container, and MySQL for persistence. i'm newer to Spring and never used Hibernate. my team wowould like to use an ORM and Hibernate seems to be the most popular. we're not sure how Hibernate is going to workout or whether we shoshould use native or JPA api. the application will be data driven, data entry, reporting, etc.

I know that using JPA makes it easier for the program to switch to another JPA implementation, even though I don't know if this is required.

I 've read that using JPA makes its easier to switch to another JPA implementation, although I don't know if that will be needed or not.

JPA is a standard for accessing relational databases through ORM, and Hibernate is an implementation of it. To use JPA in the past, you need to use one of its implementations. hibernate is a good choice, but there are other implementations, such as EclipseLink.

JPA is a standard for accessing relational databases through an object oriented API. hibernate is an implementation of this API. when you want to use JPA you need some vendor to implement it, Hibernate is a good choice but there are others like too selink.

The existence of Hibernate lasts longer than that of JPA. Old native APIs still exist, and some functions not provided by standard JPA are provided. If you need to use these functions, Select native APIs and use JPA, that is, more programmers know about it and can use these features through configuration.

Hibernate exists longer than JPA. the native, older API (which was a model for JPA) still exists, and sometimes it offers more possibilities than are exposed through JPA (e.g. orphan removal ). if you need those you need to use the native API. using JPA has other merits, most important (in my opinion) more developers that know it. and you still can use some Hibernate specifics through configuration.

Most of the native hibernate experiences are outdated, such as Hibernate 3, which is a pre-release version of JPA. if you are just getting started, we recommend that you start with JPA, although native has many good reasons for use.

Most tutorials that use Hibernate natively are quite old-as is Hibernate 3, a pre-JPA release. while there are good reasons to use it, they (IMO) typically don't apply to the general audience. so if you are just beginning to learn in this field I wocould suggest to start with JPA.

As an offline resource, there is no time to talk about it. You need to learn from the official documentation as a start, and at least experience it from Hibernate4.

As for recommendations on offsite resources: For good reasons they are not on topic here. but thecurrent official Hibernate documentation wocould be a good start, as wocould be to look for toturial for at least Hibernate 4.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.