on 2023 Jan 25 12:30 PM
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
Request clarification before answering.
Hi with
Organization.roles.role.ID
By traversing 'roles' you are inducing another JOIN in an ON condition. This is not a direct foreign key access and hence not allowed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
16 | |
10 | |
7 | |
7 | |
4 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.