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

Supporting SQL Function around inserting value in Criteria

Open IvanKonevJr opened this issue 5 years ago • 2 comments

We can use annotation to insert value in function:

data class Doc(
    @Id id: Long,
    english: String,
    @Fun("translate('french', english)") french: String
)

in annotation Fun("translate('french', ?)") we can select character "?" and get value from any primitive type of "french" field

then repository.save(doc) generate:

insert into doc(id,english,french) values(123, 'good day', translate('french', english))

this will greatly simplify the logic and source code.

IvanKonevJr avatar Jan 04 '20 15:01 IvanKonevJr

Thanks for your suggestion. Spring Data R2DBC depends on Spring Data Relational that is hosted together with Spring Data JDBC. Can you file a ticket at https://jira.spring.io/ for DATAJDBC? We need to have such functionality in Spring Data Relational first.

mp911de avatar Jan 09 '20 07:01 mp911de

Ok, is being discussed on https://jira.spring.io/browse/DATAJDBC-468

IvanKonevJr avatar Jan 09 '20 08:01 IvanKonevJr