if (Collection.class.isAssignableFrom(type)) {
obj = ResultObjectFactoryUtil.createObjectThroughFactory(type);
PROBE.setObject(resultObject, propertyName, obj);
}
} catch (Exception e) {
throw new SqlMapException("Error instantiating collection property for mapping '"
+ mapping.getPropertyName() + "'. Cause: " + e, e);
}
}
// JIRA 375
// "Provide a way for not creating items from nested ResultMaps when the items contain only null values"
boolean subResultObjectAbsent = false;
if (mapping.getNotNullColumn() != null) {
if (statementScope.getResultSet().getObject(mapping.getNotNullColumn()) == null) {
subResultObjectAbsent = true;
}
}
if (!subResultObjectAbsent) {
values = resultMap.getResults(statementScope, statementScope.getResultSet());
if (statementScope.isRowDataFound()) {
Object o = resultMap.setResultObjectValues(statementScope, null, values);
if (o != NO_VALUE) {
if (obj != null && obj instanceof Collection) {
((Collection) obj).add(o);
} else {
PROBE.setObject(resultObject, propertyName, o);
}
}
}
}
} catch (SQLException e) {
throw new SqlMapException("Error getting nested result map values for '" + mapping.getPropertyName()
+ "'. Cause: " + e, e);
}
}