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


Java ValueMetaInterface.getName方法代码示例

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


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

示例1: addTableView

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
private void addTableView() {
  int margin = Const.MARGIN;
  ColumnInfo[] colinf = new ColumnInfo[rowMeta.size()];
  for ( int i = 0; i < rowMeta.size(); i++ ) {
    ValueMetaInterface v = rowMeta.getValueMeta( i );
    colinf[i] = new ColumnInfo( v.getName(), ColumnInfo.COLUMN_TYPE_TEXT, v.isNumeric() );
    colinf[i].setToolTip( v.toStringMeta() );
    colinf[i].setValueMeta( v );
  }

  wSeriesTable =
      new TableView( variables, shell, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, props );
  wSeriesTable.setShowingBlueNullValues( true ); //// TODO: 25/05/16 wat?

  fdSeriesTable = new FormData();
  fdSeriesTable.left = new FormAttachment( 0, 0 );
  fdSeriesTable.top = new FormAttachment( 0, margin );
  fdSeriesTable.right = new FormAttachment( 100, 0 );
  fdSeriesTable.bottom = new FormAttachment( 100, -50 );
  wSeriesTable.setLayoutData( fdSeriesTable );

  fillTableView();
}
 
开发者ID:andtorg,项目名称:sdmx-kettle,代码行数:24,代码来源:PreviewTimeSeriesDialog.java

示例2: setOutputFieldsTableFields

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
protected void setOutputFieldsTableFields( CPythonScriptExecutorMeta meta ) {
  RowMetaInterface outFields = meta.getOutputFields();

  if ( outFields != null && outFields.size() > 0 ) {
    for ( int i = 0; i < outFields.size(); i++ ) {
      ValueMetaInterface vm = outFields.getValueMeta( i );
      String name = vm.getName();
      String type = vm.getTypeDesc();

      TableItem item = new TableItem( wtvOutputFields.table, SWT.NONE );
      item.setText( 1, Const.NVL( name, "" ) ); //$NON-NLS-1$
      item.setText( 2, Const.NVL( type, "" ) ); //$NON-NLS-1$
    }

    wtvOutputFields.removeEmptyRows();
    wtvOutputFields.setRowNums();
    wtvOutputFields.optWidth( true );
  }
}
 
开发者ID:pentaho-labs,项目名称:pentaho-cpython-plugin,代码行数:20,代码来源:CPythonScriptExecutorDialog.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 {

	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
					transMeta.getName(),
					stepMeta.getName(),
					databaseMeta.getDatabaseName(),
					"", //$NON-NLS-1$
					outvalue.getName(),
					outvalue.getName(),
					stepMeta.getName(),
					sql,
					BaseMessages.getString(PKG, "DynamicSQLRowMeta.DatabaseImpact.Title") //$NON-NLS-1$
					);
			impact.add(di);

		}
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:27,代码来源:DynamicSQLRowMeta.java

示例4: 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 {

	RowMetaInterface out = prev.clone();
	getFields(out, stepMeta.getName(), new RowMetaInterface[] { info, }, null, transMeta );
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact di = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
					transMeta.getName(),
					stepMeta.getName(),
					databaseMeta.getDatabaseName(),
					"", //$NON-NLS-1$
					outvalue.getName(),
					outvalue.getName(),
					stepMeta.getName(),
					sql,
					Messages.getString("DynamicSQLRowMeta.DatabaseImpact.Title") //$NON-NLS-1$
					);
			impact.add(di);

		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:27,代码来源:DynamicSQLRowMeta.java

示例5: initStreamFieldPosMap

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
private void initStreamFieldPosMap(RowMetaInterface rowMeta) {
    streamFieldPosMap = new HashMap<String, Integer>();
    for (int i = 0; i < rowMeta.size(); i++) {
        ValueMetaInterface v = rowMeta.getValueMeta(i);
        String fieldName = v.getName();
        streamFieldPosMap.put(fieldName.toLowerCase(), i);
    }
}
 
开发者ID:aliyun,项目名称:aliyun-maxcompute-data-collectors,代码行数:9,代码来源:OdpsOutput.java

示例6: createDataSetFromStep

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Create a new data set with the output from 
 */
public void createDataSetFromStep() {
  Spoon spoon = ( (Spoon) SpoonFactory.getInstance() );
  TransGraph transGraph = spoon.getActiveTransGraph();
  IMetaStore metaStore = spoon.getMetaStore();
  if ( transGraph == null ) {
    return;
  }
  StepMeta stepMeta = transGraph.getCurrentStep();
  TransMeta transMeta = spoon.getActiveTransformation();
  if ( stepMeta == null || transMeta == null ) {
    return;
  }

  try {
    MetaStoreFactory<DataSetGroup> groupFactory = new MetaStoreFactory<DataSetGroup>( DataSetGroup.class, metaStore, PentahoDefaults.NAMESPACE );
    List<DatabaseMeta> databases = getAvailableDatabases( spoon.getRepository() );
    groupFactory.addNameList( DataSetConst.DATABASE_LIST_KEY, databases );
    List<DataSetGroup> groups = groupFactory.getElements();

    MetaStoreFactory<DataSet> setFactory = new MetaStoreFactory<DataSet>( DataSet.class, metaStore, PentahoDefaults.NAMESPACE );
    setFactory.addNameList( DataSetConst.GROUP_LIST_KEY, groups );

    DataSet dataSet = new DataSet();
    RowMetaInterface rowMeta = transMeta.getStepFields( stepMeta );
    for ( int i = 0; i < rowMeta.size(); i++ ) {
      ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
      DataSetField field = new DataSetField( valueMeta.getName(), "field" + i, valueMeta.getType(), valueMeta.getLength(), valueMeta.getPrecision(), valueMeta.getComments() );
      dataSet.getFields().add( field );
    }

    editDataSet( spoon, dataSet, groups, setFactory, null );

  } catch ( Exception e ) {
    new ErrorDialog( spoon.getShell(), "Error", "Error creating a new data set", e );
  }
}
 
开发者ID:mattcasters,项目名称:pentaho-pdi-dataset,代码行数:40,代码来源:DataSetHelper.java

示例7: getMaxFieldLength

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
private void getMaxFieldLength()
{
	max_field_length=5;
	if (fields!=null)
	for (int i=0;i<fields.size();i++)
	{
           ValueMetaInterface value = fields.getValueMeta(i);
           if (value!=null && value.getName()!=null)
           {
   			int len = fields.getValueMeta(i).getName().length(); 
   			if (len>max_field_length) max_field_length=len;
           }
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:15,代码来源:ConditionEditor.java

示例8: 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
{
	// Find the lookupfields...
       RowMetaInterface out = new RowMeta(); 
       // TODO: this builds, but does it work in all cases.
       getFields(out, stepMeta.getName(), new RowMetaInterface[] { info }, null, transMeta);
       
	if (out!=null)
	{
		for (int i=0;i<out.size();i++)
		{
			ValueMetaInterface outvalue = out.getValueMeta(i);
			DatabaseImpact ii = new DatabaseImpact( DatabaseImpact.TYPE_IMPACT_READ, 
											transMeta.getName(),
											stepMeta.getName(),
											databaseMeta.getDatabaseName(),
											"",
											outvalue.getName(),
											outvalue.getName(),
											stepMeta.getName(),
											sql,
											"read from one or more database tables via SQL statement"
											);
			impact.add(ii);

		}
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:29,代码来源:TableInputMeta.java

示例9: getFieldDefinition

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
{
	String retval="";
	
	String fieldname = v.getName();
	int    length    = v.getLength();
	int    precision = v.getPrecision();
	
	if (add_fieldname) retval+=fieldname+" ";
	
	int type         = v.getType();
	switch(type)
	{
	case ValueMetaInterface.TYPE_DATE   : retval+="TIMESTAMP"; break;
	case ValueMetaInterface.TYPE_BOOLEAN: retval+="CHAR(1)"; break;
	case ValueMetaInterface.TYPE_NUMBER :
	case ValueMetaInterface.TYPE_INTEGER: 
       case ValueMetaInterface.TYPE_BIGNUMBER: 
		if (fieldname.equalsIgnoreCase(tk)) // Technical & primary key : see at bottom
		{
			retval+="DECIMAL";
		} 
		else
		{
			if ( length<0 || precision<0 )
			{
				retval+="DOUBLE";
			}
			else if ( precision>0 || length>9)
			{
				retval+="DECIMAL("+length;
				if (precision>0)
				{
					retval+=", "+precision;
				}
				retval+=")";
			}
			else // Precision == 0 && length<=9
			{
				retval+="INT"; 
			}
		}
		break;
	case ValueMetaInterface.TYPE_STRING: // CLOBs are just VARCHAR in the Cache database: can be very large!
		retval+="VARCHAR";				
		if (length>0)
		{
			retval+="("+length+")";
		}
		break;
	default:
		retval+=" UNKNOWN";
		break;
	}
	
	if (add_cr) retval+=Const.CR;
	
	return retval;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:60,代码来源:CacheDatabaseMeta.java

示例10: getFieldDefinition

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
@Override
public String getFieldDefinition( ValueMetaInterface v, String tk, String pk, boolean use_autoinc,
                                  boolean add_fieldname, boolean add_cr ) {
  // TODO override for your types
  String retval = "";

  String fieldname = v.getName();
  int length = v.getLength();
  int precision = v.getPrecision();

  if ( add_fieldname ) {
    retval += fieldname + " ";
  }

  int type = v.getType();
  switch ( type ) {
    case ValueMetaInterface.TYPE_DATE:
      retval += "TIMESTAMP";
      break;
    case ValueMetaInterface.TYPE_BOOLEAN:
      if ( supportsBooleanDataType() ) {
        retval += "BOOLEAN";
      } else {
        retval += "CHAR(1)";
      }
      break;
    case ValueMetaInterface.TYPE_NUMBER:
    case ValueMetaInterface.TYPE_INTEGER:
    case ValueMetaInterface.TYPE_BIGNUMBER:
      if ( fieldname.equalsIgnoreCase( tk ) || // Technical key
        fieldname.equalsIgnoreCase( pk ) // Primary key
        ) {
        retval += "BIGSERIAL";
      } else {
        if ( length > 0 ) {
          if ( precision > 0 || length > 18 ) {
            // Numeric(Precision, Scale): Precision = total length; Scale = decimal places
            retval += "NUMERIC(" + ( length + precision ) + ", " + precision + ")";
          } else {
            if ( length > 9 ) {
              retval += "BIGINT";
            } else {
              if ( length < 5 ) {
                retval += "SMALLINT";
              } else {
                retval += "INTEGER";
              }
            }
          }

        } else {
          retval += "DOUBLE PRECISION";
        }
      }
      break;
    case ValueMetaInterface.TYPE_STRING:
      if ( length < 1 || length >= DatabaseMeta.CLOB_LENGTH ) {
        retval += "TEXT";
      } else {
        retval += "VARCHAR(" + length + ")";
      }
      break;
    default:
      retval += " UNKNOWN";
      break;
  }

  if ( add_cr ) {
    retval += Const.CR;
  }

  return retval;
}
 
开发者ID:mattyb149,项目名称:pdi-presto-jdbc,代码行数:74,代码来源:PrestoDatabaseMeta.java

示例11: getFieldDefinition

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
{
	String retval="";
	
	String fieldname = v.getName();
	int    length    = v.getLength();
	int    precision = v.getPrecision();
	
	if (add_fieldname) retval+=fieldname+" ";
	
	int type         = v.getType();
	switch(type)
	{
	case ValueMetaInterface.TYPE_DATE   : retval+="date"; break;
	case ValueMetaInterface.TYPE_BOOLEAN: retval+="boolean"; break;
	case ValueMetaInterface.TYPE_NUMBER :
	case ValueMetaInterface.TYPE_INTEGER:
       case ValueMetaInterface.TYPE_BIGNUMBER:
       	if (length > 0) 
           {
       		if (precision == 0) 
               {
       			if (length <= 2)
       				retval += "byteint";
       			else if (length <= 4)
       				retval += "smallint";
       			else if (length <= 9)
       				retval += "integer";
       			else retval += "bigint";
       		} 
               else 
               {
       			if (length < 9)
       				retval += "real";
       			else if (length < 18)
       				retval += "double";
       			else 
                   {
       				retval += "numeric(" + length;
       				if (precision > 0)
       					retval += ", " + precision;
       				retval += ")";
       			}
       		}
       	}
		break;
	case ValueMetaInterface.TYPE_STRING:
		if (length > MAX_CHAR_LEN)
			retval += "varchar(" + MAX_CHAR_LEN + ")";
		else
			retval+="varchar("+length+")"; 
		break;
	default:
		retval+=" UNKNOWN";
		break;
	}
	if (add_cr) retval+=Const.CR;
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:60,代码来源:NetezzaDatabaseMeta.java

示例12: getFieldDefinition

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
public String getFieldDefinition(ValueMetaInterface v, String tk, String pk, boolean use_autoinc, boolean add_fieldname, boolean add_cr)
{
	String retval="";
	
	String fieldname = v.getName();
	int    length    = v.getLength();
	int    precision = v.getPrecision();
	
	if (add_fieldname) retval+=fieldname+" ";
	
	int type         = v.getType();
	switch(type)
	{
	case ValueMetaInterface.TYPE_DATE   : retval+="DATETIME"; break; // There is no Date or Timestamp data type in SQLite!!! 
	case ValueMetaInterface.TYPE_BOOLEAN: retval+="CHAR(1)"; break;
	case ValueMetaInterface.TYPE_NUMBER : 
	case ValueMetaInterface.TYPE_INTEGER: 
       case ValueMetaInterface.TYPE_BIGNUMBER: 
		if (fieldname.equalsIgnoreCase(tk) || // Technical key
		    fieldname.equalsIgnoreCase(pk)    // Primary key
		    ) 
		{
			retval+="INTEGER PRIMARY KEY AUTOINCREMENT";
		} 
		else
		{
			if (precision!=0 || length<0 || length>18 )
			{
				retval+="NUMERIC";
			}
			else
			{
				retval+="INTEGER";
			}
		}
		break;
	case ValueMetaInterface.TYPE_STRING:
		if (length>=DatabaseMeta.CLOB_LENGTH)
		{
			retval+="BLOB";
		}
		else
		{
			retval+="TEXT"; 
		}
		break;
       case ValueMetaInterface.TYPE_BINARY:
           retval+="BLOB";
           break;
	default:
		retval+="UNKNOWN";
		break;
	}
	
	if (add_cr) retval+=Const.CR;
	
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:59,代码来源:SQLiteDatabaseMeta.java

示例13: getModifyColumnStatement

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Generates the SQL statement to modify a column in the specified table
 * @param tablename The table to add
 * @param v The column defined as a value
 * @param tk the name of the technical key field
 * @param use_autoinc whether or not this field uses auto increment
 * @param pk the name of the primary key field
 * @param semicolon whether or not to add a semi-colon behind the statement.
 * @return the SQL statement to modify a column in the specified table
 */
public String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
{
    String retval="";
    retval+="ALTER TABLE "+tablename+" DROP "+v.getName()+Const.CR+";"+Const.CR;
    retval+="ALTER TABLE "+tablename+" ADD "+getFieldDefinition(v, tk, pk, use_autoinc, true, false);
    return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:ExtenDBDatabaseMeta.java

示例14: getModifyColumnStatement

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Generates the SQL statement to modify a column in the specified table.
 * Note: Support for this in Netezza is incomplete since Netezza allows
 * very limited table/column modifications post-creation
 * @param tablename The table to add
 * @param v The column defined as a value
 * @param tk the name of the technical key field
 * @param use_autoinc whether or not this field uses auto increment
 * @param pk the name of the primary key field
 * @param semicolon whether or not to add a semi-colon behind the statement.
 * @return the SQL statement to modify a column in the specified table
 */
public String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
{
	String retval="";
	retval+="ALTER TABLE "+tablename+" MODIFY COLUMN "+v.getName()+Const.CR+";"+Const.CR;
	return retval;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:NetezzaDatabaseMeta.java

示例15: getModifyColumnStatement

import org.pentaho.di.core.row.ValueMetaInterface; //导入方法依赖的package包/类
/**
 * Generates the SQL statement to modify a column in the specified table
 * @param tablename The table to add
 * @param v The column defined as a value
 * @param tk the name of the technical key field
 * @param use_autoinc whether or not this field uses auto increment
 * @param pk the name of the primary key field
 * @param semicolon whether or not to add a semi-colon behind the statement.
 * @return the SQL statement to modify a column in the specified table
 */
public String getModifyColumnStatement(String tablename, ValueMetaInterface v, String tk, boolean use_autoinc, String pk, boolean semicolon)
{
	String retval="";
	retval+="ALTER TABLE "+tablename+" DROP "+v.getName()+Const.CR+";"+Const.CR;
	retval+="ALTER TABLE "+tablename+" ADD "+getFieldDefinition(v, tk, pk, use_autoinc, true, false);
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:18,代码来源:GuptaDatabaseMeta.java


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