-
Notifications
You must be signed in to change notification settings - Fork 378
Closed as not planned
Labels
status: duplicateA duplicate of another issueA duplicate of another issue
Description
Hi, maintainers!
I started my upgrade to spring data jdbc 3.2.0 and found an issue with my setup. I've got a postgresql database and some tables with jsonb type which are converted to simple strings in my entities. To achieve this, I created a pair of Converters. The code is pretty straitforward:
@ReadingConverter
class StringJsonbReadingConverter implements Converter<PGobject, String> {
@Override
public String convert(@NonNull PGobject source) {
if (source.getValue() == null) {
return null;
}
return source.getValue();
}
}
@WritingConverter
class StringJsonbWritingConverter implements Converter<String, PGobject> {
@Override
public PGobject convert(@NonNull String source) {
var pGobject = new PGobject();
pGobject.setType("jsonb");
try {
pGobject.setValue(source);
} catch (SQLException e) {
throw new IllegalStateException(e);
}
return pGobject;
}
}With them, I could use Strings in my entities both as varchar or jsonb up until 3.1.6 but it broke with 3.2.0. To better illustrate it I created a reproducer here.
I'm not sure whether it's a regression, or I just misused an existing API. Could you help me out here?
Metadata
Metadata
Assignees
Labels
status: duplicateA duplicate of another issueA duplicate of another issue