mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-21 11:09:17 +00:00
#2391 - MySql specific NPE because the return value of "java.sql.ResultSetMetaData.getTableName(int)" is null
This commit is contained in:
@@ -408,9 +408,9 @@ final class CQueryBuilder {
|
||||
int cols = 1 + metaData.getColumnCount();
|
||||
List<String> propertyNames = new ArrayList<>(cols - 1);
|
||||
for (int i = 1; i < cols; i++) {
|
||||
String schemaName = metaData.getSchemaName(i).toLowerCase();
|
||||
String tableName = metaData.getTableName(i).toLowerCase();
|
||||
String columnName = metaData.getColumnName(i).toLowerCase();
|
||||
String schemaName = lower(metaData.getSchemaName(i));
|
||||
String tableName = lower(metaData.getTableName(i));
|
||||
String columnName = lower(metaData.getColumnName(i));
|
||||
String path = desc.findBeanPath(schemaName, tableName, columnName);
|
||||
if (path != null) {
|
||||
propertyNames.add(path);
|
||||
@@ -426,6 +426,10 @@ final class CQueryBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
private String lower(String value) {
|
||||
return value == null ? "" : value.toLowerCase();
|
||||
}
|
||||
|
||||
private SqlTree createRawSqlSqlTree(OrmQueryRequest<?> request, CQueryPredicates predicates) {
|
||||
BeanDescriptor<?> descriptor = request.descriptor();
|
||||
ColumnMapping columnMapping = request.query().getRawSql().getColumnMapping();
|
||||
|
||||
Reference in New Issue
Block a user