Spring Boot jpa/hibernate/spring Data

Source: Internet
Author: User

1. What is Jpa?

JPA full name Java persistence API. JPA describes the mapping of objects-relational tables through JDK 5.0 annotations or XML , and persists entity objects for the run-time into the database.

JPA (Java Persistence API) is the Java Persistence specification proposed by Sun . It provides Java developers with an object / Relational Mapping tool to manage relational data in Java applications.

Persistence of

Persistence ( Persistence), which saves data (such as objects in memory) to a storage device that can be permanently saved (such as a disk). The primary application of persistence is to store objects in memory in the database, or in a disk file,inan XML data file, and so on.

Persistence is the mechanism by which program data is transformed between a persistent state and a transient state.

JDBC is a kind of persistence mechanism. File IO is also a persistence mechanism.

Specification

Specification : The so-called norm means an express or customary standard. such as: ethics, technical specifications, corporate governance norms.

then the Persistence specification is the specification that Sun Specifies for the layer of persistence, and if no JPA specification is specified, then the new framework is at its own standards.

That's why we developers can't focus our experience on our business, but rather how we're going to be compatible, which is kind of like Android Development,

Android has its own official SDK, but because SDK too open source, resulting in a number of vendors based on SDK two times development, but the compatibility is not very good,

The best example is Android The Avatar upload, is a very annoying thing. Well, Here's what JPA is about.

2. What is Hibernate?

Hibernate is an open-source object-relational mapping framework that provides a very lightweight object encapsulation of JDBC, which maps POJO to database tables .

is a fully automatic ORM Framework, Hibernate can be automatically generated SQL statement, automatically executes, making Java programmers can use object programming thinking to manipulate databases at their own whim.

Hibernate can be applied to any use JDBC the occasion, either in Java client program, or you can use the servlet/jsp of the Web The most revolutionary thing to use in the application,

Hibernate can be applied in the EJB of the Java the schema replaces CMP to complete the task of data persistence.

Orm

ORM is the meaning of the object-relational mapping, English: Object Relational Mapping abbreviation ORM is a program technology that enables data conversion between systems of different system types in an object-oriented programming language.

Well, more concepts need to be dug by themselves, this is just thrown under the jade.

3. What is Spring Data?

Spring Data is an open-source framework for simplifying database access and supporting cloud services.

Its main goal is to make database access easy and fast, and to support Map-reduce Framework and cloud computing data Services.

In addition, it supports data services based on relational databases, such as Oracle RAC and so on. For projects with huge amounts of data,

can be used Spring Data to simplify the development of the project, as Spring Framework the JDBC , ORM 's support,

Spring Data makes it easier to access data.

4. What is Spring Data JPA?

What is Spring Data JPA capable of?

can greatly simplify the The JPA notation enables access to and manipulation of data in situations where there is little or no write implementation.

except CRUD , it also includes some common functions such as paging, sorting, and so on.

first of all, we need to be clear Spring Data is an open source framework in which spring data JPA is just a module in this framework,

so the name was called Spring Data JPA . If you use JPA development alone, you'll find this code is just as annoying as using JDBC development,

so Spring Data JPA The advent of this is to simplify JPA , so that you only need to write an interface to inherit a class can be implemented CRUD the operation.

5.jpa/hibernate Relationship

JPA is a specification, and Hibernate is an implementation of it. In addition to Hibernate, there are Eclipselink ( formerly toplink),OpenJPA , etc. to choose from,

so use Jpa One benefit is that you can replace the implementation without having to change too much code.

Spring Boot jpa/hibernate/spring Data

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.