spring-data-relational icon indicating copy to clipboard operation
spring-data-relational copied to clipboard

Deduplicate code in QueryMapper

Open schauder opened this issue 2 years ago • 1 comments

Both the JDBC and the R2DBC module have a QueryMapper and a lot of code is duplicated between them. \

We should remove that code duplication, possibly by introducing a common super class.

schauder avatar Apr 28 '23 15:04 schauder

@schauder

In the case of QueryMapper, I would like to comment on commonization.

QueryMapper is It has two properties: jdbc and r2dbc.

Write the common logic by abstracting it into the “spring-data-relational” module.

There are implementations of each jdbc and r2dbc.

In reality, I refer to the implementation for each property, but I think it would be better to improve maintainability by looking at the common implementation class.

What do you think?

  • AbstractQueryMapper.class (module: spring-data-relational)
  • JdbcQueryMapper.class (module: spring-data-jdbc)
  • R2dbcQueryMapper.class (module: spring-data-r2dbc)

xeounxzxu avatar Jan 13 '24 10:01 xeounxzxu