Я не могу сделать подсчет (*), когда у меня есть ассоциации. Нужна рекомендация по этому требованию.
Объекты ландшафта объекта
@Core.Description: 'entity set containing all kinds of landscape objects'
@Core.LongDescription: 'you can use ?$filter=modifiedAt gt datetimeoffset2019-03-15T14:00:00Z to filter on recently modified objects (time stamp in single quotes)'
entity LandscapeObjects : managed {
key id : UUID not null;
name : LandscapeObjectType;
description: String(256);
objType : String(64);
customerNumber: String(64);
networkSegment: Association to LandscapeObjects;
source: String(64);
properties: Composition of many Properties on properties.owner = $self;
};
Соединения объектов
@Core.Description: 'associations between landscape objects'
entity Connections {
key parent: Association to LandscapeObjects;
key child: Association to LandscapeObjects;
role: String(64);
};
Просмотр BusinessServices1
@readonly view BusinessServices1 as select from landscape.LandscapeObjects {
key id,
name,
description,
customerNumber,
networkSegment,
properties[name='useCase'].value as useCase
} where objType = 'BusinessService';```
Просмотр BusinessServices2
@readonly view BusinessServices2 as select from BusinessServices1 left join landscape.Connections on BusinessServices1.id = Connections.parent.id {
key BusinessServices1.id,
BusinessServices1.name,
BusinessServices1.description,
BusinessServices1.customerNumber,
BusinessServices1.networkSegment,
useCase,
count(*) as totalConnections : Integer
} group by BusinessServices1.id,
BusinessServices1.name,
BusinessServices1.description,
BusinessServices1.customerNumber,
BusinessServices1.networkSegment,
useCase;
Проблема: представление BusinessServices1 работает, но BusinessServices2 не работает из-за Connections.parent.id (неуправляемые ассоциации?)
Во время развертывания базы данных происходит сбой с ошибкой
сообщение: «Неуправляемые ассоциации не могут использоваться в определении условия ON»
Не могли бы вы помочь, как я могу получить список соединений в этом случае?