This blog post is the last of the Hibernate series, and since it is the last one, we should take a look at the whole, from beginning to end, summing up the contents of this series.
Concept
Hibernate is an object-relational mapping framework and, of course, from a hierarchical standpoint, we also say that it is the framework of the data persistence layer.
We can see from the last sentence the core of Hibernate: Object-oriented, relational mapping, and data persistence. The first two concepts are easy to understand, and for "data persistence", it is the permanent preservation of data or an object. There are many examples of real life, such as: chilled meat, canned fruit, and for programming, storing data in a file or disk, and in a database. Now let's look at the core objects of Hibernate:
Core objects
The above picture gives us a lot of information and can read this picture to reflect your understanding of hibernate from the side. Let's say a few:
1. Hibernate has two main configuration files: (Hibernate.cfg.xml and Xxx.hbm.xml)
2. Hibernate has five or six interfaces: Configuration, Sessionfactory, Session, Transaction, query, and criteria.
3, hibernate the principle of execution, look at the arrow can be.
4. The session object is built through Sessionfactory, which is one of the two ways hibernate creates a session.
。。。。。。
As there are too many things, we will not list them all for the time being. The following is a detailed description of the mapping classification.
Classification
At the beginning of the Hibernate series, I divided the relationship mapping into the above four, and now we look at the relationship mapping actually two, even one.
1, from the loading direction of the object is divided into one-way and two-way.
Unidirectional and bidirectional only affect the loading of data, and it does not affect the storage of data. Either one-to-many or many-to-many, one-way and two-way database tables are the same, and unidirectional and bidirectional differences are determined by the object model.
2, from the object mapping relationship is divided into one-to-many and many to one or two, they are from different angles, so it can be said to be a.
Single- to-one correlation mapping is a special case of a multi-pair association map, which is used to represent a to-do relationship after adding a unique limit to the "many" end.
Many-to-many association mappings are a special case of a one-to-many association mapping, which uses collections to represent many relationships and defines the primary key of the current table with the <key> tag.
Of course, they have both links and differences, the difference is no longer listed, Series blog post has detailed the respective links and differences.
Series List
"Hibernate advanced" Hibernate fundamentals (i)
Hibernate Advanced Hibernate Setup development environment + Simple example (ii)
Hibernate advanced Hibernate basic Mapping (iii)
"Hibernate advanced " hibernate mapping--a multiple-to-one one-way correlation mapping (iv)
"Hibernate advanced " hibernate mapping--one-way correlation mapping (v)
"Hibernate advanced " hibernate mapping--one-to-one bidirectional correlation mapping (vi)
Hibernate advanced Hibernate mapping-one-to-many association mappings (vii)
Hibernate advanced Hibernate mapping-many-to-many association mappings (eight)
"Hibernate advanced " Hibernate series--Summary (ix)
Ext.: http://blog.csdn.net/jiuqiyuliang/article/details/41318751
(Hibernate Advanced) Hibernate series--Summary (ix)