@SuppressWarnings( "synthetic-access" ) @Override public String explain( String query, String language ) { return ((org.modeshape.jcr.api.query.QueryResult)queryResult).getPlan(); }
protected void print( Query query, QueryResult result ) { System.out.println(); System.out.println(query); System.out.println(" plan -> " + ((org.modeshape.jcr.api.query.QueryResult)result).getPlan()); System.out.println(result); }
public static String explainPlain(Session session, String queryExpression) throws RepositoryException { Query query = session.getWorkspace().getQueryManager().createQuery(queryExpression, "JCR-SQL2"); org.modeshape.jcr.api.query.Query msQuery = (org.modeshape.jcr.api.query.Query)query; // Get the query plan without executing it ... org.modeshape.jcr.api.query.QueryResult result = msQuery.explain(); String plan = result.getPlan(); return plan; }
public List<T> findWithExplainPlan(String queryExpression) { try { org.modeshape.jcr.api.query.Query query = (org.modeshape.jcr.api.query.Query) getSession().getWorkspace().getQueryManager().createQuery(queryExpression, "JCR-SQL2"); org.modeshape.jcr.api.query.QueryResult result = query.explain(); String plan = result.getPlan(); log.info(plan); return find(queryExpression); } catch (RepositoryException e) { throw new MetadataRepositoryException("Failure while finding entity ", e); } }
@Override public String explain( String query, String language ) throws RepositoryException { logger.trace("Explaining query: {0}", query); // Create the query ... final org.modeshape.jcr.api.query.Query jcrQuery = (org.modeshape.jcr.api.query.Query)getLocalSession().getSession().getWorkspace().getQueryManager().createQuery(query, language); return jcrQuery.explain().getPlan(); }
@Override public String explain( String query, String language ) throws RepositoryException { logger.trace("Explaining query: {0}", query); // Create the query ... final org.modeshape.jcr.api.query.Query jcrQuery = (org.modeshape.jcr.api.query.Query)getLocalSession().getSession().getWorkspace().getQueryManager().createQuery(query, language); return jcrQuery.explain().getPlan(); }
protected void validateQueryPlan( QueryResult result ) { if (checkForQueryPlan) { String plan = ((org.modeshape.jcr.api.query.QueryResult)result).getPlan(); assertNotNull(plan); assertTrue(plan.trim().length() > 0);
String plan = result.getPlan(); return new RestQueryPlanResult(plan, statement, language, query.getAbstractQueryModelRepresentation());
System.out.println(); System.out.println(query); System.out.println(((org.modeshape.jcr.api.query.QueryResult)result).getPlan()); System.out.println(result);
System.out.println(); System.out.println(query); System.out.println(" plan -> " + ((org.modeshape.jcr.api.query.QueryResult)result).getPlan()); System.out.println(result);