Generator-jhipster: Replace JpaRepository with @RepositoryDefinition

Created on 21 Nov 2020  路  1Comment  路  Source: jhipster/generator-jhipster

Overview of the issue

We are currently using EntityRepository extends JpaRepository<Entity, Id>.
It works great but JpaRepository provides much more apis than we use. Eg:

  • Batch api
  • Query by example

We should replace it with @RepositoryDefinition(domainClass = Entity.class, idClass = Id.class) annotation and implement only the required methods.

Motivation for or Use Case

Our repository should provide only the operations we use.

Suggest a Fix

JHipster Version(s)

master

JHipster configuration

Entity configuration(s) entityName.json files generated in the .jhipster directory

Browsers and Operating System

  • [ ] Checking this box is mandatory (this is just to show you read everything)

cleanup needs-discussion java

Most helpful comment

It works great but JpaRepository provides much more apis than we use

I think it was the initial goal. Maybe our generated code don't use all apis, but our users will.

>All comments

It works great but JpaRepository provides much more apis than we use

I think it was the initial goal. Maybe our generated code don't use all apis, but our users will.

Was this page helpful?
0 / 5 - 0 ratings