IDataSet data = null;
if (pksToLoad.isEmpty()) {
data = connection.createDataSet();
} else {
EntityRelationshipFilter filter = new EntityRelationshipFilter(connection, pksToLoad, new ConfigurableDependencyInclusionResolver(config));
data = new FilteredDataSet(filter, connection.createDataSet());
}
ReplacementDataSet nullReplacingData = new ReplacementDataSet(data);
nullReplacingData.addReplacementObject(null, Settings.NULL_REPLACEMENT);