private boolean isUpsertKeyColumn(Insert obj, ElementSymbol insertElem) throws TeiidComponentException, QueryMetadataException { if (!obj.isUpsert()) { return false; } Collection keys = getMetadata().getUniqueKeysInGroup(obj.getGroup().getMetadataID()); //not an actual update, but a modification of existing row return !keys.isEmpty() && getMetadata().getElementIDsInKey(keys.iterator().next()).contains(insertElem.getMetadataID()); }
private boolean isUpsertKeyColumn(Insert obj, ElementSymbol insertElem) throws TeiidComponentException, QueryMetadataException { if (!obj.isUpsert()) { return false; } Collection keys = getMetadata().getUniqueKeysInGroup(obj.getGroup().getMetadataID()); //not an actual update, but a modification of existing row return !keys.isEmpty() && getMetadata().getElementIDsInKey(keys.iterator().next()).contains(insertElem.getMetadataID()); }
private boolean isUpsertKeyColumn(Insert obj, ElementSymbol insertElem) throws TeiidComponentException, QueryMetadataException { if (!obj.isUpsert()) { return false; } Collection keys = getMetadata().getUniqueKeysInGroup(obj.getGroup().getMetadataID()); //not an actual update, but a modification of existing row return !keys.isEmpty() && getMetadata().getElementIDsInKey(keys.iterator().next()).contains(insertElem.getMetadataID()); }
private void validateAlterTarget(Alter<?> obj) throws QueryMetadataException, TeiidComponentException { Object schemaId = obj.getTarget().getMetadataID(); if (schemaId == null) { return; } if (getMetadata().getImportedModels().contains(getMetadata().getName(schemaId))) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_alter", obj.getTarget()), obj.getTarget()); //$NON-NLS-1$ } }
private void validateAlterTarget(Alter<?> obj) throws QueryMetadataException, TeiidComponentException { Object schemaId = obj.getTarget().getMetadataID(); if (schemaId == null) { return; } if (getMetadata().getImportedModels().contains(getMetadata().getName(schemaId))) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_alter", obj.getTarget()), obj.getTarget()); //$NON-NLS-1$ } }
private void validateMultisourceInsert(GroupSymbol group) { try { if (getMetadata().isMultiSource(getMetadata().getModelID(group.getMetadataID()))) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.multisource_insert", group), group); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
private void validateMultisourceInsert(GroupSymbol group) { try { if (getMetadata().isMultiSource(getMetadata().getModelID(group.getMetadataID()))) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.multisource_insert", group), group); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
private void validateMultisourceInsert(GroupSymbol group) { try { if (getMetadata().isMultiSource(getMetadata().getModelID(group.getMetadataID()))) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.multisource_insert", group), group); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
public void visit(AlterView obj) { try { QueryResolver.validateProjectedSymbols(obj.getTarget(), getMetadata(), obj.getDefinition()); Validator.validate(obj.getDefinition(), getMetadata(), this); validateAlterTarget(obj); } catch (QueryValidatorException e) { handleValidationError(e.getMessage(), obj.getDefinition()); } catch (TeiidComponentException e) { handleException(e); } }
private void validateAlterTarget(Alter<?> obj) { if (getMetadata().getImportedModels().contains(obj.getTarget().getSchema())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_alter", obj.getTarget()), obj.getTarget()); //$NON-NLS-1$ } }
public void visit(AlterView obj) { try { QueryResolver.validateProjectedSymbols(obj.getTarget(), getMetadata(), obj.getDefinition()); Validator.validate(obj.getDefinition(), getMetadata(), this); validateAlterTarget(obj); } catch (QueryValidatorException e) { handleValidationError(e.getMessage(), obj.getDefinition()); } catch (TeiidComponentException e) { handleException(e); } }
public void visit(AlterView obj) { try { QueryResolver.validateProjectedSymbols(obj.getTarget(), getMetadata(), obj.getDefinition()); Validator.validate(obj.getDefinition(), getMetadata(), this); validateAlterTarget(obj); } catch (QueryValidatorException e) { handleValidationError(e.getMessage(), obj.getDefinition()); } catch (TeiidComponentException e) { handleException(e); } }
@Override public void visit(GroupSymbol obj) { try { if (this.getMetadata().isScalarGroup(obj.getMetadataID())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_scalar_group_reference", obj),obj); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
@Override public void visit(GroupSymbol obj) { try { if (this.getMetadata().isScalarGroup(obj.getMetadataID())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_scalar_group_reference", obj),obj); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
protected void validateGroupSupportsUpdate(GroupSymbol groupSymbol) { try { if(! getMetadata().groupSupports(groupSymbol.getMetadataID(), SupportConstants.Group.UPDATE)) { handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0033", SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol); //$NON-NLS-1$ } } catch (TeiidComponentException e) { handleException(e, groupSymbol); } }
protected void validateGroupSupportsUpdate(GroupSymbol groupSymbol) { try { if(! getMetadata().groupSupports(groupSymbol.getMetadataID(), SupportConstants.Group.UPDATE)) { handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0033", SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol); //$NON-NLS-1$ } } catch (TeiidComponentException e) { handleException(e, groupSymbol); } }
@Override public void visit(GroupSymbol obj) { try { if (this.getMetadata().isScalarGroup(obj.getMetadataID())) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.invalid_scalar_group_reference", obj),obj); //$NON-NLS-1$ } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }
protected void validateGroupSupportsUpdate(GroupSymbol groupSymbol) { try { if(! getMetadata().groupSupports(groupSymbol.getMetadataID(), SupportConstants.Group.UPDATE)) { handleValidationError(QueryPlugin.Util.getString("ERR.015.012.0033", SQLStringVisitor.getSQLString(groupSymbol)), groupSymbol); //$NON-NLS-1$ } } catch (TeiidComponentException e) { handleException(e, groupSymbol); } }
@Override public void visit(AlterTrigger obj) { try { validateAlterTarget(obj); if (obj.isAfter()) { handleValidationError(QueryPlugin.Util.getString("ValidationVisitor.after_not_alterable"), obj); //$NON-NLS-1$ } else { validateGroupSupportsUpdate(obj.getTarget()); } if (obj.getDefinition() != null) { Validator.validate(obj.getDefinition(), getMetadata(), this); } } catch (TeiidComponentException e) { handleException(e); } }
@Override public void visit(IsDistinctCriteria isDistinctCriteria) { try { QueryMetadataInterface metadata = getMetadata(); if (!metadata.isScalarGroup(isDistinctCriteria.getLeftRowValue().getMetadataID())) { handleValidationError(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31171, isDistinctCriteria.getLeftRowValue()), isDistinctCriteria.getLeftRowValue()); } if (!metadata.isScalarGroup(isDistinctCriteria.getRightRowValue().getMetadataID())) { handleValidationError(QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31171, isDistinctCriteria.getRightRowValue()), isDistinctCriteria.getRightRowValue()); } } catch (QueryMetadataException e) { handleException(e); } catch (TeiidComponentException e) { handleException(e); } }