*/
protected void parseQueryWithoutExpression (Element basicSearchElement)
throws BadQueryException {
if (basicSearchElement == null)
throw new BadQueryException (NO_QUERY_ELEMENT);
namespace = basicSearchElement.getNamespace();
Element selectElement = basicSearchElement.getChild
(Literals.SELECT, namespace);
// SELECT is mandatory
if (selectElement == null)
throw new BadQueryException (SELECT_ELEMENT_MISSING);
Element fromElement = basicSearchElement.getChild
(Literals.FROM, namespace);
// FROM is mandatory
if (fromElement == null) {
throw new BadQueryException (FROM_ELEMENT_MISSING);
}
whereElement = basicSearchElement.getChild
(Literals.WHERE, namespace);
Element orderByElement = basicSearchElement.getChild
(Literals.ORDERBY, namespace);
Element limitElement = basicSearchElement.getChild
(Literals.LIMIT, namespace);
Element propElement = selectElement.getChild (Literals.PROP, namespace);
if (propElement == null) {
propElement = selectElement.getChild (Literals.ALLPROP, namespace);
}
if (propElement == null) {
throw new BadQueryException(PROP_OR_ALLPROP_ELEMENT_MISSING);
}
requestedProperties = createRequestedProperties (propElement);
//queryScope = new BasicQueryScope (fromElement);
if (orderByElement != null) {
orderBy = createNewOrderBy (orderByElement);
}
if (limitElement != null) {
Element nResElem = limitElement.getChild (Literals.NRESULTS, namespace);
if (nResElem == null)
throw new BadQueryException (NRESULTS_MISSING);
limit = new Integer (nResElem.getTextTrim()).intValue();
limitDefined = true;
}
}