mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-11-25 02:12:22 -05:00
Fix JdbcMapper blob/clob warning messages and mistaken fallthrough to CLOB case from BLOB
This commit is contained in:
parent
fad614f85a
commit
278e99e894
@ -877,18 +877,24 @@ public class JdbcMapperProcessor extends AbstractProcessor {
|
||||
"\t\t\t}\n");
|
||||
return;
|
||||
} else if (!(types.isAssignable(o, inputStreamType) || types.isAssignable(o, blobType) || types.isAssignable(o, fileType) || types.isAssignable(o, byteArrayType))) {
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "@JdbcMapper.Blob only valid for String, byte[], Blob, InputStream, and File", specialParam.delegate);
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "JdbcMapper {blob:paramName} only valid for String, byte[], Blob, InputStream, and File", specialParam.delegate);
|
||||
return;
|
||||
}
|
||||
// also if we have a blobStringCharset here it's only valid for String so error out
|
||||
if(specialParam.blobStringCharset != null) {
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "JdbcMapper {blob:charset:paramName} charset can only be specified for String", specialParam.delegate);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CLOB: {
|
||||
if (types.isAssignable(o, stringType)) {
|
||||
method = "Clob";
|
||||
variableName = variableName + " == null ? null : new java.io.StringReader(" + variableName + ")";
|
||||
} else if (!(types.isAssignable(o, readerType) || types.isAssignable(o, clobType))) {
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "@JdbcMapper.Clob only valid for String, Clob, Reader", specialParam.delegate);
|
||||
processingEnv.getMessager().printMessage(Diagnostic.Kind.ERROR, "JdbcMapper {clob:paramName} only valid for String, Clob, Reader", specialParam.delegate);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +415,10 @@ TODO
|
||||
----
|
||||
|
||||
* DOCUMENTATION!!!!!
|
||||
* sql other than select return boolean, int > 0 ?
|
||||
* @RunInTransaction void support
|
||||
* QueryMapper mapping errors should be clearer, especially if a .finish(ResultSet) throws an error
|
||||
* check QueryMapper/ResultSetMapper closing of ResultSets, it doesn't look guaranteed
|
||||
* CompilingResultSetMapper fails on inner class like 'public static class Bla {'
|
||||
* Support Optional<T> for all T instead of null
|
||||
* change boolean to be consistent with other primitives?
|
||||
* make sure 'fallback to resultSet.toObject()' never happens at compile-time with JdbcMapper
|
Loading…
Reference in New Issue
Block a user