/** * Construct a multiple element symbol * @param name Name of the symbol */ public MultipleElementSymbol(String name){ this.group = new GroupSymbol(name); }
/** * Reset the alias for this subquery from clause and it's pseudo-GroupSymbol. * WARNING: this will modify the hashCode and equals semantics and will cause this object * to be lost if currently in a HashMap or HashSet. * @param name New name * @since 4.3 */ public void setName(String name) { this.symbol = new GroupSymbol(name); }
/** * Reset the alias for this subquery from clause and it's pseudo-GroupSymbol. * WARNING: this will modify the hashCode and equals semantics and will cause this object * to be lost if currently in a HashMap or HashSet. * @param name New name * @since 4.3 */ public void setName(String name) { this.symbol = new GroupSymbol(name); }
public GroupSymbol getGroup() { if(group == null) { return new GroupSymbol(this.getProcedureCallableName()); } return group; }
private static GroupSymbol getVarGroup(TargetedCommand cmd) { if (cmd.getGroup().getShortName().equalsIgnoreCase("X")) { //$NON-NLS-1$ return new GroupSymbol("X1"); //$NON-NLS-1$ } return new GroupSymbol("X"); //$NON-NLS-1$ }
private static GroupSymbol getVarGroup(TargetedCommand cmd) { if (cmd.getGroup().getShortName().equalsIgnoreCase("X")) { //$NON-NLS-1$ return new GroupSymbol("X1"); //$NON-NLS-1$ } return new GroupSymbol("X"); //$NON-NLS-1$ }
public static GroupSymbol createResolvedGroup(String groupName, QueryMetadataInterface metadata) throws TeiidComponentException { GroupSymbol group = new GroupSymbol(groupName); return createResolvedGroup(group, metadata); }
static Map createSymbolMap(GroupSymbol oldGroup, final String newGroup, Collection projectedElements) { HashMap symbolMap = new HashMap(); symbolMap.put(oldGroup, new GroupSymbol(newGroup)); for (Iterator i = projectedElements.iterator(); i.hasNext();) { ElementSymbol element = (ElementSymbol)i.next(); symbolMap.put(element, new ElementSymbol(newGroup + Symbol.SEPARATOR + element.getShortName())); } return symbolMap; }
final public Into into(ParseInfo info) throws ParseException { String groupID = null; Into into = null; jj_consume_token(INTO); groupID = id(null); into = new Into(new GroupSymbol(groupID)); {if (true) return into;} throw new Error("Missing return statement in function"); }
static void updateSymbolMap(Map symbolMap, String oldGroup, final String newGroup, QueryMetadataInterface metadata) throws QueryResolverException,QueryMetadataException,TeiidComponentException { GroupSymbol oldGroupSymbol = new GroupSymbol(oldGroup); ResolverUtil.resolveGroup(oldGroupSymbol, metadata); HashSet<ElementSymbol> projectedElements = new HashSet<ElementSymbol>(ResolverUtil.resolveElementsInGroup(oldGroupSymbol, metadata)); symbolMap.putAll(QueryUtil.createSymbolMap(oldGroupSymbol, newGroup, projectedElements)); }
public void setTableMetadata(Table tableMetadata) { if (tableMetadata != null) { this.columns = tableMetadata.getColumns(); this.table = new GroupSymbol(tableMetadata.getName()); } this.tableMetadata = tableMetadata; }
private List<ElementSymbol> getColumns(TransformationMetadata tm, String name) { GroupSymbol gs = new GroupSymbol(name); try { ResolverUtil.resolveGroup(gs, tm); List<ElementSymbol> columns = ResolverUtil.resolveElementsInGroup(gs, tm); return columns; } catch (TeiidException e) { throw new TeiidRuntimeException(e); } }
private List<ElementSymbol> getColumns(TransformationMetadata tm, String name) { GroupSymbol gs = new GroupSymbol(name); try { ResolverUtil.resolveGroup(gs, tm); List<ElementSymbol> columns = ResolverUtil.resolveElementsInGroup(gs, tm); return columns; } catch (TeiidException e) { throw new TeiidRuntimeException(e); } }
private List<ElementSymbol> getColumns(TransformationMetadata tm, String name) { GroupSymbol gs = new GroupSymbol(name); try { ResolverUtil.resolveGroup(gs, tm); List<ElementSymbol> columns = ResolverUtil.resolveElementsInGroup(gs, tm); return columns; } catch (TeiidException e) { throw new TeiidRuntimeException(e); } }
final public Command dropTable(ParseInfo info) throws ParseException { Drop drop = new Drop(); String table = null; jj_consume_token(DROP); jj_consume_token(TABLE); table = id(null); drop.setTable(new GroupSymbol(table)); {if (true) return drop;} throw new Error("Missing return statement in function"); }
final public Command dropTable(ParseInfo info) throws ParseException { Drop drop = new Drop(); String table = null; jj_consume_token(DROP); jj_consume_token(TABLE); table = id(null); drop.setTable(new GroupSymbol(table)); {if (true) return drop;} throw new Error("Missing return statement in function"); }
private void validateUpdatePlan(ModelMetaData model, ValidatorReport report, QueryMetadataInterface metadata, Table t, String plan, int type) throws QueryParserException, QueryResolverException, TeiidComponentException { Command command = parser.parseProcedure(plan, true); QueryResolver.resolveCommand(command, new GroupSymbol(t.getFullName()), type, metadata, false); //determineDependencies(t, command); -- these should be tracked against triggers ValidatorReport resolverReport = Validator.validate(command, metadata); processReport(model, t, report, resolverReport); }
public static Query createMatViewQuery(Object matMetadataId, String matTableName, List<? extends Expression> select, boolean isGlobal) { Query query = new Query(); query.setSelect(new Select(select)); GroupSymbol gs = new GroupSymbol(matTableName); gs.setGlobalTable(isGlobal); gs.setMetadataID(matMetadataId); query.setFrom(new From(Arrays.asList(new UnaryFromClause(gs)))); return query; }
public static Integer regClass(org.teiid.CommandContext cc, String name) throws TeiidComponentException, QueryResolverException, org.teiid.query.parser.ParseException { VDBMetaData metadata = (VDBMetaData) cc.getVdb(); TransformationMetadata tm = metadata.getAttachment(TransformationMetadata.class); GroupSymbol symbol = new GroupSymbol(SQLParserUtil.normalizeId(name)); ResolverUtil.resolveGroup(symbol, tm); return tm.getMetadataStore().getOid(((Table)symbol.getMetadataID()).getUUID()); }
public void updateSymbolMapDependentValues() { // based on the symbol map modify the getalias name if (getAliasResultName() != null) { GroupSymbol newGroup = getMappedSymbol(new GroupSymbol(getAliasResultName())); setAliasResultName(newGroup.getName()); } ElementSymbol mappingClassSymbol = this.getResultSetInfo().getMappingClassSymbol(); if (mappingClassSymbol != null) { this.getResultSetInfo().setMappingClassSymbol(getMappedSymbol(mappingClassSymbol)); } }