/** * Returns the root path for this query, if the query verifies correctly. * * @return a String path which is the root class * @throws PathException if the query does not verify */ public synchronized String getRootClass() throws PathException { List<String> problems = verifyQuery(); // For the purposes of this method, we will permit empty views. if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return rootClass; } throw new PathException("Query does not verify: " + problems, null); }
rootClass = query.getRootClass(); } catch (PathException e) { throw new InvalidQueryException(e.getMessage());
e.fillInStackTrace(); LOG.error("Invalid conversion template: " + e);
stdout.println("Problems updating pathQuery in savedQuery " + savedQuery.getName() + " caused by the wrong path " + pe.getPathString()); continue; stdout.println("Problems updating pathQuery in templateQuery " + templateQuery.getName() + " caused by the wrong path " + pe.getPathString()); continue;
badP = new BadPath(model, "Manager.name"); } catch (PathException e) { e.printStackTrace();
sb.append("service.new_query(\"" + query.getRootClass() + "\")." + endl); } catch (PathException e1) { throw new InvalidQueryException(e1.getMessage()); throw new InvalidQueryException(e.getMessage());
e.fillInStackTrace(); LOG.error("Invalid conversion template: " + e);
stdout.println("Problems updating pathQuery in savedQuery " + savedQuery.getName() + " caused by the wrong path " + pe.getPathString()); continue; stdout.println("Problems updating pathQuery in templateQuery " + templateQuery.getName() + " caused by the wrong path " + pe.getPathString()); continue;
public void testIsCellValidForPath() throws Exception { Path manP = null; Path empsP = null; Path depP = null; try { manP = new Path(model, "Manager.name"); depP = new Path(model, "Manager.department"); empsP = new Path(model, "Manager.department.employees"); } catch (PathException e) { e.printStackTrace(); } ResultElement re = new ResultElement(david, manP, false); ResultsRow<Object> row = new ResultsRow<Object>(); row.add(david); os.addRow(row); PathQuery pq = new PathQuery(model); pq.addViews("Manager.name"); JSONResultsIterator jsonIter = new JSONResultsIterator(getIterator(pq)); assertTrue(jsonIter.isCellValidForPath(re, manP)); assertTrue(jsonIter.isCellValidForPath(re, empsP)); assertTrue(jsonIter.isCellValidForPath(null, manP)); assertTrue(jsonIter.isCellValidForPath(new ResultElement(null, null, false), manP)); assertTrue(! jsonIter.isCellValidForPath(re, depP)); }
/** * Returns the subclass Map for this query, if the query verifies correctly. * * @return a Map from path String to subclass name, for all PathConstraintSubclass objects * @throws PathException if the query does not verify */ public synchronized Map<String, String> getSubclasses() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, String>(subclasses)); } throw new PathException("Query does not verify: " + problems, null); }
rootClass = query.getRootClass(); } catch (PathException e) { throw new InvalidQueryException(e.getMessage());
/** * Returns the subclass Map for this query, if the query verifies correctly. * * @return a Map from path String to subclass name, for all PathConstraintSubclass objects * @throws PathException if the query does not verify */ public synchronized Map<String, String> getSubclasses() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, String>(subclasses)); } throw new PathException("Query does not verify: " + problems, null); }
sb.append("service.new_query(\"" + query.getRootClass() + "\")." + endl); } catch (PathException e1) { throw new InvalidQueryException(e1.getMessage()); throw new InvalidQueryException(e.getMessage());
/** * Returns the root path for this query, if the query verifies correctly. * * @return a String path which is the root class * @throws PathException if the query does not verify */ public synchronized String getRootClass() throws PathException { List<String> problems = verifyQuery(); // For the purposes of this method, we will permit empty views. if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return rootClass; } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the set of loop constraint descriptive strings, for the purpose of checking for * uniqueness. * * @return a Set of Strings * @throws PathException if the query does not verify */ public synchronized Set<String> getExistingLoops() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableSet(new HashSet<String>(existingLoops)); } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the set of loop constraint descriptive strings, for the purpose of checking for * uniqueness. * * @return a Set of Strings * @throws PathException if the query does not verify */ public synchronized Set<String> getExistingLoops() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableSet(new HashSet<String>(existingLoops)); } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the outer join groups map for this query, if the query verifies correctly. This is a * Map from all the class paths in the query to the outer join group, represented by the path of * the root of the group. * * @return a Map from path String to the outer join group it is in * @throws PathException if the query does not verify */ public synchronized Map<String, String> getOuterJoinGroups() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, String>(outerJoinGroups)); } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the outer join groups map for this query, if the query verifies correctly. This is a * Map from all the class paths in the query to the outer join group, represented by the path of * the root of the group. * * @return a Map from path String to the outer join group it is in * @throws PathException if the query does not verify */ public synchronized Map<String, String> getOuterJoinGroups() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, String>(outerJoinGroups)); } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the outer join constraint codes groups map for this query, if the query verifies * correctly. * * @return a Map from outer join group to the Set of constraint codes in the group * @throws PathException if the query does not verify */ public synchronized Map<String, Set<String>> getConstraintGroups() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, Set<String>>( constraintGroups)); } throw new PathException("Query does not verify: " + problems, null); }
/** * Returns the outer join constraint codes groups map for this query, if the query verifies * correctly. * * @return a Map from outer join group to the Set of constraint codes in the group * @throws PathException if the query does not verify */ public synchronized Map<String, Set<String>> getConstraintGroups() throws PathException { List<String> problems = verifyQuery(); if (problems.isEmpty() || Arrays.asList(NO_VIEW_ERROR).equals(problems)) { return Collections.unmodifiableMap(new LinkedHashMap<String, Set<String>>( constraintGroups)); } throw new PathException("Query does not verify: " + problems, null); }