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

Json support? [DATAJDBC-284]

Open spring-projects-issues opened this issue 7 years ago • 8 comments
trafficstars

srinivas kvs opened DATAJDBC-284 and commented

Add an attribute to @Embed introduced in DATAJDBC-111 so that the annotated property gets stored as JSON instead of multiple embedded columns.

The attribute should not be boolean but an enum since we might want to support other formats in the future, e.g. XML


1 votes, 4 watchers

spring-projects-issues avatar Oct 30 '18 21:10 spring-projects-issues

Jens Schauder commented

I'm currently not sure how such support would look like. Could you be a little more specific what you would like to see?

spring-projects-issues avatar Oct 31 '18 17:10 spring-projects-issues

srinivas kvs commented

Think if we could somehow define a ColumnType to mark it as Json Type, then behind the scene when you are actually generating the insert/ update statement to map the values to columns you could do something like   

cast(:additionalParams as JSON)

 

This is probably very postgres syntax 

spring-projects-issues avatar Oct 31 '18 18:10 spring-projects-issues

Jens Schauder commented

So if we frame the goal Postgres independently you are looking for for a way to make generated SQL dependent on the "type" of the attribute that represents that column in the object model. "Type" being used in a very broad sense here.

This does sound useful, but also very specialized. I'll leave the issue open but to be honest it is well down on the priorities list

spring-projects-issues avatar Nov 01 '18 03:11 spring-projects-issues

When will this feature be released? I can't wait 😃

holmofy avatar Aug 17 '21 12:08 holmofy

Almost all of the today's RDBMS have JSON datatype, it should be possible to make it RDBMS independent (or at least converters could be implemented for different RDBMSes).

mcekovic avatar Sep 29 '21 21:09 mcekovic

Five years have passed

holmofy avatar Aug 18 '23 16:08 holmofy

It should be the easiest to add JSON function to Criteria API.

vnobo avatar Nov 24 '23 07:11 vnobo