micronaut-projects / micronaut-projects/micronaut-data

JDBC repositories should not require an entity

Open
#3,398 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
Java
Stars
482
Forks
229
Avg merge
1d 7h
Merged PRs (30d)
32

Description

Expected Behavior
@JdbcRepository(dialect = Dialect.ORACLE)
public interface OracleUtilityQueries {
    @Query("SELECT userenv('sessionid') FROM dual")
    long getAUDSID();
}

This should work.

Actual Behaviour

error: Unable to implement Repository method: OracleUtilityQueries.getAUDSID(). Could not resolved root entity. Either implement the Repository interface or define the entity as part of the signature

Steps To Reproduce

No response

Environment Information

No response

Example Application

No response

Version

4.8

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how @JdbcRepository handles a repository method without an entity, using the OracleUtilityQueries example and its getAUDSID() query as the entry point. Confirm that the example compiles without the root-entity error and that entity-based repository methods continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.