use of com.evolveum.midpoint.repo.sqlbase.QueryException in project midpoint by Evolveum.
the class JpaEntityDefinition method nextLinkDefinition.
@Override
public DataSearchResult<?> nextLinkDefinition(ItemPath path, ItemDefinition<?> itemDefinition, PrismContext prismContext) throws QueryException {
if (ItemPath.isEmpty(path)) {
// doesn't fulfill precondition
return null;
}
Object first = path.first();
if (ItemPath.isId(first)) {
throw new QueryException("ID item path segments are not allowed in query: " + path);
} else if (ItemPath.isObjectReference(first)) {
throw new QueryException("'@' path segment cannot be used in the context of an entity " + this);
}
JpaLinkDefinition<?> link = findRawLinkDefinition(path, JpaDataNodeDefinition.class, false);
if (link == null) {
return null;
} else {
link.resolveEntityPointer();
return new DataSearchResult<>(link, path.rest(link.getItemPath().size()));
}
}
Aggregations