* expression should be considered when doing the validation
* @return <code>true</code> if the {@link JPQLQueryBNF} is a descendant of the given parent
* {@link JPQLQueryBNF}; <code>false</code> otherwise
*/
protected boolean isValid(JPQLQueryBNF parentQueryBNF, JPQLQueryBNF queryBNF, boolean bypassCompound) {
JPQLQueryBNFValidator validator = buildJPQLQueryBNFValidator(parentQueryBNF);
try {
validator.setBypassCompound(bypassCompound);
validator.validate(queryBNF);
return validator.isValid();
}
finally {
validator.dispose();
}
}