Java Records: How to use them with Hibernate and JPA

preview_player
Показать описание
A lot of developers complain that Java is too verbose. And I can understand that, especially for all classes that are supposed to be a basic data structure, like entities or DTOs. So, it was no surprise that I got a lot of questions about JDK’s records feature and how you can use it with Hibernate.
In this video, I will show you, how you can use Java records with Hibernate and JPA even though you can’t use them as entities.

Let me immediately answer the 2 most common questions before we get into the details:
Yes, Java records are a great fit for your persistence layer.

But no, you can’t implement an entity using a record.
That’s because of a few important differences between the implementation of a Java record and the requirements of an entity, which I will explain in this video

Like my channel? Subscribe!

Join the free Member Library:

Want to connect with me?

#Java #Records #Hibernate
Рекомендации по теме
Комментарии
Автор

Thank you so much Thorben for another useful and informative video! Keep it up

dominikseljan
Автор

Now the question is, how would you query from two different tables? is it even possible?

madsh