Hibernate is currently the most popular O/R mapping framework, and it comes from sf.net and is now a part of JBoss.
Ibatis is another excellent O/R mapping framework that is now part of Apache's sub-project.
Ibatis is an ORM implementation of "SQL mapping" relative to Hibernate "O/R".
Hibernate provides a more complete encapsulation of the database structure, and Hibernate's O/R mapping implements the mapping between Pojo and database tables, as well as the automatic generation and execution of SQL. Programmers often only need to define the Pojo to the database table mapping relationship, you can use Hibernate provides methods to complete the persistence layer operation. Programmers do not even need to be proficient in SQL, and HIBERNATE/OJB automatically generates the corresponding SQL and invokes the JDBC interface to execute according to the established storage logic.
The focus of Ibatis is the mapping relationship between Pojo and SQL. In other words, Ibatis does not automatically generate SQL execution for programmers at run time. The specific SQL needs to be written by the programmer, and then mapped to the specified Pojo by mapping the configuration file, the parameters required for SQL, and the returned result fields.
Using the ORM mechanism provided by Ibatis, for business logic implementations, the face is purely Java objects.
This layer is basically consistent with the ORM implementation, and Hibernate automatically generates SQL statements for specific data operations, while Ibatis requires developers to write specific SQL statements. Relative to Hibernate, ibatis the workload of SQL development and the Compromise of database portability, which provides more free space for system design.
Hibernate vs. Ibatis:
1. Ibatis is very simple and easy to learn, hibernate is relatively complex, the threshold is higher.
2. Both are relatively good open source products.
3. When the system belongs to two development, unable to control and modify the database structure, the flexibility of ibatis will be more suitable than hibernate
4. 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). In this case, the Ibatis will have better controllability and performance.
5. Ibatis requires a handwritten SQL statement, or a part of it, hibernate can be generated automatically, and occasionally some hql will be written. The same demand, ibatis a lot more work than hibernate. Similarly, if there are modifications to the database fields, there are few changes to hibernate, and ibatis to change those SQL mapping places one by one.
6. In the database field one by one corresponding to the mapping of the PO and Hibernte This object-based mapping of the PO is very different, the essential difference is that the PO is flat, unlike Hibernate map Po is able to express three-dimensional object inheritance, aggregation and so on, This will directly affect the design of your entire software system.
7. Hibernate is now the mainstream O/R mapping framework, from the richness of documents, product integrity, version development speed is stronger than Ibatis.
O/R Mapping frame: the difference between Ibatis and hibernate