The term ibatis is derived from the combination of "Internet" and "Abatis", an open source project launched by Clinton begin in 2002. On June 16, 2010 was
Google Hosting, renamed to MyBatis. is a SQL-based mapping support for Java and • NET persistence layer framework. Here we mainly explain Ibatis can also be called MyBatis in Java above
The specific application.
Ibatis provides a durable layer framework that includes SQL maps and data Access objects (DAO).
Compared to "one-stop" ORM solutions such as Hibernate and APACHEOJB, Ibatis is a "semi-automated" ORM implementation.
IBATIS is currently available in three languages, including: Java,. NET and Ruby. It's a ibatis architecture diagram.
Current MainstreamThe so-called "semi-automatic", may understand a little jerky. Throughout the current mainstream ORM (
Object Relational mapping ), both Hibernate and Apache OJB provide the database structure withA more complete package that provides a full set of mapping mechanisms from Pojo to database tables. Programmers often only need to define POJO to the database table mapping, can be through Hibernateor OJB provides a way to complete the persistence layer operation. Programmers do not even need to be proficient in SQL, and HIBERNATE/OJB automatically generates corresponding SQL based on the stored logic that is developed.and invoke the JDBC interface for execution. In most cases (especially for new projects, the development of new systems), such a mechanism drawbacks, eminence momentum. However, in some specific circumstances, such aStation-style solutions are not necessarily an inspiration. the flaw of fully automatic ORMHowever, during the development of the system, the following situations are often encountered:1. Some or all of the system's data comes from an existing database, security considerations, only a few select SQL (or stored procedures) for the development team to obtain the required data, the specific table structureNot disclosed. 2. In the development specification, all database operations that involve the business logic section must be implemented in the database layer by the stored procedure (for the financial industry in which the author works, ICBC,BOC, Bank of communications, are strictly specified in the development specification)3. The huge amount of system data processing and the extremely stringent performance requirements often mean that we have to achieve system performance design metrics through highly optimized SQL statements (or stored procedures). faced with such demand, again raised Hibernate Broadsword, but found that the blade is no longer sharp, even can not use, but? Trance, had to touch the JDBC ready to die ...It's a bit bleak to say, it's actually a good choice to use JDBC directly for database operations, just procrastination in database access code, boring field reads.
implementation mechanism of Ibatis semi-automation"semi-automated" ibatis, but just solved the problem. The "semi-automatic" here is "fully automated", which provides a comprehensive database encapsulation mechanism relative to hibernate etc.ORM implementations, the "fully automated" ORM implements the mapping between POJO and database tables, as well as the automatic SQLbuild and execute. And Ibatis's point of focus isthe mapping relationship between POJO and SQL. In other words, IbatisSQL execution is not automatically generated for programmers at run time. The specific SQL needs to be written by the programmer and thenby mappingThe required parameters for SQL, and the returned result fields to the specified POJO.
the difference and connection between Ibatis and Hibernate
There is a big difference between ibatis and hibernate, but both solutions are good because they have specific areas. I personally recommend using Ibatis if: you want to create
Own SQL, and was willing to maintain them. Your environment is driven by a relational data model. Your project work has a complex architecture.
Simply use Hibernate if: Your environment is driven by the object model and you want to automatically generate SQL.
Some differences to illustrate: IBATIS: simple and faster development time flexible package size smaller Hibernate: Generate SQL for you, which means you don't have to spend time on SQL,
Provides a number of more advanced caches, high scalability
Another important difference is that Ibatis uses SQL statements that may be dependent on the database, and that using Hibernate HQL is relatively independent of the database, and it is easier to change the database.
Hibernate maps Java as the Pojo object, Ibatis maps resultset, and gives Pojo objets database tables from the JDBC API.
If you use a stored procedure, you can do this in hibernate, but it's a bit difficult to compare in Ibatis. Mapping results as an alternative solution for Ibatis
Set object, so there is no need to care about the table structure. This is ideal for stored procedures and is ideal for reporting applications. Finally, hibernate and Ibatis are open source objects
Relational mapping (ORM) is a tool available in the industry. The use of these tools depends on you. Hibernate and Ibatis also have good support from the spring framework to
It should not be a problem to choose one of them.
Ibatis The basic concept of the first to come here (in fact, copy Baidu Encyclopedia Kazakhstan ~), the next we will explain the specific use of Ibatis processThis is a real thing ~ ~ You know ~All right, let's get here today.
Ibatis Basic Content Introduction