Hibernate and JPA: Working with Fluent Entities

preview_player
Показать описание
In this video, I will show you how to apply one of the most popular API design patterns to your entities. We will create fluent entities. They make your code extremely easy to read but implementing fluent entities with JPA and Hibernate is not as easy as you might expect.

But before we begin, if this is your first time here, and you want to learn how to create your entity mappings with ease, build incredible efficient persistence layers with Hibernate and all types of other Java persistence related stuff, start now by subscribing and clicking the bell, so you don't miss anything.

Fluent interfaces are a popular API design pattern in the Java world. The goal of the pattern is to create APIs that are very easy to read, and that define something similar to a domain-specific language. To achieve that, the API heavily relies on method chaining so that the code that uses the API flows and almost reads like prose.

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?

#fluent #entites #hibernate #jpa
Рекомендации по теме
Комментарии
Автор

what if the entity has a supper class with @MappedSuperclass that hold some common fields? Fluent setters on superclass can't be chained to fluent setters of subclass without down casting

lnthai
Автор

Wouldn't it be less confusing and cleaner to create separate builder classes?

ropro