IntelliJ IDEA 2025.2 Help

Jakarta Data

Jakarta Data is a specification in the Jakarta EE ecosystem that focuses on database operations. It provides an API that you can use to create repositories: interfaces with methods to insert, update, delete, and query entities in the database.

A key feature of Jakarta Data is that you do not need to manually implement your repository methods. As long as you use the annotations and keywords from the Jakarta Data API, a compatible implementation library will supply their underlying logic and turn your method declarations into working database calls.

IntelliJ IDEA provides the following support for Jakarta Data:

  • Coding assistance for repositories: completion and validation of method names based on the entity class, validation of method parameters based on the method name

  • Navigation between repositories in the Beans tool window

  • Assistance for Jakarta Data Query Language (JDQL): syntax highlighting, autocompletion of statements based on the entity class, and validation of statements

Enable the Jakarta EE: Data plugin

This functionality relies on the Jakarta EE: Data plugin, which is bundled and enabled in IntelliJ IDEA by default. If the relevant features are not available, make sure that you did not disable the plugin.

  1. Press Ctrl+Alt+S to open settings and then select Plugins.

  2. Open the Installed tab, find the Jakarta EE: Data plugin, and select the checkbox next to the plugin name.

Add Jakarta Data to your project

To enable Jakarta Data support in IntelliJ IDEA, you need to add its API to your project dependencies. It provides the annotations, interfaces, and keywords you need to declare repositories and repository methods. However, for these repositories to be functional, you also need the following dependencies:

  • An API that provides annotations for entities, for example Jakarta Persistence (JPA) or Jakarta NoSQL. You need this to define the entity classes that your repository methods will operate on.

  • An implementation library. It implements your repository methods, manages the lifecycle of your entities, and handles the communication with your database. This is what turns your abstract repository methods into actual database operations.

In this guide, we use the following dependency combinations based on whether the database is relational or non-relational:

Database type

APIs

Implementation

Relational

Jakarta Data + Jakarta Persistence (JPA)

Hibernate

Non-relational

Jakarta Data + Jakarta NoSQL

Eclipse JNoSQL

Create a new Jakarta EE project with Jakarta Data

  1. Open the New Project wizard:

    • If you are on the Welcome screen, click New Project.

    • If you are in the IDE, go to File | New | Project.

  2. From the Generators list, select Jakarta EE.

    Creating a new Jakarta EE project
  3. Set up the Jakarta EE project settings.

  4. Go to the next step of the wizard. In the upper-left corner, select the Jakarta EE version you want to use.

  5. From the Dependencies list, select Data. Then, depending on the database type, select the following items:

    • Relational: Persistence (JPA) and Hibernate.

    • Non-relational: NoSQL. You will need to add Eclipse JNoSQL manually after you create the project.

    New Jakarta EE project with JPA and Hibernate
  6. Click Create.

For more information about creating Jakarta EE projects, such as how to set up an application server, refer to Tutorial: Your first Jakarta EE application.

Add Jakarta Data to an existing project

  1. Open the build file in the editor (pom.xml or build.gradle depending on the build tool used in your project).

  2. Depending on the database type, add the following dependencies:

    Relational databases
    <!-- Jakarta Data specification --> <dependency> <groupId>jakarta.data</groupId> <artifactId>jakarta.data-api</artifactId> <version>1.0.1</version> </dependency> <!-- Jakarta Persistence specification --> <dependency> <groupId>jakarta.persistence</groupId> <artifactId>jakarta.persistence-api</artifactId> <version>3.2.0</version> </dependency> <!-- Implementation (Hibernate) --> <dependency> <groupId>org.hibernate.orm</groupId> <artifactId>hibernate-core</artifactId> <version>7.0.4.Final</version> </dependency>

    Hibernate may require additional dependencies. Refer to the official documentation for guidance.

    Non-relational databases
    <!-- Jakarta Data specification --> <dependency> <groupId>jakarta.data</groupId> <artifactId>jakarta.data-api</artifactId> <version>1.0.1</version> <scope>provided</scope> </dependency> <!-- Jakarta NoSQL specification --> <dependency> <groupId>jakarta.nosql</groupId> <artifactId>jakarta.nosql-api</artifactId> <version>1.0.1</version> <scope>provided</scope> </dependency> <!-- Implementation (Eclipse JNoSQL) --> <dependency> <groupId>org.eclipse.jnosql.mapping</groupId> <artifactId>jnosql-mapping-document</artifactId> <version>1.1.9</version> </dependency>

    Different NoSQL databases require different Eclipse JNoSQL dependencies. Refer to the official documentation for guidance.

    Relational databases
    // Jakarta Data specification compileOnly('jakarta.data:jakarta.data-api:1.0.1') // Jakarta Persistence specification compileOnly('jakarta.persistence:jakarta.persistence-api:3.2.0') // Implementation (Hibernate) implementation('org.hibernate.orm:hibernate-core:7.0.4.Final')

    Hibernate may require additional dependencies. Refer to the official documentation for guidance.

    Non-relational databases
    // Jakarta Data specification compileOnly('jakarta.data:jakarta.data-api:1.0.1') // Jakarta NoSQL specification compileOnly('jakarta.nosql:jakarta.nosql-api:1.0.1') // Implementation (Eclipse JNoSQL) implementation('org.eclipse.jnosql.mapping:jnosql-mapping-document:1.1.9')

    Different NoSQL databases require different Eclipse JNoSQL dependencies. Refer to the official documentation for guidance.

  3. Press Ctrl+Shift+O to import the changes.

For more information about working with build tools, refer to Maven or Gradle.

Create a Jakarta Data repository

Jakarta Data repositories are interfaces annotated with @Repository that declare database operations on entities, such as finding, inserting, updating, or deleting them. Typically, one repository manages a single entity class.

  1. Open the Project tool window (Alt+1) and go to the package where you want to create the repository.

  2. Right-click the package and select New | Java Class.

  3. In the New Java Class popup, select Interface, name the repository, and press Enter.

  4. Annotate the interface declaration with @Repository. If prompted, import the class.

    Created interface with a Repository annotation and import

    Now IntelliJ IDEA recognizes the interface as a Jakarta Data repository and can provide coding assistance.

  5. (Optional) Extend one of Jakarta Data's built-in repositories:

    • DataRepository: Lets you specify the entity class and its ID type but does not provide any predefined methods.

    • BasicRepository: Extends DataRepository with basic methods for finding, saving, and deleting entities.

    • CrudRepository: Extends BasicRepository with additional methods for updating and inserting entities.

After you create a repository, you can start declaring methods. Note that for Jakarta Data to recognize what type of database operation a method represents, you need to use one of its supported declaration patterns: an annotation (for example, @Find) or a specific prefix in the method name (for example, findByName). To learn more about declaring repository methods, refer to the Jakarta Data API documentation.

Working with JDQL queries

Jakarta Data Query Language (JDQL) lets you write explicit queries for repository methods as an alternative to querying by method name or using other annotations. When you type JDQL inside a @Query annotation, IntelliJ IDEA automatically recognizes it, suggests field names based on the entity class, and validates the query statements.

releaseYear field gets suggested while writing a JDQL query

Edit a JDQL query in a dedicated editor

Opening JDQL in a dedicated editor helps you focus on your query without the surrounding code. This can be useful if your query is complex or spans multiple lines.

  1. Place the caret at the JDQL query.

  2. Press Alt+Enter (or click Show Context Actions) and select Edit Jakarta Data QL Fragment.

    IntelliJ IDEA opens the query in a dedicated fragment editor.

    JDQL query in a dedicated fragment editor
01 April 2026