spring-projects / spring-projects/spring-data-relational

Add support for named queries backed by MyBatis [DATAJDBC-362]

Open
#586 1 comment 0 reactions 1 assignee View on GitHub

@schauder is already working on this.

Since Dec 31, 2020.

in: core type: enhancement
Dominant language
Java
Stars
827
Forks
394
PR merge metrics
No merged PRs in 30d

Description

tonyfalabella opened DATAJDBC-362 and commented

As noted on jdbc.mybatis, Spring Data JDBC provides functionality for the `CrudRepository ` methods to call out to MyBatis. 

 

For each operation in CrudRepository, Spring Data JDBC runs multiple statements. If there is a SqlSessionFactory in the application context, Spring Data checks, for each step, whether the SessionFactory offers a statement. If one is found, that statement (including its configured mapping to an entity) is used.

 

For those interested in the repository being able to call out to MyBatis for additional named queries it does not yet provide such support.  Having such functionality would allow MyBatis users to take advantage of the generic Repository interface and all the additional features Spring Data provides (i.e. spring-data-rest-webmvc).

The functionality provided should allow the caller to not only pass objects of `MyBatisContext ` but also allow passing in whatever arguments the method requires.  It appears that Spring Data MyBatis provides additional capabilities but it's not developed by Spring/Pivotal and as-such it's difficult to use this library within certain organizations. 

Additional info is on StackOverflow: spring-data-jdbc-with-mybatis-not-finding-custom-query


Affects: 1.1 M3 (Moore)

1 votes, 1 watchers

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.