本文整理汇总了Java中org.pentaho.di.trans.steps.tableoutput.TableOutputMeta类的典型用法代码示例。如果您正苦于以下问题:Java TableOutputMeta类的具体用法?Java TableOutputMeta怎么用?Java TableOutputMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TableOutputMeta类属于org.pentaho.di.trans.steps.tableoutput包,在下文中一共展示了TableOutputMeta类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: dropTable
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean dropTable() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
String schema = meta.getSchemaName();
String table = meta.getTableName();
if( schema != null && !schema.equals("")) {
table = schema+"."+table;
}
String sql = "drop table " + table+";";
try {
Result result = data.db.execStatement(sql);
int status = result.getExitStatus();
if( status == 0 ) {
util.updateMetadata( meta, -1 );
}
return status == 0;
} catch (KettleDatabaseException e) {
logError("Could not drop table: "+table, e);
message = "Could not drop table: "+table;
}
return false;
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:24,代码来源:TableAgileMart.java
示例2: generateDateTransformation
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private TransMeta generateDateTransformation(DatabaseMeta databaseMeta, LogicalTable logicalTable) throws KettleException {
// We actually load the transformation from a template and then slightly modify it.
//
String filename = "/org/pentaho/di/resources/Generate date dimension.ktr";
InputStream inputStream = getClass().getResourceAsStream(filename);
TransMeta transMeta = new TransMeta(inputStream, Spoon.getInstance().rep, true, new Variables(), null);
// Find the table output step and inject the target table name and database...
//
StepMeta stepMeta = transMeta.findStep("TARGET");
if (stepMeta!=null) {
TableOutputMeta meta = (TableOutputMeta) stepMeta.getStepMetaInterface();
meta.setDatabaseMeta(databaseMeta);
String phTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
meta.setTableName(phTable);
}
return transMeta;
}
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:20,代码来源:JobGenerator.java
示例3: generateTimeTransformation
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private TransMeta generateTimeTransformation(DatabaseMeta databaseMeta, LogicalTable logicalTable) throws KettleException {
// We actually load the transformation from a template and then slightly modify it.
//
String filename = "/org/pentaho/di/resources/Generate time dimension.ktr";
InputStream inputStream = getClass().getResourceAsStream(filename);
TransMeta transMeta = new TransMeta(inputStream, Spoon.getInstance().rep, true, new Variables(), null);
// Find the table output step and inject the target table name and database...
//
StepMeta stepMeta = transMeta.findStep("TARGET");
if (stepMeta!=null) {
TableOutputMeta meta = (TableOutputMeta) stepMeta.getStepMetaInterface();
meta.setDatabaseMeta(databaseMeta);
String phTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
meta.setTableName(phTable);
}
return transMeta;
}
开发者ID:jjeb,项目名称:kettle-trunk,代码行数:20,代码来源:JobGenerator.java
示例4: dropTable
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean dropTable() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
String schema = meta.getSchemaName();
String table = meta.getTableName();
if ( schema != null && !schema.equals( "" ) ) {
table = schema + "." + table;
}
String sql = "drop table " + table + ";";
try {
Result result = data.db.execStatement( sql );
int status = result.getExitStatus();
if ( status == 0 ) {
util.updateMetadata( meta, -1 );
}
return status == 0;
} catch ( KettleDatabaseException e ) {
message = "Could not drop table: " + table;
logError( message, e );
}
return false;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:TableAgileMart.java
示例5: generateDateTransformation
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private TransMeta generateDateTransformation(DatabaseMeta databaseMeta, LogicalTable logicalTable) throws KettleException {
// We actually load the transformation from a template and then slightly modify it.
//
String filename = "/org/pentaho/di/resources/Generate date dimension.ktr";
InputStream inputStream = getClass().getResourceAsStream(filename);
TransMeta transMeta = new TransMeta(inputStream, Spoon.getInstance().rep, true, new Variables(), null);
// Find the table output step and inject the target table name and database...
//
StepMeta stepMeta = transMeta.findStep("TARGET");
if (stepMeta!=null) {
TableOutputMeta meta = (TableOutputMeta) stepMeta.getStepMetaInterface();
meta.setDatabaseMeta(databaseMeta);
String phTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
meta.setTableName(phTable);
}
return transMeta;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:JobGenerator.java
示例6: generateTimeTransformation
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private TransMeta generateTimeTransformation(DatabaseMeta databaseMeta, LogicalTable logicalTable) throws KettleException {
// We actually load the transformation from a template and then slightly modify it.
//
String filename = "/org/pentaho/di/resources/Generate time dimension.ktr";
InputStream inputStream = getClass().getResourceAsStream(filename);
TransMeta transMeta = new TransMeta(inputStream, Spoon.getInstance().rep, true, new Variables(), null);
// Find the table output step and inject the target table name and database...
//
StepMeta stepMeta = transMeta.findStep("TARGET");
if (stepMeta!=null) {
TableOutputMeta meta = (TableOutputMeta) stepMeta.getStepMetaInterface();
meta.setDatabaseMeta(databaseMeta);
String phTable = ConceptUtil.getString(logicalTable, DefaultIDs.LOGICAL_TABLE_PHYSICAL_TABLE_NAME);
meta.setTableName(phTable);
}
return transMeta;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:JobGenerator.java
示例7: TableOutputDialog
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
/**
* Constructor.
*/
public TableOutputDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
super(parent, (BaseStepMeta)in, transMeta, sname);
input=(TableOutputMeta)in;
inputFields =new HashMap<String, Integer>();
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:TableOutputDialog.java
示例8: getInfo
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private void getInfo(TableOutputMeta info)
{
info.setSchemaName( wSchema.getText() );
info.setTablename( wTable.getText() );
info.setDatabaseMeta( transMeta.findDatabase(wConnection.getText()) );
info.setCommitSize( wCommit.getText() );
info.setTruncateTable( wTruncate.getSelection() );
info.setIgnoreErrors( wIgnore.getSelection() );
info.setUseBatchUpdate( wBatch.getSelection() );
info.setPartitioningEnabled( wUsePart.getSelection() );
info.setPartitioningField( wPartField.getText() );
info.setPartitioningDaily( wPartDaily.getSelection() );
info.setPartitioningMonthly( wPartMonthly.getSelection() );
info.setTableNameInField( wNameInField.getSelection() );
info.setTableNameField( wNameField.getText() );
info.setTableNameInTable( wNameInTable.getSelection() );
info.setReturningGeneratedKeys( wReturnKeys.getSelection() );
info.setGeneratedKeyField( wReturnField.getText() );
info.setSpecifyFields( wSpecifyFields.getSelection() );
int nrRows = wFields.nrNonEmpty();
info.allocate(nrRows);
for (int i=0; i<nrRows; i++)
{
TableItem item = wFields.getNonEmpty(i);
info.getFieldDatabase()[i] = Const.NVL(item.getText(1), "");
info.getFieldStream()[i] = Const.NVL(item.getText(2), "");
}
}
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:30,代码来源:TableOutputDialog.java
示例9: truncateTable
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean truncateTable() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
try {
data.db.truncateTable(environmentSubstitute(meta.getSchemaName()), environmentSubstitute(meta.getTableName()));
util.updateMetadata( meta, -1 );
return true;
} catch (KettleDatabaseException e) {
logError("Could not truncate table: "+meta.getTableName(), e);
message = "Could not truncate table: "+meta.getTableName();
}
return false;
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:15,代码来源:TableAgileMart.java
示例10: getInfo
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private void getInfo(TableOutputMeta info)
{
info.setSchemaName( wSchema.getText() );
info.setTableName( wTable.getText() );
info.setDatabaseMeta( transMeta.findDatabase(wConnection.getText()) );
info.setCommitSize( wCommit.getText() );
info.setTruncateTable( wTruncate.getSelection() );
info.setIgnoreErrors( wIgnore.getSelection() );
info.setUseBatchUpdate( wBatch.getSelection() );
info.setPartitioningEnabled( wUsePart.getSelection() );
info.setPartitioningField( wPartField.getText() );
info.setPartitioningDaily( wPartDaily.getSelection() );
info.setPartitioningMonthly( wPartMonthly.getSelection() );
info.setTableNameInField( wNameInField.getSelection() );
info.setTableNameField( wNameField.getText() );
info.setTableNameInTable( wNameInTable.getSelection() );
info.setReturningGeneratedKeys( wReturnKeys.getSelection() );
info.setGeneratedKeyField( wReturnField.getText() );
info.setSpecifyFields( wSpecifyFields.getSelection() );
int nrRows = wFields.nrNonEmpty();
info.allocate(nrRows);
for (int i=0; i<nrRows; i++)
{
TableItem item = wFields.getNonEmpty(i);
info.getFieldDatabase()[i] = Const.NVL(item.getText(1), "");
info.getFieldStream()[i] = Const.NVL(item.getText(2), "");
}
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:30,代码来源:TableOutputDialog.java
示例11: truncateTable
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean truncateTable() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
try {
data.db.truncateTable( environmentSubstitute( meta.getSchemaName() ), environmentSubstitute( meta
.getTableName() ) );
util.updateMetadata( meta, -1 );
return true;
} catch ( KettleDatabaseException e ) {
message = "Could not truncate table: " + meta.getTableName();
logError( message, e );
}
return false;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:16,代码来源:TableAgileMart.java
示例12: getInfo
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
private void getInfo( TableOutputMeta info ) {
info.setSchemaName( wSchema.getText() );
info.setTableName( wTable.getText() );
info.setDatabaseMeta( transMeta.findDatabase( wConnection.getText() ) );
info.setCommitSize( wCommit.getText() );
info.setTruncateTable( wTruncate.getSelection() );
info.setIgnoreErrors( wIgnore.getSelection() );
info.setUseBatchUpdate( wBatch.getSelection() );
info.setPartitioningEnabled( wUsePart.getSelection() );
info.setPartitioningField( wPartField.getText() );
info.setPartitioningDaily( wPartDaily.getSelection() );
info.setPartitioningMonthly( wPartMonthly.getSelection() );
info.setTableNameInField( wNameInField.getSelection() );
info.setTableNameField( wNameField.getText() );
info.setTableNameInTable( wNameInTable.getSelection() );
info.setReturningGeneratedKeys( wReturnKeys.getSelection() );
info.setGeneratedKeyField( wReturnField.getText() );
info.setSpecifyFields( wSpecifyFields.getSelection() );
int nrRows = wFields.nrNonEmpty();
info.allocate( nrRows );
//CHECKSTYLE:Indentation:OFF
for ( int i = 0; i < nrRows; i++ ) {
TableItem item = wFields.getNonEmpty( i );
info.getFieldDatabase()[i] = Const.NVL( item.getText( 1 ), "" );
info.getFieldStream()[i] = Const.NVL( item.getText( 2 ), "" );
}
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:29,代码来源:TableOutputDialog.java
示例13: adjustSchema
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean adjustSchema() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
TransMeta transMeta = getTransMeta();
StepMeta stepMeta = meta.getParentStepMeta();
DBCache dbcache = transMeta.getDbCache();
StringBuffer messageBuffer = new StringBuffer();
try {
RowMetaInterface prev = transMeta.getPrevStepFields(stepMeta.getName());
if (log.isDetailed()) logDetailed("Attempting to auto adjust table structure" );
if (log.isDetailed()) logDetailed("getTransMeta: "+getTransMeta() );
if (log.isDetailed()) logDetailed("getStepname: "+getStepname() );
SQLStatement statement = meta.getSQLStatements(transMeta, stepMeta, prev);
if (log.isDetailed()) logDetailed("Statement: "+statement );
if (log.isDetailed() && statement != null) logDetailed("Statement has SQL: "+statement.hasSQL() );
if(statement != null && statement.hasSQL()) {
String sql = statement.getSQL();
if (log.isDetailed()) logDetailed("Trying: "+sql);
try
{
log.logDetailed("Executing SQL: "+Const.CR+sql);
data.db.execStatement(sql);
// Clear the database cache, in case we're using one...
if (dbcache!=null) dbcache.clear(data.databaseMeta.getName());
}
catch(Exception dbe)
{
String error = BaseMessages.getString(PKG, "SQLEditor.Log.SQLExecError", sql, dbe.toString());
messageBuffer.append(error).append(Const.CR);
return false;
}
if (log.isDetailed()) logDetailed("Successfull: "+sql);
}
else if(statement.getError() == null) {
// there were no changes to be made
return true;
} else {
this.message = statement.getError();
logError(statement.getError());
return false;
}
}
catch(Exception e) {
logError("An error ocurred trying to adjust the table schema", e);
}
return true;
}
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:57,代码来源:TableAgileMart.java
示例14: adjustSchema
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
@Override
public boolean adjustSchema() {
TableOutputMeta meta = getMeta();
TableOutputData data = getData();
TransMeta transMeta = getTransMeta();
StepMeta stepMeta = meta.getParentStepMeta();
DBCache dbcache = transMeta.getDbCache();
StringBuilder messageBuffer = new StringBuilder();
try {
RowMetaInterface prev = transMeta.getPrevStepFields( stepMeta.getName() );
if ( log.isDetailed() ) {
logDetailed( "Attempting to auto adjust table structure" );
}
if ( log.isDetailed() ) {
logDetailed( "getTransMeta: " + getTransMeta() );
}
if ( log.isDetailed() ) {
logDetailed( "getStepname: " + getStepname() );
}
SQLStatement statement = meta.getSQLStatements( transMeta, stepMeta, prev, repository, metaStore );
if ( log.isDetailed() ) {
logDetailed( "Statement: " + statement );
}
if ( log.isDetailed() && statement != null ) {
logDetailed( "Statement has SQL: " + statement.hasSQL() );
}
if ( statement != null && statement.hasSQL() ) {
String sql = statement.getSQL();
if ( log.isDetailed() ) {
logDetailed( "Trying: " + sql );
}
try {
log.logDetailed( "Executing SQL: " + Const.CR + sql );
data.db.execStatement( sql );
// Clear the database cache, in case we're using one...
if ( dbcache != null ) {
dbcache.clear( data.databaseMeta.getName() );
}
} catch ( Exception dbe ) {
String error = BaseMessages.getString( PKG, "SQLEditor.Log.SQLExecError", sql, dbe.toString() );
messageBuffer.append( error ).append( Const.CR );
return false;
}
if ( log.isDetailed() ) {
logDetailed( "Successfull: " + sql );
}
} else if ( statement.getError() == null ) {
// there were no changes to be made
return true;
} else {
this.message = statement.getError();
logError( statement.getError() );
return false;
}
} catch ( Exception e ) {
logError( "An error ocurred trying to adjust the table schema", e );
}
return true;
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:68,代码来源:TableAgileMart.java
示例15: TableOutputDialog
import org.pentaho.di.trans.steps.tableoutput.TableOutputMeta; //导入依赖的package包/类
/**
* Constructor.
*/
public TableOutputDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
super( parent, (BaseStepMeta) in, transMeta, sname );
input = (TableOutputMeta) in;
inputFields = new HashMap<String, Integer>();
}
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:9,代码来源:TableOutputDialog.java
注:本文中的org.pentaho.di.trans.steps.tableoutput.TableOutputMeta类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论