Skip to Content
0
Jan 25 at 12:30 PM

Getting "must not be an unmanaged association" while joining tables in view in CAP Java

172 Views Last edit Jan 25 at 12:40 PM 7 rev

Hi,

I am trying to user inner join on tables as follows but while building CAP Java project,I am getting "InviteeRoleForOrgRelationshipView?: ?roles? in path ?Organization.roles.role.ID?" must not be an unmanaged association and InviteeRoleForOrgRelationshipView?: ?scenarios? in path ?Organization.scenarios.scenario.ID?" must not be an unmanaged association",can someone please explain what is the issue here and how it can be resolved? Below is the code reference:-

define view InviteeRoleForOrgRelationshipView as
    select from InviteeRoleForOrgRelationship
    inner join Organization
        on  Organization.roles.role.ID         = InviteeRoleForOrgRelationship.role.ID
        and Organization.scenarios.scenario.ID = InviteeRoleForOrgRelationship.scenario.ID
    {
        key InviteeRoleForOrgRelationship.role.ID       as role_ID,
            InviteeRoleForOrgRelationship.role.name     as roleName,
        key InviteeRoleForOrgRelationship.scenario.ID   as scenario_ID,
            InviteeRoleForOrgRelationship.scenario.name as scnName,
            Organization.type.ID                        as OrgType_ID
    };


entity InviteeRoleForOrgRelationship {
    key role     : Association to Role;
    key scenario : Association to Scenario;
}


entity Organization : managed {
    key ID             : String;
        type           : Composition of OrganizationType;
        scenarios : Composition of many OrganizationScenario
                        on scenarios.org = $self;
        roles          : Composition of many OrganizationRoles
                            on roles.org = $self;
}


entity OrganizationScenario : managed {
    key org       : Association to Organization;
    key scenario  : Association to Scenario;
}


entity OrganizationRoles {
    key org : Association to Organization;
    key role : Association to Role;
}

entity Role { 
key ID : String; 
name : String; organizationType : Composition of OrganizationType;
}


entity Scenario { 
key ID : Integer; 
name : String;
} 
  

Thanks!

Regards,

Krishma