IBATIS

IBATIS

Infobox Software
name = Apache iBATIS



caption =
developer = Apache Software Foundation
latest release version =
latest release date =
latest preview version =
latest preview date =
operating system = Cross-platform
programming language = Java
genre = Persistence Framework
license = Apache License 2.0
website = http://ibatis.apache.org

iBATIS is a persistence framework which automates the mapping between SQL databases and objects in Java, .NET, and Ruby on Rails. In Java, the objects are POJOs (Plain Old Java Objects). The mappings are decoupled from the application logic by packaging the SQL statements in XML configuration files. The result is a significant reduction in the amount of code that a developer needs to access a relational database using lower level APIs like JDBC and ODBC.

Other persistence frameworks such as Hibernate allow the creation of an object model (in Java, say) by the user, and create and maintain the relational database automatically. iBatis takes the reverse approach: the developer starts with an SQL database and iBatis automates the creation of the Java objects. Both approaches have advantages, and iBatis is a good choice when the developer does not have full control over the SQL database schema. For example, an application may need to access an existing SQL database used by other software, or access a new database whose schema is not fully under the application developer's control, such as when a specialized database design team has created the schema and carefully optimized it for high performance.

Usage

For example, assume there is a database table PRODUCT (PROD_ID "INTEGER", PROD_DESC "VARCHAR(64)") and a Java object com.example.Product (id: "int", description: "String"). To read the product record having the key PRD_ID into a new Product POJO, the following mapping is added into an iBatis XML mapping file:

A new Java Product object can then be retrieved from the database for product number 123 as follows:

Product resultProduct = sqlMapClient.queryForObject("getProduct", 123);

In the mapping file example, #value# refers to the long integer value passed into the query. If the parameter is a java object, then values from properties on that object can be inserted into the query using a similar # notation. For example, if the parameter class is a com.example.Product which has a property called id, then #value# can be replaced with #id#. The sqlMapClient object is an instance of class com.ibatis.sqlmap.client.SqlMapClient.

Availability

The founder of iBatis has [http://www.clintonbegin.com/2008/02/clintons-java-5-rant.html publicly stated his dismay with Java 5] , but has continued to release new versions of iBatis for Java. Versions 2.3.1 and 2.3.2 came out in April 2008, and 2.3.3 in July. Work is also underway on release 3.0.0, whose features are being discussed [http://opensource.atlassian.com/confluence/oss/display/IBATIS/iBATIS+3.0+Whiteboard here] .

The framework is currently available in Java, .NET, and Ruby (RBatis) versions.

The Apache iBator tool is closely related: it connects to your database and uses SQL introspection to generate iBatis mapping files and Java classes.

ee also

*Hibernate
*EclipseLink
*Spring Framework
*pureQuery

References

*
*

External links

* [http://ibatis.apache.org/ iBATIS project page at the Apache Foundation]
* [http://ibatis.apache.org/ibator The iBator project at Apache]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • iBATIS — Entwickler Apache Software Foundation Aktuelle Version 3.0 (Java), 1.6.2/1.9.2 (.Net) (17. April 2010) Aktuelle Vorabversion mybatis 3.0.1 (19. Mai …   Deutsch Wikipedia

  • iBATIS — Desarrollador Apache Software Foundation http://ibatis.apache.org Información general Última versión estable 2.3.4 …   Wikipedia Español

  • IBATIS — Saltar a navegación, búsqueda iBATIS es un framework (método de trabajo) de código abierto basado en capas desarrollado por Apache Software Foundation, que se ocupa de la capa de Persistencia (se sitúa entre la lógica de Negocio y la capa de la… …   Wikipedia Español

  • IBATIS — est un framework Apache de persistance qui permet de mettre en correspondance des requêtes SQL et des instances d objet. Sommaire 1 Principe 2 Association entre objets et relations 3 …   Wikipédia en Français

  • IBatis — est un framework Apache de persistance qui permet de mettre en correspondance des requêtes SQL et des instances d objet. Sommaire 1 Principe 2 Association entre objets et relations 3 …   Wikipédia en Français

  • iBATIS — est un framework Apache de persistance qui permet de mettre en correspondance des requêtes SQL et des instances d objet. Le 21 mai 2010 l équipe de développement a décidé de se déplacer de l Apache Software Foundation vers Google Code en… …   Wikipédia en Français

  • MyBatis — Desarrollador El equipo MyBatis http://www.mybatis.org Información general Última versión estable 3.0.6 9 de octubre de 2011; …   Wikipedia Español

  • MyBatis — Developer(s) The MyBatis team Stable release 3.0.6 / October 9, 2011; 18 days ago (2011 10 09) Development status Active Written in …   Wikipedia

  • Mapping objet-relationnel — Un mapping objet relationnel (en anglais object relational mapping ou ORM) est une technique de programmation informatique qui crée l illusion d une base de données orientée objet à partir d une base de données relationnelle en définissant des… …   Wikipédia en Français

  • Spring Framework — Infobox Software name = Spring Framework caption = developer = [http://www.springsource.com SpringSource] latest release version = 2.5.5 latest release date = release date|2008|06|23 latest preview version = latest preview date = operating system …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”