Hibernate 简明教程

Hibernate - Overview

Hibernate 是 Java 的 *O*bject-*R*elational *M*apping (ORM) 解决方案。它是一个由 Gavin King 于 2001 年创建的开源持久性框架。它是面向任何 Java 应用程序的强大、高性能对象关系持久性和查询服务。

Hibernate is an *O*bject-*R*elational *M*apping (ORM) solution for JAVA. It is an open source persistent framework created by Gavin King in 2001. It is a powerful, high performance Object-Relational Persistence and Query service for any Java Application.

Hibernate 将 Java 类映射到数据库表和从 Java 数据类型到 SQL 数据类型,免除了 95% 的开发人员与常见的与数据持久性相关编程任务。

Hibernate maps Java classes to database tables and from Java data types to SQL data types and relieves the developer from 95% of common data persistence related programming tasks.

Hibernate 介于传统 Java 对象和数据库服务器之间,可以基于适当的 O/R 机制和模式处理持久化这些对象的所有工作。

Hibernate sits between traditional Java objects and database server to handle all the works in persisting those objects based on the appropriate O/R mechanisms and patterns.

hibernate position

Hibernate Advantages

  1. Hibernate takes care of mapping Java classes to database tables using XML files and without writing any line of code.

  2. Provides simple APIs for storing and retrieving Java objects directly to and from the database.

  3. If there is change in the database or in any table, then you need to change the XML file properties only.

  4. Abstracts away the unfamiliar SQL types and provides a way to work around familiar Java Objects.

  5. Hibernate does not require an application server to operate.

  6. Manipulates Complex associations of objects of your database.

  7. Minimizes database access with smart fetching strategies.

  8. Provides simple querying of data.

Supported Databases

Hibernate 几乎支持所有主要的 RDBMS。以下是 Hibernate 支持的若干数据库引擎列表:

Hibernate supports almost all the major RDBMS. Following is a list of few of the database engines supported by Hibernate −

  1. HSQL Database Engine

  2. DB2/NT

  3. MySQL

  4. PostgreSQL

  5. FrontBase

  6. Oracle

  7. Microsoft SQL Server Database

  8. Sybase SQL Server

  9. Informix Dynamic Server

Supported Technologies

Hibernate 支持多种其他技术,包括:

Hibernate supports a variety of other technologies, including −

  1. XDoclet Spring

  2. J2EE

  3. Eclipse plug-ins

  4. Maven