@@ -79,7 +79,8 @@ public class OptionalHandlerFactory implements java.io.Serializable
7979
8080 public final static OptionalHandlerFactory instance = new OptionalHandlerFactory ();
8181
82- // classes from java.sql module, this module may not be present at runtime
82+ // classes from java.sql module, this module may or may not be present at runtime
83+ // (is included on Java 8, but not part of JDK core for Java 9 and beyond)
8384 private final Map <String , String > _sqlDeserializers ;
8485 private final Map <String , Object > _sqlSerializers ;
8586
@@ -88,16 +89,15 @@ public class OptionalHandlerFactory implements java.io.Serializable
8889 private final static String CLS_NAME_JAVA_SQL_TIME = "java.sql.Time" ;
8990 private final static String CLS_NAME_JAVA_SQL_BLOB = "java.sql.Blob" ;
9091 private final static String CLS_NAME_JAVA_SQL_SERIALBLOB = "javax.sql.rowset.serial.SerialBlob" ;
91-
9292
9393 protected OptionalHandlerFactory () {
9494 _sqlDeserializers = new HashMap <>();
9595 _sqlDeserializers .put (CLS_NAME_JAVA_SQL_DATE ,
9696 "com.fasterxml.jackson.databind.deser.std.DateDeserializers$SqlDateDeserializer" );
9797 _sqlDeserializers .put (CLS_NAME_JAVA_SQL_TIMESTAMP ,
9898 "com.fasterxml.jackson.databind.deser.std.DateDeserializers$TimestampDeserializer" );
99- _sqlDeserializers . put ( CLS_NAME_JAVA_SQL_BLOB ,
100- "com.fasterxml.jackson.databind.ext.SqlBlobDeserializer" );
99+ // 09-Nov-2020, tatu: No deserializer for `java.sql.Blob` yet; would require additional
100+ // dependency and not yet requested by anyone. Add if requested
101101
102102 _sqlSerializers = new HashMap <>();
103103 // 09-Jan-2015, tatu: As per [databind#1073], let's try to guard against possibility
@@ -107,6 +107,11 @@ protected OptionalHandlerFactory() {
107107 _sqlSerializers .put (CLS_NAME_JAVA_SQL_TIMESTAMP , DateSerializer .instance );
108108 _sqlSerializers .put (CLS_NAME_JAVA_SQL_DATE , "com.fasterxml.jackson.databind.ser.std.SqlDateSerializer" );
109109 _sqlSerializers .put (CLS_NAME_JAVA_SQL_TIME , "com.fasterxml.jackson.databind.ser.std.SqlTimeSerializer" );
110+
111+ // 09-Nov-2020, tatu: Not really optimal way to deal with these, problem being that
112+ // Blob is interface and actual instance we get is usually different. So may
113+ // need to improve if we reported bugs. But for now, do this
114+
110115 _sqlSerializers .put (CLS_NAME_JAVA_SQL_BLOB , "com.fasterxml.jackson.databind.ext.SqlBlobSerializer" );
111116 _sqlSerializers .put (CLS_NAME_JAVA_SQL_SERIALBLOB , "com.fasterxml.jackson.databind.ext.SqlBlobSerializer" );
112117 }
0 commit comments