środa, 12 czerwca 2013

Hibernate relations

Using hibernate to create database schema we need to provide connections between our tables. In the database tables, there must exist foreign key relationship. The main advantage of putting relation ship between objects is that we can do operation on one object, and the same operation can transfer onto the other object in the database.

Using hibernate we can put the following types of relationships:

* one-to-one
* one-to-many
* many-to-one
* many-to-many



We can distinguish two types of all above relations



* unidirectional
* bidirectional



You can easily count that all types of hibernate relationships is 7(one-to-many and many-to-one are the same). In next articles I will try to clearly explain all of this relations with easy examples.

If you don’t know how to create simple hibernate project, at the beginning  you should read my previous article: Using Hibernate persistence with Maven. 




Brak komentarzy:

Prześlij komentarz