In this post I want to make a concise investigation regarding one very popular Hibernate exception. Today I will talk about id generating for some table, and if to be more precise, about cases when we need to assign id manually. Let's start.
Today I want to show you an example of unidirectional one to one association using primary key. It can be a little bit difficult for beginners to setup such association but I will try my best to explain all aspects in a clear way. For this tutorial I choose MySQL as a database, also I will use Hibernate and JPA annotations.
In one of my previous posts I made an overview of Hibernate and its main principles of work. Now I want to talk about one of the most important features of Hibernate - associations. An association represents a relationship between two tables in a database. So let's go further because great things wait for us.
As a continuation of the previous article, I want to demonstrate a simple example of Hibernate usage. I will show you the basic principles of Hibernate functionality. The article will cover annotation based configurations. For the tutorial you need to have installed an IDE (e.g. Eclipse), Maven, m2e plugin, MySQL.