EOQualifier qualifier = qualifier();
if (_dataSource == null) {
String destinationEntityName = destinationEntityName();
EOEditingContext editingContext = editingContext();
if (ERXEOAccessUtilities.entityWithNamedIsShared(editingContext(), destinationEntityName) ) {
EOArrayDataSource arrayDataSource = new EOArrayDataSource(destinationEntity().classDescriptionForInstances(), editingContext);
NSArray sharedEOs = ERXEOControlUtilities.sharedObjectsForEntityNamed(destinationEntityName);
if (sharedEOs == null) {
sharedEOs = NSArray.EmptyArray;
}
else if (qualifier != null) {
sharedEOs = EOQualifier.filteredArrayWithQualifier(sharedEOs, qualifier);
}
arrayDataSource.setArray(sharedEOs);
_dataSource = arrayDataSource;
}
else {
_dataSource = new EODatabaseDataSource(editingContext, destinationEntityName);
if (qualifier != null) {