Ibatis 简明教程
iBATIS - Overview
iBATIS 是一个持久化框架,它在 Java、.NET 和 Ruby on Rails 中自动执行 SQL 数据库和对象之间的映射。映射与应用程序逻辑相分离,将 SQL 语句封装在 XML 配置文件中。
iBATIS is a persistence framework which automates the mapping between SQL databases and objects in Java, .NET, and Ruby on Rails. The mappings are decoupled from the application logic by packaging the SQL statements in XML configuration files.
iBATIS 是一个轻量级的持久化 API,适合持久化 POJO(旧式纯 Java 对象)。
iBATIS is a lightweight framework and persistence API good for persisting POJOs( Plain Old Java Objects).
iBATIS 是一个众所周知的数据映射器,负责在类属性和数据库表的列之间映射参数和结果。
iBATIS is what is known as a data mapper and takes care of mapping the parameters and results between the class properties and the columns of the database table.
iBATIS 和诸如 Hibernate 等其他持久化框架之间的一个显著差异是 iBATIS 强调使用 SQL,而其他框架通常使用自定义查询语言,如 Hibernate 查询语言 (HQL) 或企业 JavaBean 查询语言 (EJB QL)。
A significant difference between iBATIS and other persistence frameworks such as Hibernate is that iBATIS emphasizes the use of SQL, while other frameworks typically use a custom query language such has the Hibernate Query Language (HQL) or Enterprise JavaBeans Query Language (EJB QL).
iBATIS Design Philosophies
iBATIS 采用以下设计理念:
iBATIS comes with the following design philosophies −
-
Simplicity − iBATIS is widely regarded as being one of the simplest persistence frameworks available today.
-
Fast Development − iBATIS does all it can to facilitate hyper-fast development.
-
Portability − iBATIS can be implemented for nearly any language or platform such as Java, Ruby, and C# for Microsoft .NET.
-
Independent Interfaces − iBATIS provides database-independent interfaces and APIs that help the rest of the application remain independent of any persistence-related resources.
-
Open source − iBATIS is free and an open source software.
Advantages of iBATIS
iBATIS 提供以下优势:
iBATIS offers the following advantages −
-
Supports stored procedures − iBATIS encapsulates SQL in the form of stored procedures so that business logic is kept out of the database, and the application is easier to deploy and test, and is more portable.
-
Supports inline SQL − No precompiler is needed, and you have full access to all of the features of SQL.
-
Supports dynamic SQL − iBATIS provides features for dynamically building SQL queries based on parameters.
-
Supports O/RM − iBATIS supports many of the same features as an O/RM tool, such as lazy loading, join fetching, caching, runtime code generation, and inheritance
iBATIS 在开发面向数据库应用程序时使用 JAVA 编程语言。在继续阅读之前,请确保您理解过程式和面向对象编程的基础知识,比如控制结构、数据结构和变量、类、对象等。
iBATIS makes use of JAVA programming language while developing database oriented application. Before proceeding further, make sure that you understand the basics of procedural and object-oriented programming − control structures, data structures and variables, classes, objects, etc.
要详细了解 JAVA,您可以阅读我们的 JAVA Tutorial 。
To understand JAVA in detail you can go through our JAVA Tutorial.