I am using eclipselink 2.6 with spring-boot JPA for persistance in postgres.
I am persisting a List of objects as a JSON column in database.Acording to this solution: eclipselink + @convert(json) + postgres + list property I am able to save the data in postgres.
When the column is null, I get this exception:
Caused by: org.postgresql.util.PSQLException: ERROR: column "sample_column" is of type json but expression is of type character varying
Hint: You will need to rewrite or cast the expression.
I can solve this issue by this answer:
Writing to JSON column of Postgres database using Spring / JPA
Q1: Is there an alternate solution other than setting this propertystringtype=unspecified
int url spring.datasource.url=jdbc:postgresql://localhost:5432/dbname?stringtype=unspecified
Q2: If not, How can I set stringtype=unspecified
in application.prooerties of spring-boot rather than embedding it in the spring.datasource.url