xrService.descriptorsByQName.get(type).getAlias()).isAggregateDescriptor() &&
!xrService.getORSession().getClassDescriptorForAlias(
xrService.descriptorsByQName.get(type).getAlias()).isObjectRelationalDataTypeDescriptor()
)) {
// data-read query
databaseQueryToInitialize = new DataReadQuery();
}
else {
if (!xrService.descriptorsByQName.containsKey(type)) {
// data-read query
databaseQueryToInitialize = new DataReadQuery();
}
else {
// read-all query for the class mapped to the type
databaseQueryToInitialize =
new ReadAllQuery(xrService.getTypeClass(type));
}
}
}
else {
if (queryOperation.isSimpleXMLFormat() ||
(xrService.descriptorsByQName.containsKey(type) &&
xrService.getORSession().getClassDescriptorForAlias(xrService.descriptorsByQName.get(type).getAlias()).isAggregateDescriptor() &&
!xrService.getORSession().getClassDescriptorForAlias(xrService.descriptorsByQName.get(type).getAlias()).isObjectRelationalDataTypeDescriptor()
)) {
// data-read query
databaseQueryToInitialize = new DataReadQuery();
}
else if (!xrService.descriptorsByQName.containsKey(type)) {
// value read query
databaseQueryToInitialize = new ValueReadQuery();
}