ORM and Hibernate overview

Source: Internet
Author: User

What is JDBC?

JDBC represents a Java database connection and provides a set of Java APIs for Java to access relational databases. These Java APIs allow Java programs to execute SQL statements and interact with any SQL-compatible database.

JDBC provides a flexible framework for writing a data-independent application that can run on a different platform and interact with a database-relational system without any modification

Advantages and disadvantages of JDBC:

Advantages: Clean and simple SQL processing, good performance and big data, very suitable for small applications, simple grammar, easy to learn

Cons: If used in large projects, complex, become expensive, no encapsulation, difficult to implement the MVC concept, query is the specific database management system

What is ORM?

ORM (Object-relational mapping) is a programming idea, in some ways better than JDBC to optimize some

ORM Benefits:

S.N. Advantage 1 Let the business code access the object, not the database table. 2 Object-oriented logical SQL query details are hidden. 3 JDBC-based "under the hood" 4 eliminates the need to process database implementations. 5 entities that are based on business concepts rather than database structures. 6 transaction management and automatic key generation. 7 rapid development of applications.

The ORM solution consists of the following four entities:

S.N. Solve
1 An API to perform basic CRUD operations on the objects of a persisted class.
2 Language or API to specify the referenced class and property query for the class.
3 A configurable device that specifies the mapping metadata.
4 Technology interacts with transactional objects to perform dirty data checks, lazy associative loading, and other optimization functions.

Some Java ORM frameworks

There are several persistence frameworks and Java ORM scenarios. The persistence Framework is an ORM service that stores and retrieves objects to a relational database.

    • Enterprise JavaBeans Entity Bean

    • Java Data Objects

    • Castor

    • TopLink

    • Spring DAO

    • Hibernate

    • and many more

Hibernate

Hibernate is a lightweight ORM framework that has the advantage of being simple to use, powerful, and well-supported for most databases on the market, and that the lightweight framework does not rely on any container
Hibernate principle: Hibernate acts as a DAO layer and automatically generates corresponding SQL statements based on POJO and entity class mappings

ORM and Hibernate overview

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.