September 7, 2022

What's new in JPA Buddy 2022.4

The new major release of JPA Buddy is out! The 2022.4 version brings new features and a bunch of improvements and bug fixes. Among them:

  • Support for @JdbcTypeCode from Hibernate 6
  • Editor Toolbar – a new visual control that helps to explore and use JPA Buddy features
  • Refactoring of entity fields associated with DTO properties

Keep reading to learn more about these features and even more!

@JdbcTypeCode Support

Before Hibernate 6, it was common to use the Hibernate Types library to map non-standard SQL types to Java types, or you could define your own @Type or @Converter. After the last major upgrade, you can ditch a dozen Hibernate types and JPA converters and use @JdbcTypeCode instead.

JPA Buddy supports @JdbcTypeCode in both new attribute generation and reverse engineering wizards. Take a look at the video below to see how you can benefit from this feature:

Editor Toolbar & Visual Designer Settings

In its default mode, JPA Buddy provides three tool windows: JPA Structure, Palette, and Inspector. However, tool windows may steal too much horizontal space, especially for those who prefer 13-inch laptops :). In this case, it was recommended to use the minimalistic mode. Since we released the minimalistic mode, we have received a lot of feedback that our users are struggling to find generation controls.

In response to multiple requests, we are happy to introduce the new visual control: Editor Toolbar. It is a compact toolbar on top of the editor window that provides fast access to the relevant actions. It doesn't eat the horizontal space but takes a few pixels for a tiny line with small buttons.

The editor toolbar is available for:

  • JPA entities
  • Spring Data JPA Repositories
  • SQL files
  • Liquibase Changelogs in the XML format

And even more, since JPA Buddy 2022.4 you can fine-tune the appearance of the main visual elements of JPA Buddy:

Entity & DTO refactoring

Often, DTOs repeat a part of their entities. Keeping properties identical allows developers to map one to another with nearly no code, especially if you use MapStract or ModelMapper. However, changing the property name in an entity may ruin the mapping logic. JPA Buddy addresses this problem by letting you refactor the entity field along with the related fields in its DTOs at once.

DTO/Projection generation in Spring Data JPA query/method wizard

Another slight improvement related to DTOs is that you can generate a new DTO or Projection right from the Spring Data JPA query/method wizard:

Using Spring Data JPA, Hibernate or EclipseLink and code in IntelliJ IDEA? Make sure you are ultimately productive with the JPA Buddy plugin!

It will always give you a valuable hint and even generate the desired piece of code for you: JPA entities and Spring Data repositories, Liquibase changelogs and Flyway migrations, DTOs and MapStruct mappers and even more!

Conclusion

This article covers just a few improvements. However, there are many more: improved id field wizard, DTO can be generated with fluent setters, improved dialog for Spring Data repository delete method scaffolding, and over 50 others that you can find in our issue tracker.

As always, we are happy to see your feedback and ideas on our Discord channel. Follow us on Twitter to get the latest news about JPA Buddy along with helpful JPA tips!