Yesterday, JPETSTORE was going to learn, so I watched the document on today's official website to Ibatis.
Found that SQL MAPS is indeed worth learning and applying.
--------
Ibatis can be said to be very easy to get started, just know that JavaBeans, XML, and SQL can be successfully applied.
This is also the charm of Ibatis (I think so, huh)
IBATIS provides a very simple and flexible solution corresponding to JavaObject and database.
We only need to use a pure SQL statement to achieve the conversion from the database to JavaObject, and don't write JDBC code.
Just this help us save a lot of time on your code.
iBATIS SQL MAPS requires a simple XML description file to correspond to the relationship between database and javaobjec
Wait the advantages
Below is a few features about Ibatis from the Ibatis website.
10Works with any database that has a JDBC driver (no plugins required) 9Configurable caching (including dependencies) 8Local and Global transaction support and management (JTA) 7Simple XML mapping document structure 6Supports Map, Collection, List and Primitive Wrappers (Integer, String etc. ) 5Supports JavaBeans classes (get / set methods) 4Supports complex object mappings (populating lists, complex object models etc.) 3Object models are never perfect (no changes required!) 2Database designs are never perfect (no changes required!) 1You already know SQL Why Waste Time Learning Something Else?
--------
Through the simple example below, I believe that the colleagues who are still strange to iBatis will be excited, I want to practice, I will practice it.
surroundings:
Required class library:
Ibatis common tools - Ibatis-Common.jar
Ibatis SQL MAPS Framework - Ibatis-Sqlmap.jar
A simple SQLMAP definition fragment:
Code in the specific implementation: Integer PK = New Integer (5); address address = (address) SQLMap.QueryForObject ("getaddress", pk);
It is so simple to do.
--------
More better information can be found on http://www.ibatis.com, Chinese tutorials are also oh, huh, huh.