Skip to content

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

Open
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions