public class Utils {
public static HBqlStatement parseHBqlStatement(final String sql) throws HBqlException {
try {
final HBqlStatement stmt = ParserUtil.parseHBqlStatement(sql);
if (!Utils.isSelectStatement(stmt)
&& !(stmt instanceof ConnectionStatement)
&& !(stmt instanceof NonConnectionStatement))
throw new HBqlException("Unsupported statement type: " + stmt.getClass().getSimpleName() + " - " + sql);
if (stmt instanceof MappingContext) {
final MappingContext mappingContext = (MappingContext)stmt;
mappingContext.setResultAccessor(new HRecordResultAccessor(mappingContext));
}