当前位置: 首页>>代码示例>>Java>>正文


Java ValueMetaInterface.toStringMeta方法代码示例

本文整理汇总了Java中org.pentaho.di.core.row.ValueMetaInterface.toStringMeta方法的典型用法代码示例。如果您正苦于以下问题:Java ValueMetaInterface.toStringMeta方法的具体用法?Java ValueMetaInterface.toStringMeta怎么用?Java ValueMetaInterface.toStringMeta使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.core.row.ValueMetaInterface的用法示例。


在下文中一共展示了ValueMetaInterface.toStringMeta方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: analyseImpact

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) throws KettleStepException
   {
       if (prev != null)
       {
           /* DEBUG CHECK THIS */
           // Insert dateMask fields : read/write
           for (int i = 0; i < fieldTable.length; i++)
           {
               ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);

               DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta
                       .getDatabaseName(), transMeta.environmentSubstitute(tableName), fieldTable[i], fieldStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
               impact.add(ii);
           }
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:LucidDBBulkLoaderMeta.java

示例2: analyseImpact

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String[] input,
        String[] output, RowMetaInterface info)
        throws KettleStepException
{
    if (prev != null)
    {
        // Lookup: we do a lookup on the natural keys 
        for (int i = 0; i < keyLookup.length; i++)
        {
            ValueMetaInterface v = prev.searchValueMeta(keyStream[i]);

            DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_DELETE, transMeta.getName(), stepMeta.getName(), databaseMeta
                    .getDatabaseName(), tableName, keyLookup[i], keyStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            impact.add(ii);
        }
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:DeleteMeta.java

示例3: analyseImpact

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public void analyseImpact(List<DatabaseImpact> impact, TransMeta transMeta, StepMeta stepMeta, RowMetaInterface prev, String input[], String output[], RowMetaInterface info) throws KettleStepException
   {
       if (prev != null)
       {
           /* DEBUG CHECK THIS */
           // Insert dateMask fields : read/write
           for (int i = 0; i < fieldTable.length; i++)
           {
               ValueMetaInterface v = prev.searchValueMeta(fieldStream[i]);

               DatabaseImpact ii = new DatabaseImpact(DatabaseImpact.TYPE_IMPACT_READ_WRITE, transMeta.getName(), stepMeta.getName(), databaseMeta.getDatabaseName(), 
               		transMeta.environmentSubstitute(tableName), fieldTable[i], fieldStream[i], v!=null?v.getOrigin():"?", "", "Type = " + v.toStringMeta()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
               impact.add(ii);
           }
       }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:17,代码来源:GPBulkLoaderMeta.java

示例4: convertData

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Convert the specified data to the data type specified in this object.
 *
 * @param meta2
 *          the metadata of the object to be converted
 * @param data2
 *          the data of the object to be converted
 * @return the object in the data type of this value metadata object
 * @throws KettleValueException
 *           in case there is a data conversion error
 */
@Override
public Object convertData(ValueMetaInterface meta2, Object data2) throws KettleValueException {
    switch (meta2.getType()) {
        case TYPE_STRING:
            return data2.toString();
        case TYPE_POINT:
            return data2.toString();
        default:
            throw new KettleValueException(meta2.toStringMeta() + " : can't be converted to a point");
    }
}
 
开发者ID:socrata,项目名称:socrata-kettle,代码行数:23,代码来源:ValueMetaPoint.java

示例5: convertData

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Convert the specified data to the data type specified in this object.
 *
 * @param meta2
 *          the metadata of the object to be converted
 * @param data2
 *          the data of the object to be converted
 * @return the object in the data type of this value metadata object
 * @throws KettleValueException
 *           in case there is a data conversion error
 */
@Override
public Object convertData(ValueMetaInterface meta2, Object data2) throws KettleValueException {
    switch (meta2.getType()) {
        case TYPE_STRING:
            return data2.toString();
        case TYPE_LOCATION:
            return data2.toString();
        default:
            throw new KettleValueException(meta2.toStringMeta() + " : can't be converted to a location");
    }
}
 
开发者ID:socrata,项目名称:socrata-kettle,代码行数:23,代码来源:ValueMetaLocation.java

示例6: getValueFromResultSet

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * This method allows a database dialect to convert database specific data types to Kettle data types.
 * 
 * @param resultSet The result set to use
 * @param valueMeta The description of the value to retrieve
 * @param index the index on which we need to retrieve the value, 0-based.
 * @return The correctly converted Kettle data type corresponding to the valueMeta description.
 * @throws KettleDatabaseException
 */
public Object getValueFromResultSet(ResultSet rs, ValueMetaInterface val, int i) throws KettleDatabaseException {
  Object data = null;
  
  try {
    switch (val.getType()) {
    case ValueMetaInterface.TYPE_BOOLEAN:
      data = Boolean.valueOf(rs.getBoolean(i + 1));
      break;
    case ValueMetaInterface.TYPE_NUMBER:
      data = new Double(rs.getDouble(i + 1));
      break;
    case ValueMetaInterface.TYPE_BIGNUMBER:
      data = rs.getBigDecimal(i + 1);
      break;
    case ValueMetaInterface.TYPE_INTEGER:
      data = Long.valueOf(rs.getLong(i + 1));
      break;
    case ValueMetaInterface.TYPE_STRING: 
      if (val.isStorageBinaryString()) {
        data = rs.getBytes(i + 1);
      } else {
        data = rs.getString(i + 1);
      }
      break;
    case ValueMetaInterface.TYPE_BINARY:
      if (supportsGetBlob()) {
        Blob blob = rs.getBlob(i + 1);
        if (blob != null) {
          data = blob.getBytes(1L, (int) blob.length());
        } else {
          data = null;
        }
      } else {
        data = rs.getBytes(i + 1);
      }
      break;
    case ValueMetaInterface.TYPE_DATE:
      if (val.getOriginalColumnType() == java.sql.Types.TIME) {
        // Neoview can not handle getDate / getTimestamp for a Time column
        data = rs.getTime(i + 1);
        break; // Time is a subclass of java.util.Date, the default date
               // will be 1970-01-01
      } else if (val.getPrecision() != 1 && supportsTimeStampToDateConversion()) {
        data = rs.getTimestamp(i + 1);
        break; // Timestamp extends java.util.Date
      } else {
        data = rs.getDate(i + 1);
        break;
      }
    default:
      break;
    }
    if (rs.wasNull()) {
      data = null; 
    }
  } catch(SQLException e) {
    throw new KettleDatabaseException("Unable to get value '"+val.toStringMeta()+"' from database resultset, index "+i, e);
  }

  return data;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:71,代码来源:NeoviewDatabaseMeta.java

示例7: getValueFromResultSet

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * This method allows a database dialect to convert database specific data types to Kettle data types.
 * 
 * @param resultSet The result set to use
 * @param valueMeta The description of the value to retrieve
 * @param index the index on which we need to retrieve the value, 0-based.
 * @return The correctly converted Kettle data type corresponding to the valueMeta description.
 * @throws KettleDatabaseException
 */
public Object getValueFromResultSet(ResultSet rs, ValueMetaInterface val, int i) throws KettleDatabaseException {
  Object data = null;
  
  try {
    switch (val.getType()) {
    case ValueMetaInterface.TYPE_BOOLEAN:
      data = Boolean.valueOf(rs.getBoolean(i + 1));
      break;
    case ValueMetaInterface.TYPE_NUMBER:
      data = new Double(rs.getDouble(i + 1));
      break;
    case ValueMetaInterface.TYPE_BIGNUMBER:
      data = rs.getBigDecimal(i + 1);
      break;
    case ValueMetaInterface.TYPE_INTEGER:
      data = Long.valueOf(rs.getLong(i + 1));
      break;
    case ValueMetaInterface.TYPE_STRING: 
      if (val.isStorageBinaryString()) {
        data = rs.getBytes(i + 1);
      } else {
        data = rs.getString(i + 1);
      }
      break;
    case ValueMetaInterface.TYPE_BINARY:
      if (supportsGetBlob()) {
        Blob blob = rs.getBlob(i + 1);
        if (blob != null) {
          data = blob.getBytes(1L, (int) blob.length());
        } else {
          data = null;
        }
      } else {
        data = rs.getBytes(i + 1);
      }
      break;
    case ValueMetaInterface.TYPE_DATE:
      if (val.getPrecision() != 1 && supportsTimeStampToDateConversion()) {
        data = rs.getTimestamp(i + 1);
        break; // Timestamp extends java.util.Date
      } else {
        data = rs.getDate(i + 1);
        break;
      }
    default:
      break;
    }
    if (rs.wasNull()) {
      data = null; 
    }
  } catch(SQLException e) {
    throw new KettleDatabaseException("Unable to get value '"+val.toStringMeta()+"' from database resultset, index "+i, e);
  }

  return data;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:66,代码来源:BaseDatabaseMeta.java


注:本文中的org.pentaho.di.core.row.ValueMetaInterface.toStringMeta方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。