Artwork

Content provided by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.
Player FM - Podcast App
Go offline with the Player FM app!

Mapping Relationships with Hibernate

55:48
 
Share
 

Manage episode 163963610 series 1289539
Content provided by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

In the past we have learned about database relationships, specifically the One-to-Many as well as the Many-to-Many and One-to-One and that was all good, great and grand…

But now I want to talk about how to create those same relationships inside of Hibernate.

Specifically, I want to focus on the One-to-Many relationship in Hibernate and how we go about mapping it out in our Java objects.

But before we do, a word on unidirectional and bidirectional relationships.

Unidirectional vs Bidirectional

In Hibernate, it’s possible to map all three relationships that are available in a standard database, these include:

  • One-to-One
  • One-to-Many
  • Many-to-Many

But what Hibernate also includes is the ability to make EACH of those relationships either unidirectional or bidirectional.

This means that we can have a unidirectional One-to-One and a bidirectional One-to-One mapping, as well as a unidirectional One-to-Many and a bidirectional One-to-Many, as well as a unidirectional Many-to-Many and a bidirectional Many-to-Many relationship.

That’s a lot of relationships!

So what exactly are unidirectional and bidirectional relationships?

Learn more on the show notes page via http://howtoprogramwithjava.com/session53

  continue reading

112 episodes

Artwork
iconShare
 
Manage episode 163963610 series 1289539
Content provided by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures. All podcast content including episodes, graphics, and podcast descriptions are uploaded and provided directly by Best Java podcast on iTunes, learn about variables, control structures, collections, data types, des, Best Java podcast on iTunes, Learn about variables, and Control structures or their podcast platform partner. If you believe someone is using your copyrighted work without your permission, you can follow the process outlined here https://player.fm/legal.

In the past we have learned about database relationships, specifically the One-to-Many as well as the Many-to-Many and One-to-One and that was all good, great and grand…

But now I want to talk about how to create those same relationships inside of Hibernate.

Specifically, I want to focus on the One-to-Many relationship in Hibernate and how we go about mapping it out in our Java objects.

But before we do, a word on unidirectional and bidirectional relationships.

Unidirectional vs Bidirectional

In Hibernate, it’s possible to map all three relationships that are available in a standard database, these include:

  • One-to-One
  • One-to-Many
  • Many-to-Many

But what Hibernate also includes is the ability to make EACH of those relationships either unidirectional or bidirectional.

This means that we can have a unidirectional One-to-One and a bidirectional One-to-One mapping, as well as a unidirectional One-to-Many and a bidirectional One-to-Many, as well as a unidirectional Many-to-Many and a bidirectional Many-to-Many relationship.

That’s a lot of relationships!

So what exactly are unidirectional and bidirectional relationships?

Learn more on the show notes page via http://howtoprogramwithjava.com/session53

  continue reading

112 episodes

All episodes

×
 
Loading …

Welcome to Player FM!

Player FM is scanning the web for high-quality podcasts for you to enjoy right now. It's the best podcast app and works on Android, iPhone, and the web. Signup to sync subscriptions across devices.

 

Quick Reference Guide