Wed, 27 August 2014
What the heck is a Fetch Type?
Great question! Hibernate is a very handy framework for removing your need to fully understand SQL, but it will force you to understand things such as joins.
Joining two tables in SQL is the foundation of a relational database, as joins allow you to actually define relationships between tables (objects).
Having said that, relationships are important to understand when talking about fetch types in Hibernate. This is the case because whenever you define a relationship in Hibernate, you’ll also need to define the fetch type. The fetch type essentially decides whether or not to load all of the relationships of a particular object/table as soon as the object/table is initially fetched.
For more information please see the show notes via http://howtoprogramwithjava.com/session57
Thu, 21 August 2014
Hibernate @ManyToMany Unidirectional
The Many-to-Many relationship can be best described by example.
The example we’re going to use is that of the relationship between an
Other examples of the many to many relationship are Students to Courses and Employees to Projects.
Let’s take a look at how the unidirectional many-to-many relationship is created using Hibernate... for more info please visit http://howtoprogramwithjava.com/session56
Thu, 7 August 2014
One-to-One Unidirectional Relationship
We will start things off with the unidirectional One-to-One relationship and how it’s set up in Hibernate.
First thing is first, you need to understand how a One-to-One relationship is actually set up in a database. Once you understand that the child table declares the parent’s primary key as the child’s primary key, then we can get moving with the Hibernate stuff!
For this example, we are going to use the One-to-One relationship between an
For more information, please read the show notes via http://howtoprogramwithjava.com/session55