What’s New in JPA Buddy – July 2021
Let’s look at JPA Buddy's latest features including, tools for SQL files, Flyway callbacks, migrations in Java/Kotlin, clearer view of Liquibase changelog structure!
Join the DZone community and get the full member experience.Join For Free
JPA Buddy keeps evolving, with new features being rolled out each release. Let’s look at the main features added in the latest couple of releases.
Visual tools for SQL files
In some cases, it’s useful to have SQL scripts for the data model, especially when you need to quickly set up a fresh database. That’s why we added visual tools to generate #DDL for tables, create and modify indexes, constraints, and many other things:
Another way to see DDL for an entity is to use the new “Show DDL” action:
Flyway Callbacks and Java/Kotlin Migrations
Flyway supports callbacks in Java and SQL, which are useful for many housekeeping tasks like rebuilding materialized views or calling an external system. JPA Buddy lets you create callbacks in both SQL and Java/Kotlin:
Flyway also allows you to create migrations in Java or Kotlin, which are much more flexible than regular SQL. Now you can scaffold them using JPA Buddy:
Liquibase Changelog Structure
Liquibase changelog display in the JPA Structure panel has been reworked: now it’s based on the hierarchy of changelogs (i.e. which changelog is included into which), not the folder structure. This allows for a clear view of the changes:
Diff Generator Improvements
Liquibase and Flyway diff generator are one of the most useful JPA Buddy features, so a lot of work is put into it. Here are the recent improvements:
Support for the following annotations:
@ElementCollection and @CollectionTable
Unidirectional @OneToMany without @JoinColumn
Ability to provide a default value when creating an “addNotNullConstraint” change.
“Max DB identifier length” setting to make sure the generated names in migrations scripts will be compatible with the target DB.
Search scope for diff generation that lets you narrow down which entity classes to analyze:
Project and Libraries
Project and Tests
Also, a new “Diff changes” action has been added to the “Other” category in JPA Palette and the IDEA “Generate” menu (Alt + Insert or Cmd + N):
These are just some of the features that were added in the latest releases. Others include better Kotlin integration, displaying physical table/column names in the JPA Inspector panel, drag and drop support for JPA Palette, and many more improvements and fixes.
Many of the features were suggested by our community. If you have any suggestions or feedback, don’t hesitate to contact us.
Published at DZone with permission of Andrey Oganesyan. See the original article here.
Opinions expressed by DZone contributors are their own.