本文整理汇总了Java中org.pentaho.di.core.Condition.setRightExactID方法的典型用法代码示例。如果您正苦于以下问题:Java Condition.setRightExactID方法的具体用法?Java Condition.setRightExactID怎么用?Java Condition.setRightExactID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.Condition
的用法示例。
在下文中一共展示了Condition.setRightExactID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: insertCondition
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
public synchronized long insertCondition(long id_condition_parent, Condition condition) throws KettleException
{
long id = getNextConditionID();
String tablename = TABLE_R_CONDITION;
RowMetaAndData table = new RowMetaAndData();
table.addValue(new ValueMeta(FIELD_CONDITION_ID_CONDITION, ValueMetaInterface.TYPE_INTEGER), Long.valueOf(id));
table.addValue(new ValueMeta(FIELD_CONDITION_ID_CONDITION_PARENT, ValueMetaInterface.TYPE_INTEGER), Long.valueOf(id_condition_parent));
table.addValue(new ValueMeta(FIELD_CONDITION_NEGATED, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(condition.isNegated()));
table.addValue(new ValueMeta(FIELD_CONDITION_OPERATOR, ValueMetaInterface.TYPE_STRING), condition.getOperatorDesc());
table.addValue(new ValueMeta(FIELD_CONDITION_LEFT_NAME, ValueMetaInterface.TYPE_STRING), condition.getLeftValuename());
table.addValue(new ValueMeta(FIELD_CONDITION_CONDITION_FUNCTION, ValueMetaInterface.TYPE_STRING), condition.getFunctionDesc());
table.addValue(new ValueMeta(FIELD_CONDITION_RIGHT_NAME, ValueMetaInterface.TYPE_STRING), condition.getRightValuename());
long id_value = -1L;
ValueMetaAndData v = condition.getRightExact();
if (v != null)
{
// We have to make sure that all data is saved irrespective of locale differences.
// Here is where we force that
//
ValueMetaInterface valueMeta = v.getValueMeta();
valueMeta.setDecimalSymbol(ValueMetaAndData.VALUE_REPOSITORY_DECIMAL_SYMBOL);
valueMeta.setGroupingSymbol(ValueMetaAndData.VALUE_REPOSITORY_GROUPING_SYMBOL);
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_NUMBER:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_NUMBER_CONVERSION_MASK);
break;
case ValueMetaInterface.TYPE_INTEGER:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_INTEGER_CONVERSION_MASK);
break;
case ValueMetaInterface.TYPE_DATE:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_DATE_CONVERSION_MASK);
break;
default:
break;
}
String stringValue = valueMeta.getString(v.getValueData());
id_value = insertValue(valueMeta.getName(), valueMeta.getTypeDesc(), stringValue, valueMeta.isNull(v.getValueData()), condition.getRightExactID());
condition.setRightExactID(id_value);
}
table.addValue(new ValueMeta(FIELD_CONDITION_ID_VALUE_RIGHT, ValueMetaInterface.TYPE_INTEGER), new Long(id_value));
database.prepareInsert(table.getRowMeta(), tablename);
database.setValuesInsert(table);
database.insertRow();
database.closeInsert();
return id;
}
示例2: insertCondition
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
public synchronized ObjectId insertCondition(ObjectId id_condition_parent, Condition condition) throws KettleException
{
ObjectId id = repository.connectionDelegate.getNextConditionID();
String tablename = KettleDatabaseRepository.TABLE_R_CONDITION;
RowMetaAndData table = new RowMetaAndData();
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION, ValueMetaInterface.TYPE_INTEGER), id);
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION_PARENT, ValueMetaInterface.TYPE_INTEGER), id_condition_parent);
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_NEGATED, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(condition.isNegated()));
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_OPERATOR, ValueMetaInterface.TYPE_STRING), condition.getOperatorDesc());
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_LEFT_NAME, ValueMetaInterface.TYPE_STRING), condition.getLeftValuename());
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_CONDITION_FUNCTION, ValueMetaInterface.TYPE_STRING), condition.getFunctionDesc());
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_RIGHT_NAME, ValueMetaInterface.TYPE_STRING), condition.getRightValuename());
ObjectId id_value = null;
ValueMetaAndData v = condition.getRightExact();
if (v != null)
{
// We have to make sure that all data is saved irrespective of locale differences.
// Here is where we force that
//
ValueMetaInterface valueMeta = v.getValueMeta();
valueMeta.setDecimalSymbol(ValueMetaAndData.VALUE_REPOSITORY_DECIMAL_SYMBOL);
valueMeta.setGroupingSymbol(ValueMetaAndData.VALUE_REPOSITORY_GROUPING_SYMBOL);
switch(valueMeta.getType())
{
case ValueMetaInterface.TYPE_NUMBER:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_NUMBER_CONVERSION_MASK);
break;
case ValueMetaInterface.TYPE_INTEGER:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_INTEGER_CONVERSION_MASK);
break;
case ValueMetaInterface.TYPE_DATE:
valueMeta.setConversionMask(ValueMetaAndData.VALUE_REPOSITORY_DATE_CONVERSION_MASK);
break;
default:
break;
}
String stringValue = valueMeta.getString(v.getValueData());
id_value = insertValue(valueMeta.getName(), valueMeta.getTypeDesc(), stringValue, valueMeta.isNull(v.getValueData()), condition.getRightExactID());
condition.setRightExactID(id_value);
}
table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_CONDITION_ID_VALUE_RIGHT, ValueMetaInterface.TYPE_INTEGER), id_value);
repository.connectionDelegate.getDatabase().prepareInsert(table.getRowMeta(), tablename);
repository.connectionDelegate.getDatabase().setValuesInsert(table);
repository.connectionDelegate.getDatabase().insertRow();
repository.connectionDelegate.getDatabase().closeInsert();
return id;
}
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:55,代码来源:KettleDatabaseRepositoryConditionDelegate.java
示例3: insertCondition
import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
public synchronized ObjectId insertCondition( ObjectId id_condition_parent, Condition condition ) throws KettleException {
ObjectId id = repository.connectionDelegate.getNextConditionID();
String tablename = KettleDatabaseRepository.TABLE_R_CONDITION;
RowMetaAndData table = new RowMetaAndData();
table.addValue( new ValueMetaInteger(
KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION ), id );
table.addValue(
new ValueMetaInteger(
KettleDatabaseRepository.FIELD_CONDITION_ID_CONDITION_PARENT ),
id_condition_parent );
table.addValue( new ValueMetaBoolean(
KettleDatabaseRepository.FIELD_CONDITION_NEGATED ), Boolean
.valueOf( condition.isNegated() ) );
table.addValue( new ValueMetaString(
KettleDatabaseRepository.FIELD_CONDITION_OPERATOR ), condition
.getOperatorDesc() );
table.addValue( new ValueMetaString(
KettleDatabaseRepository.FIELD_CONDITION_LEFT_NAME ), condition
.getLeftValuename() );
table.addValue( new ValueMetaString(
KettleDatabaseRepository.FIELD_CONDITION_CONDITION_FUNCTION ), condition
.getFunctionDesc() );
table.addValue( new ValueMetaString(
KettleDatabaseRepository.FIELD_CONDITION_RIGHT_NAME ), condition
.getRightValuename() );
ObjectId id_value = null;
ValueMetaAndData v = condition.getRightExact();
if ( v != null ) {
// We have to make sure that all data is saved irrespective of locale differences.
// Here is where we force that
//
ValueMetaInterface valueMeta = v.getValueMeta();
valueMeta.setDecimalSymbol( ValueMetaAndData.VALUE_REPOSITORY_DECIMAL_SYMBOL );
valueMeta.setGroupingSymbol( ValueMetaAndData.VALUE_REPOSITORY_GROUPING_SYMBOL );
switch ( valueMeta.getType() ) {
case ValueMetaInterface.TYPE_NUMBER:
valueMeta.setConversionMask( ValueMetaAndData.VALUE_REPOSITORY_NUMBER_CONVERSION_MASK );
break;
case ValueMetaInterface.TYPE_INTEGER:
valueMeta.setConversionMask( ValueMetaAndData.VALUE_REPOSITORY_INTEGER_CONVERSION_MASK );
break;
case ValueMetaInterface.TYPE_DATE:
valueMeta.setConversionMask( ValueMetaAndData.VALUE_REPOSITORY_DATE_CONVERSION_MASK );
break;
default:
break;
}
String stringValue = valueMeta.getString( v.getValueData() );
id_value =
insertValue( valueMeta.getName(), valueMeta.getTypeDesc(), stringValue, valueMeta.isNull( v
.getValueData() ), condition.getRightExactID() );
condition.setRightExactID( id_value );
}
table.addValue( new ValueMetaInteger(
KettleDatabaseRepository.FIELD_CONDITION_ID_VALUE_RIGHT ), id_value );
repository.connectionDelegate.getDatabase().prepareInsert( table.getRowMeta(), tablename );
repository.connectionDelegate.getDatabase().setValuesInsert( table );
repository.connectionDelegate.getDatabase().insertRow();
repository.connectionDelegate.getDatabase().closeInsert();
return id;
}