* End Index cannot be set before start index.
* End Index cannot equal StartAtIndex
*/
if ((endAtIndex != Query.NO_END_AT_INDEX) && (endAtIndex < startAtIndex))
{
throw new QueryInvalidException("endAtIndex must be greater than startAtIndex");
}
if (((endAtIndex != Query.NO_END_AT_INDEX) && (startAtIndex != Query.NO_START_AT_INDEX))
&& (endAtIndex == startAtIndex))
{
throw new QueryInvalidException("endAtIndex cannot be set equal to startAtIndex");
}
try
{
// Query query = QueryPool.getQuery(queryString);
// Use the OQL parser to transform a query string to a valid org.apache.ojb.broker.query object
Query _query;
StringReader reader = new StringReader(queryString);
OQLLexer lexer = new OQLLexer(reader);
OQLParser parser = new OQLParser(lexer);
_query = parser.buildQuery();
setBindIterator(flatten(_query.getCriteria(), new Vector()).listIterator());
_query.setStartAtIndex(startAtIndex);
_query.setEndAtIndex(endAtIndex);
setQuery(_query);
}
catch (RecognitionException e)
{
throw new QueryInvalidException(e.getMessage());
}
catch (TokenStreamException e)
{
throw new QueryInvalidException(e.getMessage());
}
}