Hibernate Tip: How to model associations with non primary key columns

preview_player
Показать описание

When you’re working with legacy database, you probably had the situation that you had to map a many-to-one association that used a non-primary key column on the to-one side.
You can easily map that with a @JoinColumn annotation. It allows you to reference any column that contains unique values, e.g., a natural id.

If you like this video, please give me your thumbs up and share it with your friends and co-workers.

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?
#Hibernate #JPA #HibernateTips
Рекомендации по теме
Комментарии
Автор

Is there any mthod for Connect columns without primary key and without foreing key?

MrSametyuksel
Автор

Is it ok if 'isbn' isn't unique in 'book' table? Thanks

quangnvn