filmov
tv
Inheritance vs Composition in JPA | JPA Buddy
![preview_player](https://i.ytimg.com/vi/-p47zVqcOp8/maxresdefault.jpg)
Показать описание
#jpa #hibernate #eclipselink #intellijidea #java #kotlin #jpabuddy #inheritance #composition
MappedSuperclass is often used for sharing common fields between different entities. However, with time it gets split into smaller classes introducing a deep and brittle hierarchy.
If this happens to you, keep in mind that there is another option available in JPA.
You may use composition by externalizing shared fields into a separate @Embeddable entity. This way, you still comply with the DRY principle but have a lot more flexibility.
JPA Buddy is an IntelliJ IDEA plugin that helps developers work efficiently with Hibernate, EclipseLink, Spring Data JPA, Flyway, Liquibase, Lombok, MapStruct, and other related technologies in both Java and Kotlin.
The plugin is intended to:
– Lower barrier to entry into development with JPA
– Boost developer’s productivity
– Make sure your code follows best practices
JPA Buddy delivers:
– Intuitive wizards to work with JPA
– Automatic database versioning changelog generation
– Smart inspections to make the code better
– JPA Entities generation based on tables (reverse engineering)
– Visual DTO designer and mapper code generator
You can use JPA Buddy in any project with Spring Boot, Jakarta Enterprise Edition, Quarkus, Micronaut, or even without any framework.
Join us:
MappedSuperclass is often used for sharing common fields between different entities. However, with time it gets split into smaller classes introducing a deep and brittle hierarchy.
If this happens to you, keep in mind that there is another option available in JPA.
You may use composition by externalizing shared fields into a separate @Embeddable entity. This way, you still comply with the DRY principle but have a lot more flexibility.
JPA Buddy is an IntelliJ IDEA plugin that helps developers work efficiently with Hibernate, EclipseLink, Spring Data JPA, Flyway, Liquibase, Lombok, MapStruct, and other related technologies in both Java and Kotlin.
The plugin is intended to:
– Lower barrier to entry into development with JPA
– Boost developer’s productivity
– Make sure your code follows best practices
JPA Buddy delivers:
– Intuitive wizards to work with JPA
– Automatic database versioning changelog generation
– Smart inspections to make the code better
– JPA Entities generation based on tables (reverse engineering)
– Visual DTO designer and mapper code generator
You can use JPA Buddy in any project with Spring Boot, Jakarta Enterprise Edition, Quarkus, Micronaut, or even without any framework.
Join us:
Комментарии