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


Java Condition.setObjectId方法代码示例

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


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

示例1: saveCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
public ObjectId saveCondition(Condition condition, ObjectId id_condition_parent) throws KettleException
{
	try
	{
		condition.setObjectId( insertCondition( id_condition_parent, condition ) );
		for (int i=0;i<condition.nrConditions();i++)
		{
			Condition subc = condition.getCondition(i);
			repository.saveCondition(subc, condition.getObjectId());
		}
		
		return condition.getObjectId();
	}
	catch(KettleException dbe)
	{
		throw new KettleException("Error saving condition to the repository.", dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:19,代码来源:KettleDatabaseRepositoryConditionDelegate.java

示例2: saveCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
public ObjectId saveCondition( Condition condition, ObjectId id_condition_parent ) throws KettleException {
  try {
    condition.setObjectId( insertCondition( id_condition_parent, condition ) );
    for ( int i = 0; i < condition.nrConditions(); i++ ) {
      Condition subc = condition.getCondition( i );
      repository.saveCondition( subc, condition.getObjectId() );
    }

    return condition.getObjectId();
  } catch ( KettleException dbe ) {
    throw new KettleException( "Error saving condition to the repository.", dbe );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:14,代码来源:KettleDatabaseRepositoryConditionDelegate.java

示例3: loadCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
/**
    *  
 * Read a condition from the repository.
 * @param id_condition The condition id
 * @throws KettleException if something goes wrong.
 */
public Condition loadCondition(ObjectId id_condition) throws KettleException
{
	Condition condition = new Condition();
	
	try
	{
		RowMetaAndData r = getCondition(id_condition);
           if (r!=null)
           {
   			condition.setNegated( r.getBoolean("NEGATED", false));
   			condition.setOperator( Condition.getOperator( r.getString("OPERATOR", null) ) );
   			
   			long conditionId = r.getInteger("ID_CONDITION", -1L);
   			if (conditionId>0) {
   				condition.setObjectId( new LongObjectId(conditionId) );
   			} else {
   				condition.setObjectId( null );
   			}
   			
   			ObjectId subids[] = repository.getSubConditionIDs(condition.getObjectId());
   			if (subids.length==0)
   			{
   				condition.setLeftValuename( r.getString("LEFT_NAME", null) );
   				condition.setFunction( Condition.getFunction( r.getString("CONDITION_FUNCTION", null) ) );
   				condition.setRightValuename( r.getString("RIGHT_NAME", null) );
   				
   				long id_value = r.getInteger("ID_VALUE_RIGHT", -1L);
   				if (id_value>0)
   				{
   					ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId(id_value) );
   					condition.setRightExact( v );
   				}
   			}
   			else
   			{
   				for (int i=0;i<subids.length;i++)
   				{
   					condition.addCondition( loadCondition(subids[i]) );
   				}
   			}
   			
   			return condition;
           }
           else
           {
               throw new KettleException("Condition with id_condition="+id_condition+" could not be found in the repository");
           }
	}
	catch(KettleException dbe)
	{
		throw new KettleException("Error loading condition from the repository (id_condition="+id_condition+")", dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:60,代码来源:KettleDatabaseRepositoryConditionDelegate.java

示例4: loadCondition

import org.pentaho.di.core.Condition; //导入方法依赖的package包/类
/**
 *
 * Read a condition from the repository.
 *
 * @param id_condition
 *          The condition id
 * @throws KettleException
 *           if something goes wrong.
 */
public Condition loadCondition( ObjectId id_condition ) throws KettleException {
  Condition condition = new Condition();

  try {
    RowMetaAndData r = getCondition( id_condition );
    if ( r != null ) {
      condition.setNegated( r.getBoolean( "NEGATED", false ) );
      condition.setOperator( Condition.getOperator( r.getString( "OPERATOR", null ) ) );

      long conditionId = r.getInteger( "ID_CONDITION", -1L );
      if ( conditionId > 0 ) {
        condition.setObjectId( new LongObjectId( conditionId ) );
      } else {
        condition.setObjectId( null );
      }

      ObjectId[] subids = repository.getSubConditionIDs( condition.getObjectId() );
      if ( subids.length == 0 ) {
        condition.setLeftValuename( r.getString( "LEFT_NAME", null ) );
        condition.setFunction( Condition.getFunction( r.getString( "CONDITION_FUNCTION", null ) ) );
        condition.setRightValuename( r.getString( "RIGHT_NAME", null ) );

        long id_value = r.getInteger( "ID_VALUE_RIGHT", -1L );
        if ( id_value > 0 ) {
          ValueMetaAndData v = repository.loadValueMetaAndData( new LongObjectId( id_value ) );
          condition.setRightExact( v );
        }
      } else {
        for ( int i = 0; i < subids.length; i++ ) {
          condition.addCondition( loadCondition( subids[i] ) );
        }
      }

      return condition;
    } else {
      throw new KettleException( "Condition with id_condition="
        + id_condition + " could not be found in the repository" );
    }
  } catch ( KettleException dbe ) {
    throw new KettleException(
      "Error loading condition from the repository (id_condition=" + id_condition + ")", dbe );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:53,代码来源:KettleDatabaseRepositoryConditionDelegate.java


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