You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot use a repository annotated with @Repository in a JDBC project, please use @JdbcRepository(dialect = ...) instead.
Actual Behaviour
The Micronaut Data docs are a bit confusing w.r.t. how to annotate repository interfaces. The docs start by saying (under "shared concepts") that you have to annotate them with @Repository which makes sense, but in fact if you use JDBC directly (no JPA/Hibernate) the repository must be annotated with @JdbcRepository. This is explained later but it's easy to miss and if you do, you get an exception with a message like this:
No backing RepositoryOperations configured for repository. Check your configuration and try again
This is pretty confusing. The problem isn't in the app config file, it's not clear what a "backing RepositoryOperations" is or why none is configured, and the generic "check your configuration and try again" advice is so vague it's nearly non-actionable.
Steps To Reproduce
Set up a JDBC only Micronaut Data project.
Write a repository that inherits from e.g. GenericRepository and is annotated using @Repository
Run the app.
Be puzzled by the resulting message.
Environment Information
No response
Example Application
No response
Version
4.4.4
The text was updated successfully, but these errors were encountered:
Expected Behavior
The error should say something like:
Cannot use a repository annotated with @Repository in a JDBC project, please use @JdbcRepository(dialect = ...) instead.
Actual Behaviour
The Micronaut Data docs are a bit confusing w.r.t. how to annotate repository interfaces. The docs start by saying (under "shared concepts") that you have to annotate them with
@Repository
which makes sense, but in fact if you use JDBC directly (no JPA/Hibernate) the repository must be annotated with@JdbcRepository
. This is explained later but it's easy to miss and if you do, you get an exception with a message like this:No backing RepositoryOperations configured for repository. Check your configuration and try again
This is pretty confusing. The problem isn't in the app config file, it's not clear what a "backing RepositoryOperations" is or why none is configured, and the generic "check your configuration and try again" advice is so vague it's nearly non-actionable.
Steps To Reproduce
GenericRepository
and is annotated using@Repository
Environment Information
No response
Example Application
No response
Version
4.4.4
The text was updated successfully, but these errors were encountered: