本文整理了Java中org.pentaho.di.core.Const.NVL()
方法的一些代码示例,展示了Const.NVL()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Const.NVL()
方法的具体详情如下:
包路径:org.pentaho.di.core.Const
类名称:Const
方法名:NVL
[英]Implements Oracle style NVL function
[中]实现Oracle风格的NVL函数
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Looks up the user's home directory (or KETTLE_HOME) for every invocation. This is no longer a static property so
* the value may be set after this class is loaded.
*
* @return The path to the users home directory, or the System property {@code KETTLE_HOME} if set.
*/
public static String getUserHomeDirectory() {
return NVL( System.getenv( "KETTLE_HOME" ), NVL( System.getProperty( "KETTLE_HOME" ),
System.getProperty( "user.home" ) ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
public static int getBackoffIncrements() {
try {
return Integer.parseInt( Const.NVL( System.getProperty( "KETTLE_CARTE_RETRY_BACKOFF_INCREMENTS" ), "1000" ) );
} catch ( Exception e ) {
return 1000;
}
}
代码示例来源:origin: pentaho/pentaho-kettle
private void getData() {
wStep.setSelection( searchingSteps );
wDB.setSelection( searchingDatabases );
wNote.setSelection( searchingNotes );
wFilter.setText( Const.NVL( filterString, "" ) );
wFilter.setFocus();
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Sets the internal name kettle variable.
*
* @param var
* the new internal name kettle variable
*/
@Override
protected void setInternalNameKettleVariable( VariableSpace var ) {
// The name of the transformation
//
variables.setVariable( Const.INTERNAL_VARIABLE_TRANSFORMATION_NAME, Const.NVL( name, "" ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
protected static String buildPoolName( DatabaseMeta dbMeta, String partitionId ) {
return dbMeta.getName() + Const.NVL( dbMeta.getDatabaseName(), "" )
+ Const.NVL( dbMeta.getHostname(), "" ) + Const.NVL( dbMeta.getDatabasePortNumberString(), "" )
+ Const.NVL( partitionId, "" );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Sets the internal name kettle variable.
*
* @param var the new internal name kettle variable
*/
@Override
protected void setInternalNameKettleVariable( VariableSpace var ) {
// The name of the job
variables.setVariable( Const.INTERNAL_VARIABLE_JOB_NAME, Const.NVL( name, "" ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
public WebResult removeJob( String jobName, String carteObjectId ) throws Exception {
String xml =
execService( RemoveJobServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( jobName, "UTF-8" ) + "&id="
+ Const.NVL( carteObjectId, "" ) + "&xml=Y" );
return WebResult.fromXMLString( xml );
}
代码示例来源:origin: pentaho/pentaho-kettle
public WebResult deAllocateServerSockets( String transName, String clusteredRunId ) throws Exception {
String xml =
execService( CleanupTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transName, "UTF-8" ) + "&id="
+ Const.NVL( clusteredRunId, "" ) + "&xml=Y&sockets=Y" );
return WebResult.fromXMLString( xml );
}
代码示例来源:origin: pentaho/pentaho-kettle
public WebResult stopTransformation( String transName, String carteObjectId ) throws Exception {
String xml =
execService( StopTransServlet.CONTEXT_PATH + "/?name=" + URLEncoder.encode( transName, "UTF-8" ) + "&id="
+ Const.NVL( carteObjectId, "" ) + "&xml=Y" );
return WebResult.fromXMLString( xml );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void setParametersAsVariablesInUI( NamedParams namedParameters, VariableSpace space ) {
for ( String param : namedParameters.listParameters() ) {
try {
space.setVariable( param, Const.NVL( namedParameters.getParameterValue( param ), Const.NVL(
namedParameters.getParameterDefault( param ), Const.NVL( space.getVariable( param ), "" ) ) ) );
} catch ( Exception e ) {
// ignore this
}
}
}
代码示例来源:origin: pentaho/pentaho-kettle
protected void executeSql( String query ) throws Exception {
if ( this.meta == null ) {
throw new KettleException( "No metadata available to determine connection information from." );
}
DatabaseMeta dm = meta.getDatabaseMeta();
String hostname = environmentSubstitute( Const.NVL( dm.getHostname(), "" ) );
String portnum = environmentSubstitute( Const.NVL( dm.getDatabasePortNumberString(), "" ) );
String user = environmentSubstitute( Const.NVL( dm.getUsername(), "" ) );
String password = environmentSubstitute( Const.NVL( dm.getPassword(), "" ) );
String db = environmentSubstitute( Const.NVL( dm.getDatabaseName(), "" ) );
executeSql( query, hostname, Integer.valueOf( portnum ), user, password, db );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
wName.setText( Const.NVL( jobEntry.getName(), "" ) );
wName.getTextWidget().selectAll();
wServer.setText( Const.NVL( jobEntry.getServer(), "" ) );
wPort.setText( Const.NVL( jobEntry.getPort(), "" ) );
wVariable.setText( Const.NVL( jobEntry.getVariableName(), "" ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
logDebug( BaseMessages.getString( PKG, "GetSequenceDialog.Log.GettingKeyInfo" ) );
wValuename.setText( Const.NVL( input.getValuename(), "" ) );
wSlaveServer.setText( Const.NVL( input.getSlaveServerName(), "" ) );
wSeqname.setText( Const.NVL( input.getSequenceName(), "" ) );
wIncrement.setText( Const.NVL( input.getIncrement(), "" ) );
wStepname.selectAll();
wStepname.setFocus();
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Copy information from the meta-data currentMeta to the dialog fields.
*/
public void getData() {
List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams();
wTrueTo.setText( Const.NVL( targetStreams.get( 0 ).getStepname(), "" ) );
wFalseTo.setText( Const.NVL( targetStreams.get( 1 ).getStepname(), "" ) );
wCondition.setText( Const.NVL( input.getCondition(), "" ) );
wStepname.selectAll();
wStepname.setFocus();
}
代码示例来源:origin: pentaho/pentaho-kettle
/**
* Copy information from the meta-data input to the dialog fields.
*/
public void getData() {
List<StreamInterface> targetStreams = input.getStepIOMeta().getTargetStreams();
wTrueTo.setText( Const.NVL( targetStreams.get( 0 ).getStepname(), "" ) );
wFalseTo.setText( Const.NVL( targetStreams.get( 1 ).getStepname(), "" ) );
wStepname.selectAll();
wStepname.setFocus();
}
代码示例来源:origin: pentaho/pentaho-kettle
private static void setCredentials( BasicDataSource ds, DatabaseMeta databaseMeta, String partitionId )
throws KettleDatabaseException {
String userName = databaseMeta.environmentSubstitute( databaseMeta.getUsername() );
String password = databaseMeta.environmentSubstitute( databaseMeta.getPassword() );
password = Encr.decryptPasswordOptionallyEncrypted( password );
ds.addConnectionProperty( "user", Const.NVL( userName, "" ) );
ds.addConnectionProperty( "password", Const.NVL( password, "" ) );
}
代码示例来源:origin: pentaho/pentaho-kettle
public void dataNodeToElement( DataNode rootNode, RepositoryElementInterface element ) throws KettleException {
PartitionSchema partitionSchema = (PartitionSchema) element;
partitionSchema.setDynamicallyDefined( rootNode.getProperty( PROP_DYNAMIC_DEFINITION ).getBoolean() );
partitionSchema.setNumberOfPartitionsPerSlave( getString( rootNode, PROP_PARTITIONS_PER_SLAVE ) );
// Also, load all the properties we can find...
DataNode attrNode = rootNode.getNode( NODE_ATTRIBUTES );
long partitionSchemaSize = attrNode.getProperty( PROP_NB_PARTITION_SCHEMA ).getLong();
for ( int i = 0; i < partitionSchemaSize; i++ ) {
DataProperty property = attrNode.getProperty( String.valueOf( i ) );
partitionSchema.getPartitionIDs().add( Const.NVL( property.getString(), "" ) );
}
}
代码示例来源:origin: pentaho/pentaho-kettle
public static String getModification( ReportSubjectLocation filename ) throws KettleException {
Date date = null;
String user = null;
if ( filename.isTransformation() ) {
date = TransformationInformation.getInstance().getTransMeta( filename ).getModifiedDate();
user = TransformationInformation.getInstance().getTransMeta( filename ).getModifiedUser();
} else {
date = JobInformation.getInstance().getJobMeta( filename ).getModifiedDate();
user = JobInformation.getInstance().getJobMeta( filename ).getModifiedUser();
}
return Const.NVL( XMLHandler.date2string( date ), "-" ) + " by " + Const.NVL( user, "-" );
}
代码示例来源:origin: pentaho/pentaho-kettle
@BeforeClass
public static void beforeClass() throws KettleException {
PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() );
PluginRegistry.init();
String passwordEncoderPluginID =
Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" );
Encr.init( passwordEncoderPluginID );
}
代码示例来源:origin: pentaho/pentaho-kettle
@BeforeClass
public static void beforeClass() throws KettleException {
PluginRegistry.addPluginType( TwoWayPasswordEncoderPluginType.getInstance() );
PluginRegistry.init();
String passwordEncoderPluginID =
Const.NVL( EnvUtil.getSystemProperty( Const.KETTLE_PASSWORD_ENCODER_PLUGIN ), "Kettle" );
Encr.init( passwordEncoderPluginID );
}
内容来源于网络,如有侵权,请联系作者删除!