And the difference between Hibernate and Mybatis

ORM framework?

Object Relational Mapping, Object - relational mapping.

Project business entity has two forms: the object and relational data, which showed the object in memory, the performance of relational data in the database.

 

Why ORM framework?

ORM framework is object-relational mapping, why do you want to map mapping?

Because there may be associations and inheritance relationships between objects, but in the database, relational data can not express many to many associations and inheritance. (Ps: in database theory, the conversion of many to many would logically plurality of pairs of relations can be achieved) Therefore, objects and relationships (two forms of business entities) want to map correctly, the system generally intermediate project form member, i.e. persistence framework.

 

Hibernate?

Hibernate is an open source object-relational mapping framework.

It jdbc had a very lightweight object encapsulates the (ordinary Java objects) pojo and establish the mapping database tables, is a fully automated ORM framework, even automatically generate SQL statements automatically.

Therefore, programmers can harness all use object programming thinking to manipulate the database.

Hibernate features:

  1. Hibernate by modifying a "persistent" attribute of an object to modify the data records in the database table corresponding to
  2. Threads and processes to provide two levels of caching to enhance application performance
  3. There are a wealth of mapping the way the relationship between Java objects (POJO) is converted into the relationship between database tables
  4. Shield differences between different database implementations. Currently used by the specified database in the form of "tongues" in Hibernate only, can be generated for the actual situation of the underlying database SQL statements
  5. Non-invasive. Hibernate does not require persistent classes implement any interface or extend any class, POJO can

a) Comparison Mybatis, Mybatiis simple installation requires only 2 packets + jar several mapping file sql

 

Mybatis

Mybatis is an excellent persistence framework.

Support for custom SQL, stored procedures and advanced mappings.

Mybatis avoids almost all JDBC code and manual setting parameters and obtaining the result set.

Mybatis using simple xml or annotations native configuration and mapping information to the interface and the JAVA POJOs mapped to database records

Mybaits Features:

  1. Easy to learn. Do not rely on any third party, the simplest requires only two jar package + sql several mapping files, through documentation and source code, you can compare fully grasp its design and implementation
  2. flexible. It does not impose any impact on the existing application or database design. Sql written in xml inside, to facilitate unified management and optimization. By sql basically realize we do not use data access framework can achieve all the features.
  3. Sql decouples the program code. By providing the DAL, the data access logic and business logic separated from the system design more clearly, easier to maintain, easier unit testing.
  4. Providing a mapping label, field support ORM object relationship mapping database
  5. Tags provide object-relational mapping, support for object-relational form maintenance
  6. Providing xml tags, support the development of dynamic sql

 

Uncharacteristic front-end development intern.

ORM framework?

Object Relational Mapping, Object - relational mapping.

Project business entity has two forms: the object and relational data, which showed the object in memory, the performance of relational data in the database.

 

Why ORM framework?

ORM framework is object-relational mapping, why do you want to map mapping?

Because there may be associations and inheritance relationships between objects, but in the database, relational data can not express many to many associations and inheritance. (Ps: in database theory, the conversion of many to many would logically plurality of pairs of relations can be achieved) Therefore, objects and relationships (two forms of business entities) want to map correctly, the system generally intermediate project form member, i.e. persistence framework.

 

Hibernate?

Hibernate is an open source object-relational mapping framework.

It jdbc had a very lightweight object encapsulates the (ordinary Java objects) pojo and establish the mapping database tables, is a fully automated ORM framework, even automatically generate SQL statements automatically.

Therefore, programmers can harness all use object programming thinking to manipulate the database.

Hibernate features:

  1. Hibernate by modifying a "persistent" attribute of an object to modify the data records in the database table corresponding to
  2. Threads and processes to provide two levels of caching to enhance application performance
  3. There are a wealth of mapping the way the relationship between Java objects (POJO) is converted into the relationship between database tables
  4. Shield differences between different database implementations. Currently used by the specified database in the form of "tongues" in Hibernate only, can be generated for the actual situation of the underlying database SQL statements
  5. Non-invasive. Hibernate does not require persistent classes implement any interface or extend any class, POJO can

a) Comparison Mybatis, Mybatiis simple installation requires only 2 packets + jar several mapping file sql

 

Mybatis

Mybatis is an excellent persistence framework.

Support for custom SQL, stored procedures and advanced mappings.

Mybatis avoids almost all JDBC code and manual setting parameters and obtaining the result set.

Mybatis using simple xml or annotations native configuration and mapping information to the interface and the JAVA POJOs mapped to database records

Mybaits Features:

  1. Easy to learn. Do not rely on any third party, the simplest requires only two jar package + sql several mapping files, through documentation and source code, you can compare fully grasp its design and implementation
  2. flexible. It does not impose any impact on the existing application or database design. Sql written in xml inside, to facilitate unified management and optimization. By sql basically realize we do not use data access framework can achieve all the features.
  3. Sql decouples the program code. By providing the DAL, the data access logic and business logic separated from the system design more clearly, easier to maintain, easier unit testing.
  4. Providing a mapping label, field support ORM object relationship mapping database
  5. Tags provide object-relational mapping, support for object-relational form maintenance
  6. Providing xml tags, support the development of dynamic sql

 

Guess you like

Origin www.cnblogs.com/danxun/p/11598040.html