You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have EntityA with a one to many relation to EntityB. I am trying to match a list of values for an attribute in EntityB in order to display EntityA via the filter expression. Displaying a list is working fine for "http://localhost:8081/api/v1/entityA" but I encountered error "InvalidObjectIdentifierException: Unknown identifier 1 for entityA" when I tried with "http://localhost:8081/api/v1/entityA/1".
@SecurityCheck(AbcFilter.PRINCIPAL_HAS_ACCESS)
public class AbcFilter extends FilterExpressionCheck {
public static final String PRINCIPAL_HAS_ACCESS = "user has access to entity A";
@Override
public FilterExpression getFilterExpression(Type<?> entityClass, RequestScope requestScope) {
List<Object>codes = new ArrayList<>(UserUtil.getCodes(requestScope.getUser()));
Path.PathElement xyzPathElement = new Path.PathElement(EntityA.class, EntityB.class, "bEntities");
Path.PathElement abcPathElement = new Path.PathElement(EntityB.class, String.class, "code");
List<Path.PathElement> zPathList = Arrays.asList(xyzPathElement, abcPathElement);
Path pppPath = new Path(zPathList);
return new FilterPredicate(pppPath, Operator.IN, codes);
}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have EntityA with a one to many relation to EntityB. I am trying to match a list of values for an attribute in EntityB in order to display EntityA via the filter expression. Displaying a list is working fine for "http://localhost:8081/api/v1/entityA" but I encountered error "InvalidObjectIdentifierException: Unknown identifier 1 for entityA" when I tried with "http://localhost:8081/api/v1/entityA/1".
@SecurityCheck(AbcFilter.PRINCIPAL_HAS_ACCESS)
public class AbcFilter extends FilterExpressionCheck {
public static final String PRINCIPAL_HAS_ACCESS = "user has access to entity A";
}
Beta Was this translation helpful? Give feedback.
All reactions