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

Introduce replacement for ReactiveDataAccessStrategy

Open mp911de opened this issue 4 years ago • 2 comments

mp911de avatar Jan 29 '21 14:01 mp911de

  • getAllColumns and getIdentifierColumns -> RelationalPersistentEntity
  • getOutboundRow -> UpdateMapper
  • getRowMapper -> direct usage via EntityRowMapper and R2dbcConverter

mp911de avatar Feb 01 '21 13:02 mp911de

I was able to use getAllColumns to create join assignments for a respective table alias:

inline fun <reified T : Any> ReactiveDataAccessStrategy.joinAssignments(tableAlias: String): String =
    getAllColumns(T::class.java).joinToString(", ") { column ->
        "$tableAlias.${column.reference.toLowerCase()} as ${tableAlias}_${column.reference.toLowerCase()}"
    }

Maybe it is a good idea to have this functionality integrated along the respective alias mapping requested in https://github.com/spring-projects/spring-data-r2dbc/issues/448?

pmaedel avatar Feb 06 '21 09:02 pmaedel