Examples of TranslatorException


Examples of org.teiid.translator.TranslatorException

  public Column addColumn(String name, String type, ColumnSet<?> table) throws TranslatorException {
    if (autoCorrectColumnNames) {
      name.replace(AbstractMetadataRecord.NAME_DELIM_CHAR, '_');
    } else if (name.indexOf(AbstractMetadataRecord.NAME_DELIM_CHAR) != -1) {
      //TODO: for now this is not used
      throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.invalid_name", name)); //$NON-NLS-1$
    }
    Column column = new Column();
    column.setName(name);
    table.addColumn(column);
    column.setPosition(table.getColumns().size()); //1 based indexing
View Full Code Here

Examples of org.teiid.translator.TranslatorException

  private Datatype setColumnType(String type,
      BaseColumn column) throws TranslatorException {
    Datatype datatype = dataTypes.get(type);
    if (datatype == null) {
      throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.unknown_datatype", type)); //$NON-NLS-1$
    }
    column.setDatatype(datatype);
    column.setDatatypeUUID(datatype.getUUID());
    column.setLength(datatype.getLength());
    column.setPrecision(datatype.getPrecisionLength());
View Full Code Here

Examples of org.teiid.translator.TranslatorException

    foreignKey.setParent(table);
    foreignKey.setColumns(new ArrayList<Column>(columnNames.size()));
    foreignKey.setName(name);
    setUUID(foreignKey);
    if (pkTable.getPrimaryKey() == null) {
      throw new TranslatorException("No primary key defined for table " + pkTable); //$NON-NLS-1$
    }
    foreignKey.setPrimaryKey(pkTable.getPrimaryKey());
    foreignKey.setUniqueKeyID(pkTable.getPrimaryKey().getUUID());
    assignColumns(columnNames, table, foreignKey);
    table.getForeignKeys().add(foreignKey);
View Full Code Here

Examples of org.teiid.translator.TranslatorException

          columns.getColumns().add(column);
          break;
        }
      }
      if (!match) {
        throw new TranslatorException(DataPlugin.Util.getString("MetadataFactory.no_column_found", columnName)); //$NON-NLS-1$
      }
    }
  }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

            //create parameter index map
            CallableStatement cstmt = getCallableStatement(sql);
            this.results = this.executionFactory.executeStoredProcedure(cstmt, translatedComm, procedure.getReturnType());
            addStatementWarnings();
        }catch(SQLException e){
            throw new TranslatorException(e, JDBCPlugin.Util.getString("JDBCQueryExecution.Error_executing_query__1", sql)); //$NON-NLS-1$
        }          
       
    }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

              break;
            }
      }
          return result;
        } catch (SQLException e) {
            throw new TranslatorException(e);
        }
    }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

    return result.toString();
  }
 
  public static void validateQueryLength(StringBuffer query) throws TranslatorException {
    if(query.length() >= 10000) {
      throw new TranslatorException(SalesForcePlugin.Util.getString("Util.query.exceeds.max.length")); //$NON-NLS-1$
    }
  }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

                }

                return vals;
            }
        } catch (SQLException e) {
            throw new TranslatorException(e,
                    JDBCPlugin.Util.getString("JDBCTranslator.Unexpected_exception_translating_results___8", e.getMessage())); //$NON-NLS-1$
        }
       
        return null;
    }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

      for (DescribeGlobalSObjectResult object : objects) {
        addTable(object);
     
      addRelationships();
    } catch (ResourceException e) {
      throw new TranslatorException(e);
    }
  }
View Full Code Here

Examples of org.teiid.translator.TranslatorException

  private void addTable(DescribeGlobalSObjectResult object) throws TranslatorException {
    DescribeSObjectResult objectMetadata = null;
    try {
      objectMetadata = connection.getObjectMetaData(object.getName());
    } catch (ResourceException e) {
      throw new TranslatorException(e);
    }
   
    String name = NameUtil.normalizeName(objectMetadata.getName());
    Table table = metadataFactory.addTable(name);
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.