本文整理汇总了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();
}
示例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 );
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
示例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 );
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}