@Test public void completeShortStatementStartingWithFrom() { assertEquals( "select doc.fullName from XWikiDocument doc , BaseObject obj where doc.fullName=obj.name " + "and obj.className='XWiki.MyClass'", this.executor.completeShortFormStatement( ", BaseObject obj where " + "doc.fullName=obj.name and obj.className='XWiki.MyClass'")); }
protected String completeShortFormStatement(String statement) { String lcStatement = statement.toLowerCase().trim(); if (lcStatement.isEmpty() || lcStatement.startsWith(",") || lcStatement.startsWith("where ") || lcStatement.startsWith("order by ")) { return "select doc.fullName from XWikiDocument doc " + statement.trim(); } return statement; }
HqlQueryExecutor implements QueryExecutor, Initializable { protected String completeShortFormStatement(String statement) { String lcStatement = statement.toLowerCase().trim(); if (lcStatement.isEmpty() || lcStatement.startsWith(",") || lcStatement.startsWith("where ") || lcStatement.startsWith("order by ")) { return "select doc.fullName from XWikiDocument doc " + statement.trim(); } return statement; } }
HqlQueryExecutor implements QueryExecutor, Initializable { protected String completeShortFormStatement(String statement) { String lcStatement = statement.toLowerCase().trim(); if (lcStatement.isEmpty() || lcStatement.startsWith(",") || lcStatement.startsWith("where ") || lcStatement.startsWith("order by ")) { return "select doc.fullName from XWikiDocument doc " + statement.trim(); } return statement; }  }
HqlQueryExecutor implements QueryExecutor, Initializable { protected String completeShortFormStatement(String statement) { String lcStatement = statement.toLowerCase().trim(); if (lcStatement.isEmpty() || lcStatement.startsWith(",") || lcStatement.startsWith("where ") || lcStatement.startsWith("order by ")) { return "select doc.fullName from XWikiDocument doc " + statement.trim(); } return statement; }  @Override void initialize(); @Override List<T> execute(final Query query); }
HqlQueryExecutor implements QueryExecutor, Initializable { protected String completeShortFormStatement(String statement) { String lcStatement = statement.toLowerCase().trim(); if (lcStatement.isEmpty() || lcStatement.startsWith(",") || lcStatement.startsWith("where ") || lcStatement.startsWith("order by ")) { return "select doc.fullName from XWikiDocument doc " + statement.trim(); } return statement; }  @Override void initialize(); @Override List<T> execute(final Query query);  }