Installation Guide

What is JPA Buddy?

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:

You can use JPA Buddy in any project with Spring Boot, Jakarta Enterprise Edition, Quarkus, Micronaut, or even without any framework.

Installation and Project Setup

JPA Buddy is compatible with both IntelliJ IDEA Community Edition and IntelliJ IDEA Ultimate Edition. It is available on the JetBrains marketplace, where it can be downloaded and installed.

To install JPA Buddy, open Preferences -> Plugins and search for JPA Buddy. Then, simply click on the installation button and you're good to go!

Dependencies

Since JPA Buddy supports Hibernate, EclipseLink, SpringData, MapStruct, Liquibase and Flyway, it scans the project dependencies and enables the corresponding features. If you have a multi-module project, JPA Buddy features will be enabled depending on the presence of the dependency within the module, rather than the entire project.

Framework/Lib Features
Hibernate - Create and edit entities, entity attributes, lifecycle callbacks, indexes and constraints in both Java and Kotlin.
- Assign JPA converters and Hibernate custom types.
- Apply Lombok annotations to entities.
- Generate proper equals, hashCode and toString.
EclipseLink
Spring Data JPA - Create repositories for entities.
- Generate queries using visual constructors.
- Extract JPQL from derived method queries.
- Pick which fields to return from queries and generate projections.
Hibernate Validator Add Hibernate Validator annotations to Entity and DTO attributes via JPA Designer and DTO generator wizard respectively.
Spring Boot Starter Validation
Hibernate Types Assign Hibernate Custom Types to attributes via a code inspection with a quick fix (Alt+Enter/⌥ ⏎).
Liquibase - Automatically generate Liquibase changelogs by comparing JPA model to target database, model to snapshot or DB to DB.
- Use visual designers for Liquibase changelogs
- Use coding assistance and autocomplete in Liquibase changelogs for table names, column names etc. JPA Buddy takes these values directly from your data model.
Flyway - Generate Flyway migrations by comparing JPA model to target database, model to snapshot or DB to DB.
- Scaffold INSERT, UPDATE and DELETE statements for your entities in SQL files.
MapStruct - Create MapStruct mappers to convert entities to DTOs and back.
Blazebit Persistence Entity View API - Create Blaze Persistence Entity View for JPA Entity.
Blazebit Persistence Integration Spring Data Base - Create Spring Data JPA repository for Blaze Persistence Entity View.
Hibernate Envers - Generate database migration scripts for audit tables.
- Create Spring Data JPA revision repositories.
- Annotate entities and their fields for auditing via JPA Designer.
- Generate @RevisionEntity via convenient wizard.

After adding one of the dependencies to the project, do not forget to click on the "Load Maven/Gradle Changes" button in the upper right corner.

Verifying Installation

To make sure that the plugin is installed correctly, follow these steps:

  1. Open Plugin Settings IntelliJ IDEA window: clicks File -> Settings -> Plugins -> Installed. Make sure that JPA Buddy there is in this section and enabled.

  2. Open existing or create a new entity and click somewhere in it. You should find Editor Toolbar (1) and JPA Buddy tool window (2). Note that visual tools will appear only after JPA Buddy detects one of the dependencies described in the section above.

Installing a Specific Version of JPA Buddy

Every version of JPA Buddy supports a range of IntelliJ IDEA versions. For example, JPA Buddy 2023.1 works correctly with IntelliJ IDEA 2022.2, 2022.3 and 2023.1. But if you have to install JPA Buddy on the other version of IntelliJ IDEA, you can do the following:

  • In the opened window, click on the "Download" button.

  • Save .zip file to your PC.

  • Now you have two options:

    • Open File -> Settings -> Plugins page click on the settings icon next to the "installed" tab and choose "install plugin from disk". Find the downloaded .zip file, select it, and click "ok".

    • Simply drag and drop the .zip file to any IntelliJ IDEA window.
  • To apply changes, click on the "Restart IDE" button

Something went wrong? Contact us!

Bugs and errors are unavoidable in any software, development tools are no exception. JPA Buddy team is always ready to help you cope with any difficulties that arise. Check out Reporting Issues section where you can find Contact Us information and tips for Error Reporting.