} else if (value instanceof Collection) {
return new ListDataModel(new ArrayList((Collection) value));
} else if (OBJECT_ARRAY_CLASS.isAssignableFrom(value.getClass())) {
return new ArrayDataModel((Object[]) value);
} else if (value instanceof ResultSet) {
return new ResultSetDataModel((ResultSet) value);
} else if (value instanceof Result) {
return new ResultDataModel((Result) value);
} else {
return new ScalarDataModel(value);
}