public String call(Path p) { return p.getNoConstraintsString(); } });
/** * Returns the outer join group that the given path is in. * * @param stringPath a pathString * @return a String representing the outer join group that the path is in * @throws NullPointerException if pathString is null * @throws PathException if the query is invalid or the path is invalid * @throws NoSuchElementException is the path is not in the query */ public String getOuterJoinGroup(String stringPath) throws PathException { if (stringPath == null) { throw new NullPointerException("stringPath is null"); } Map<String, String> groups = getOuterJoinGroups(); Path path = makePath(stringPath); if (path.endIsAttribute()) { path = path.getPrefix(); } if (!groups.containsKey(path.getNoConstraintsString())) { throw new NoSuchElementException("Path " + stringPath + " is not in the query"); } return groups.get(path.getNoConstraintsString()); }
/** * Returns the outer join group that the given path is in. * * @param stringPath a pathString * @return a String representing the outer join group that the path is in * @throws NullPointerException if pathString is null * @throws PathException if the query is invalid or the path is invalid * @throws NoSuchElementException is the path is not in the query */ public String getOuterJoinGroup(String stringPath) throws PathException { if (stringPath == null) { throw new NullPointerException("stringPath is null"); } Map<String, String> groups = getOuterJoinGroups(); Path path = makePath(stringPath); if (path.endIsAttribute()) { path = path.getPrefix(); } if (!groups.containsKey(path.getNoConstraintsString())) { throw new NoSuchElementException("Path " + stringPath + " is not in the query"); } return groups.get(path.getNoConstraintsString()); }
for (String view : pathQuery.getView()) { Path path = new Path(model, view, subclasses); String parentPath = path.getPrefix().getNoConstraintsString(); String outerJoinGroup = outerJoinGroups.get(parentPath); if (root.equals(outerJoinGroup)) { while ((!path.isRootPath()) && (!root.equals(outerJoinGroups.get(path.getPrefix() .getNoConstraintsString())))) { path = path.getPrefix(); view = path.getNoConstraintsString(); if (!pathExpressionsDone.contains(view)) { QueryPathExpressionWithSelect pe = pathExpressions.get(view);
path = path.getPrefix(); String groupPath = outerJoinGroups.get(path.getNoConstraintsString()); if (groupPath != null) { Set<String> group = constraintGroups.get(groupPath);
for (String view : pathQuery.getView()) { Path path = new Path(model, view, subclasses); String parentPath = path.getPrefix().getNoConstraintsString(); String outerJoinGroup = outerJoinGroups.get(parentPath); if (root.equals(outerJoinGroup)) { while ((!path.isRootPath()) && (!root.equals(outerJoinGroups.get(path.getPrefix() .getNoConstraintsString())))) { path = path.getPrefix(); view = path.getNoConstraintsString(); if (!pathExpressionsDone.contains(view)) { QueryPathExpressionWithSelect pe = pathExpressions.get(view);
path = path.getPrefix(); outerJoinGroups.put(validPath, path.getNoConstraintsString()); } catch (PathException e) {
path = path.getPrefix(); outerJoinGroups.put(validPath, path.getNoConstraintsString()); } catch (PathException e) {
@Override public Map<String, Object> visitLeft(ResultCell a) { Map<String, Object> cell = new HashMap<String, Object>(); cell.put("value", a.getField()); cell.put("id", a.getId()); cell.put("type", a.getType()); cell.put("column", a.getPath().getNoConstraintsString()); return cell; }
@Override public Map<String, Object> visitLeft(ResultCell a) { Map<String, Object> cell = new HashMap<String, Object>(); cell.put("value", a.getField()); cell.put("id", a.getId()); cell.put("type", a.getType()); cell.put("column", a.getPath().getNoConstraintsString()); return cell; }
/** * Returns true if the given Path object represents a path that is inner-joined onto the parent * path in this query. This will return false for the root class. Do not call this method with * a Path that is an attribute. * * @param path a Path object * @return true if the join is inner, not outer and not the root * @throws IllegalArgumentException if the path is an attribute */ private boolean isInner(Path path) { if (path.isRootPath()) { return false; } if (path.endIsAttribute()) { throw new IllegalArgumentException("Cannot call isInner() with a path that is an " + "attribute"); } OuterJoinStatus status = getOuterJoinStatus(path.getNoConstraintsString()); if (OuterJoinStatus.INNER.equals(status)) { return true; } else if (OuterJoinStatus.OUTER.equals(status)) { return false; } // Fall back on defaults return true; }
/** * Returns true if the given Path object represents a path that is inner-joined onto the parent * path in this query. This will return false for the root class. Do not call this method with * a Path that is an attribute. * * @param path a Path object * @return true if the join is inner, not outer and not the root * @throws IllegalArgumentException if the path is an attribute */ private boolean isInner(Path path) { if (path.isRootPath()) { return false; } if (path.endIsAttribute()) { throw new IllegalArgumentException("Cannot call isInner() with a path that is an " + "attribute"); } OuterJoinStatus status = getOuterJoinStatus(path.getNoConstraintsString()); if (OuterJoinStatus.INNER.equals(status)) { return true; } else if (OuterJoinStatus.OUTER.equals(status)) { return false; } // Fall back on defaults return true; }
@Override public Map<String, Object> visitRight(SubTable b) { Map<String, Object> st = new HashMap<String, Object>(); st.put("collection", b.getJoinPath().getNoConstraintsString()); st.put("columns", CollectionUtils.collect(b.getColumns(), StringValueTransformer.getInstance())); List<List<Map<String, Object>>> rows = new ArrayList<List<Map<String, Object>>>(); st.put("rows", rows); for (List<Either<ResultCell, SubTable>> items: b.getRows()){ List<Map<String, Object>> row = new ArrayList<Map<String, Object>>(); rows.add(row); for (Either<ResultCell, SubTable> item: items) { row.add(item.accept(this)); } } return st; }
@Override public Map<String, Object> visitRight(SubTable b) { Map<String, Object> st = new HashMap<String, Object>(); st.put("collection", b.getJoinPath().getNoConstraintsString()); st.put("columns", CollectionUtils.collect(b.getColumns(), StringValueTransformer.getInstance())); List<List<Map<String, Object>>> rows = new ArrayList<List<Map<String, Object>>>(); st.put("rows", rows); for (List<Either<ResultCell, SubTable>> items: b.getRows()){ List<Map<String, Object>> row = new ArrayList<Map<String, Object>>(); rows.add(row); for (Either<ResultCell, SubTable> item: items) { row.add(item.accept(this)); } } return st; }
String parent = tq.makePath(node).getPrefix().getNoConstraintsString(); if (bagOrIds instanceof InterMineBag) { InterMineBag bag = (InterMineBag) bagOrIds;
&& !allClasses.contains(cld.getUnqualifiedName())) { throw new TemplatePopulatorException("The constraint of type " + path.getNoConstraintsString() + " can't be set to a bag (list) of type " + bag.getType() + " in template query " + template.getName() + ".");
String parent = tq.makePath(node).getPrefix().getNoConstraintsString(); if (bagOrIds instanceof InterMineBag) { InterMineBag bag = (InterMineBag) bagOrIds;
&& !allClasses.contains(cld.getUnqualifiedName())) { throw new TemplatePopulatorException("The constraint of type " + path.getNoConstraintsString() + " can't be set to a bag (list) of type " + bag.getType() + " in template query " + template.getName() + ".");
Path path = new Path(model, order.getOrderPath(), subclasses); QueryClass qc = (QueryClass) queryBits.get(path.getPrefix() .getNoConstraintsString()); qf = new QueryField(qc, path.getLastElement()); queryBits.put(order.getOrderPath(), qf);
Path path = new Path(model, order.getOrderPath(), subclasses); QueryClass qc = (QueryClass) queryBits.get(path.getPrefix() .getNoConstraintsString()); qf = new QueryField(qc, path.getLastElement()); queryBits.put(order.getOrderPath(), qf);