Hibernate 4 one to one mapping example using xml
In this post we are going to create a project to implement the step by step one-to-one association example using hbm.xml file. Before that lets have a look at what exactly one-to-one association in RDBMS ? One-to-One association means, Each row of a table is mapped with exactly one and only one row with another table. For example, we have passport_detail and person table each row of passport_detail table is mapped with exactly one and only one row of person table. One person has only one passport. In hibernate one-to-one association can be implemented vi two different ways: Primary key associations Unique foreign key associations In this tutorial we are going to implement 1st approach Unidirectional one-to-one association vi primary key association. For 2nd approach you may follow this tutorial one-to-one association using unique foreign key OK, lets start our project. Here is an one-to-one association mapping of person and passport_detail table ER diagram: Tools and...