public Expression parseSelectExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).selectExpression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public Expression parseSelectExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).selectExpression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public Expression parseSelectExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).selectExpression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public Command parseCommand(final String sql, ParseInfo parseInfo, boolean designerCommands, String vdbName, String vdbVersion, String schemaName, CommandContext commandContext) throws QueryParserException { if(sql == null || sql.length() == 0) { throw new QueryParserException(QueryPlugin.Event.TEIID30377, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30377)); } Command result = null; try{ if (designerCommands) { result = getSqlParser(sql).designerCommand(parseInfo); } else { result = getSqlParser(sql).command(parseInfo); } result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); } catch(ParseException pe) { if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) { throw new QueryParserException(QueryPlugin.Event.TEIID30378, convertParserException(pe), QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30378, sql)); } throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public Command parseCommand(final String sql, ParseInfo parseInfo, boolean designerCommands, String vdbName, String vdbVersion, String schemaName, CommandContext commandContext) throws QueryParserException { if(sql == null || sql.length() == 0) { throw new QueryParserException(QueryPlugin.Event.TEIID30377, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30377)); } Command result = null; try{ if (designerCommands) { result = getSqlParser(sql).designerCommand(parseInfo); } else { result = getSqlParser(sql).command(parseInfo); } result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); } catch(ParseException pe) { if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) { throw new QueryParserException(QueryPlugin.Event.TEIID30378, convertParserException(pe), QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30378, sql)); } throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL criteria (i.e. just the WHERE * clause) and returns the object representation. * @param sql SQL criteria (WHERE clause) string * @return Criteria SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Criteria parseCriteria(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Criteria result = null; try{ result = getSqlParser(sql).criteria(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL criteria (i.e. just the WHERE * clause) and returns the object representation. * @param sql SQL criteria (WHERE clause) string * @return Criteria SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Criteria parseCriteria(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Criteria result = null; try{ result = getSqlParser(sql).criteria(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL expression * and returns the object representation. * @param sql SQL expression string * @return SQL expression object * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Expression parseExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).expression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public Command parseCommand(final String sql, ParseInfo parseInfo, boolean designerCommands, String vdbName, String vdbVersion, String schemaName, CommandContext commandContext) throws QueryParserException { if(sql == null || sql.length() == 0) { throw new QueryParserException(QueryPlugin.Event.TEIID30377, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30377)); } Command result = null; try{ if (designerCommands) { result = getSqlParser(sql).designerCommand(parseInfo); } else { result = getSqlParser(sql).command(parseInfo); } result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); } catch(ParseException pe) { if(sql.startsWith(XML_OPEN_BRACKET) || sql.startsWith(XQUERY_DECLARE)) { throw new QueryParserException(QueryPlugin.Event.TEIID30378, convertParserException(pe), QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30378, sql)); } throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL expression * and returns the object representation. * @param sql SQL expression string * @return SQL expression object * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Expression parseExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).expression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL criteria (i.e. just the WHERE * clause) and returns the object representation. * @param sql SQL criteria (WHERE clause) string * @return Criteria SQL object representation * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Criteria parseCriteria(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlCrit")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Criteria result = null; try{ result = getSqlParser(sql).criteria(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
/** * Takes a SQL string representing an SQL expression * and returns the object representation. * @param sql SQL expression string * @return SQL expression object * @throws QueryParserException if parsing fails * @throws IllegalArgumentException if sql is null */ public Expression parseExpression(String sql) throws QueryParserException { if(sql == null) { throw new IllegalArgumentException(QueryPlugin.Util.getString("QueryParser.nullSqlExpr")); //$NON-NLS-1$ } ParseInfo dummyInfo = new ParseInfo(); Expression result = null; try{ result = getSqlParser(sql).expression(dummyInfo); } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } return result; }
public void parseDDL(DatabaseStore repository, Reader ddl) throws MetadataException { SQLParser sqlParser = getSqlParser(ddl); try { sqlParser.parseMetadata(repository); } catch (org.teiid.metadata.ParseException e) { throw e; } catch (MetadataException e) { Token t = sqlParser.token; throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID31259, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31259, t.image, t.beginLine, t.beginColumn, e.getMessage())); } catch (ParseException e) { throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID30386, convertParserException(e)); } finally { tm.reinit(); } }
public void parseDDL(DatabaseStore repository, Reader ddl) throws MetadataException { SQLParser sqlParser = getSqlParser(ddl); try { sqlParser.parseMetadata(repository); } catch (org.teiid.metadata.ParseException e) { throw e; } catch (MetadataException e) { Token t = sqlParser.token; throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID31259, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31259, t.image, t.beginLine, t.beginColumn, e.getMessage())); } catch (ParseException e) { throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID30386, convertParserException(e)); } finally { tm.reinit(); } }
public void parseDDL(DatabaseStore repository, Reader ddl) throws MetadataException { SQLParser sqlParser = getSqlParser(ddl); try { sqlParser.parseMetadata(repository); } catch (org.teiid.metadata.ParseException e) { throw e; } catch (MetadataException e) { Token t = sqlParser.token; throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID31259, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31259, t.image, t.beginLine, t.beginColumn, e.getMessage())); } catch (ParseException e) { throw new org.teiid.metadata.ParseException(QueryPlugin.Event.TEIID30386, convertParserException(e)); } finally { tm.reinit(); } }
public Command parseProcedure(String sql, boolean update) throws QueryParserException { try{ if (update) { return getSqlParser(sql).forEachRowTriggerAction(new ParseInfo()); } Command result = getSqlParser(sql).procedureBodyCommand(new ParseInfo()); result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); return result; } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } }
public Command parseProcedure(String sql, boolean update) throws QueryParserException { try{ if (update) { return getSqlParser(sql).forEachRowTriggerAction(new ParseInfo()); } Command result = getSqlParser(sql).procedureBodyCommand(new ParseInfo()); result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); return result; } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } }
public Command parseProcedure(String sql, boolean update) throws QueryParserException { try{ if (update) { return getSqlParser(sql).forEachRowTriggerAction(new ParseInfo()); } Command result = getSqlParser(sql).procedureBodyCommand(new ParseInfo()); result.setCacheHint(SQLParserUtil.getQueryCacheOption(sql)); return result; } catch(ParseException pe) { throw convertParserException(pe); } finally { tm.reinit(); } }