IBATIS
   HOME

TheInfoList



OR:

iBATIS is a
persistence framework Persistence or Persist may refer to: Math and computers * Image persistence, in LCD monitors * Persistence (computer science), the characteristic of data that outlives the execution of the program that created it * Persistence of a number, a ma ...
which automates the mapping between
SQL Structured Query Language (SQL) (pronounced ''S-Q-L''; or alternatively as "sequel") is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling s ...
databases and objects in Java, .NET, and Ruby on Rails. In Java, the objects are POJOs (
Plain Old Java Object In software engineering, a plain old Java object (POJO) is an ordinary Java object, not bound by any special restriction. The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000: The term "POJO" initially den ...
s). The mappings are decoupled from the application logic by packaging the SQL statements in
XML Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing data. It defines a set of rules for encoding electronic document, documents in a format that is both human-readable and Machine-r ...
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 Java Database Connectivity (JDBC) is an application programming interface (API) for the Java (programming language), Java programming language which defines how a client may access a database. It is a Java-based data access technology used for Java ...
and
ODBC In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An ...
. Other persistence frameworks such as
Hibernate Hibernation is a state of minimal activity and metabolic reduction entered by some animal species. Hibernation is a seasonal heterothermy characterized by low body-temperature, slow breathing and heart-rate, and low metabolic rate. It is most ...
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 a 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. On May 21, 2010 the development team forked the code creating a new project called MyBatis and making new releases there. As a consequence the Apache iBATIS project became inactive and was moved to the Apache Attic in June 2010.


Usage

For example, assume there is a database table and a Java class . To read the product record having the key into a new 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 = (Product) 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 ha
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. The framework is currently available in
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
,
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
, and
Ruby Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
(RBatis) versions. Th
jBati
project is a JavaScript ORM inspired by iBATIS. The Apache iBator tool is closely related: it connects to your database and uses its metadata to generate iBATIS mapping files and Java classes.


History

In 2001 a project called iBATIS was started by Clinton Begin. Originally the focus was on the development of cryptographic software solutions. The first product to be released by iBATIS was Secrets, a personal data encryption and signing tool much like PGP. Secrets was written entirely in Java and was released under an open source license. That year
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
published a paper to demonstrate that its recent
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
1.0 framework was more productive than
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
. For that purpose Microsoft built its own version of Sun's Web "Pet Store", a Web project that Sun had used to show Java best practices (
Java BluePrints Java BluePrints is Sun Microsystems' best practices for Enterprise Java development. This is Sun's official programming model for Java Platform, Enterprise Edition (Java EE) Software Development Kit (SDK). It began with Java Pet Store, the origina ...
).
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
claimed that
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
was 10 times faster and 4 times more productive than
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
. In 2002 Clinton developed an application called JPetStore to demonstrate that
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
could be more productive than
.NET The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
and could also do so while achieving a better architecture than was used in the
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
implementation. JPetStore 1.0 had a big impact and the database layer that Clinton used attracted the attention of the community. Soon, iBATIS Database Layer 1.0 project started, composed of two components: iBATIS DAO and iBATIS SQL Maps. iBATIS 2.0 was released in June 2004. It was a complete redesign while keeping the same features. Clinton donated the iBATIS name and code to
Apache Software Foundation The Apache Software Foundation ( ; ASF) is an American nonprofit corporation (classified as a 501(c)(3) organization in the United States) to support a number of open-source software projects. The ASF was formed from a group of developers of the ...
and the project stayed in the ASF for six years. Eventually iBATIS DAO was deprecated, considering that better DAO frameworks were available, such as Spring Framework. On May 19, 2010 iBATIS 3.0 was published and simultaneously the development team decided to continue the development of the framework at
Google Code Google Developers (previously Google Code) , application programming interfaces (APIs), and technical resources. The site contains documentation on using Google developer tools and APIs—including discussion groups and blogs for developers usin ...
.iBATIS Project Team Moving to Google Code
/ref> under a new project called MyBatis. On June 16, 2010 Apache announced that iBATIS was retired and moved to the Apache Attic.


See also

*
Java Persistence API Jakarta Persistence, also known as JPA (abbreviated from the former name Java Persistence API) is a Jakarta EE application programming interface specification that describes the management of relational data in enterprise Java applications. Per ...
*
Hibernate Hibernation is a state of minimal activity and metabolic reduction entered by some animal species. Hibernation is a seasonal heterothermy characterized by low body-temperature, slow breathing and heart-rate, and low metabolic rate. It is most ...
*
EclipseLink EclipseLink is the open source Eclipse Persistence Services Project from the Eclipse Foundation. The software provides an extensible framework that allows Java developers to interact with various data services, including databases, web services, ...
* Apache Cayenne * IBM PureQuery *nHydrate *
OpenJPA OpenJPA is an open source implementation of the Java Persistence API specification. It is an object-relational mapping (ORM) solution for the Java language, which simplifies storing objects in databases. It is open-source software distributed un ...


References


Bibliography

* *


External links

* {{Apache Software Foundation iBATIS Java (programming language) Object–relational mapping Persistence frameworks