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


Java LongObjectId类代码示例

本文整理汇总了Java中org.pentaho.di.repository.LongObjectId的典型用法代码示例。如果您正苦于以下问题:Java LongObjectId类的具体用法?Java LongObjectId怎么用?Java LongObjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: getJobsWithIDList

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public String[] getJobsWithIDList(List<Object[]> list, RowMetaInterface rowMeta) throws KettleException
{
    String[] jobList = new String[list.size()];
    for (int i=0;i<list.size();i++)
    {
        long id_job = rowMeta.getInteger( list.get(i), quote(KettleDatabaseRepository.FIELD_JOB_ID_JOB), -1L); 
        if (id_job > 0)
        {
        	 RowMetaAndData jobRow =  getJob(new LongObjectId(id_job));
             if (jobRow!=null)
             {
                 String jobName = jobRow.getString(KettleDatabaseRepository.FIELD_JOB_NAME, "<name not found>");
                 long id_directory = jobRow.getInteger(KettleDatabaseRepository.FIELD_JOB_ID_DIRECTORY, -1L);
                 RepositoryDirectoryInterface dir = repository.loadRepositoryDirectoryTree().findDirectory(new LongObjectId(id_directory)); // always reload the directory tree!
                 
                 jobList[i]=dir.getPathObjectCombination(jobName);
             }
        }            
    }

    return jobList;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:KettleDatabaseRepositoryJobDelegate.java

示例2: getIDWithValue

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public synchronized ObjectId getIDWithValue(String tablename, String idfield, String lookupkey[], ObjectId key[]) throws KettleException
{
	RowMetaAndData par = new RowMetaAndData();
	String sql = "SELECT " + idfield + " FROM " + tablename + " ";

	for (int i = 0; i < lookupkey.length; i++)
	{
		if (i == 0)
			sql += "WHERE ";
		else
			sql += "AND   ";
		par.addValue(new ValueMeta(lookupkey[i], ValueMetaInterface.TYPE_INTEGER), new LongObjectId(key[i]));
		sql += lookupkey[i] + " = ? ";
	}
	RowMetaAndData result = getOneRow(sql, par.getRowMeta(), par.getData());
	if (result != null && result.getRowMeta() != null && result.getData() != null && result.isNumeric(0)) {
		return new LongObjectId(result.getInteger(0, 0));
	}
	return null;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:21,代码来源:KettleDatabaseRepositoryConnectionDelegate.java

示例3: loadTransDependency

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public TransDependency loadTransDependency(ObjectId id_dependency, List<DatabaseMeta> databases) throws KettleException
{
	TransDependency transDependency = new TransDependency();
	
	try
	{
		transDependency.setObjectId(id_dependency);
		
		RowMetaAndData r = getTransDependency(id_dependency);
		
		if (r!=null)
		{
			long id_connection = r.getInteger("ID_DATABASE", 0); //$NON-NLS-1$
			transDependency.setDatabase( DatabaseMeta.findDatabase(databases, new LongObjectId(id_connection)) );
			transDependency.setTablename(  r.getString("TABLE_NAME", null) ); //$NON-NLS-1$
			transDependency.setFieldname( r.getString("FIELD_NAME", null) ); //$NON-NLS-1$
		}
		
		return transDependency;
	}
	catch(KettleException dbe)
	{
		throw new KettleException(BaseMessages.getString(PKG, "TransDependency.Exception.UnableToLoadTransformationDependency")+id_dependency, dbe); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:26,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例4: getTransformationsWithIDList

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public String[] getTransformationsWithIDList(List<Object[]> list, RowMetaInterface rowMeta) throws KettleException
{
    String[] transList = new String[list.size()];
    for (int i=0;i<list.size();i++)
    {
        long id_transformation = rowMeta.getInteger( list.get(i), quote(KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_TRANSFORMATION), -1L); 
        if (id_transformation > 0)
        {
            RowMetaAndData transRow =  getTransformation(new LongObjectId(id_transformation));
            if (transRow!=null)
            {
                String transName = transRow.getString(KettleDatabaseRepository.FIELD_TRANSFORMATION_NAME, "<name not found>");
                long id_directory = transRow.getInteger(KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_DIRECTORY, -1L);
                RepositoryDirectoryInterface dir = repository.loadRepositoryDirectoryTree().findDirectory(new LongObjectId(id_directory));
                
                transList[i]=dir.getPathObjectCombination(transName);
            }
        }            
    }

    return transList;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:23,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例5: lookupValue

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public synchronized ObjectId lookupValue(String name, String type, String value_str, boolean isnull) throws KettleException
{
	RowMetaAndData table = new RowMetaAndData();
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_VALUE_NAME, ValueMetaInterface.TYPE_STRING), name);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_VALUE_VALUE_TYPE, ValueMetaInterface.TYPE_STRING), type);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_VALUE_VALUE_STR, ValueMetaInterface.TYPE_STRING), value_str);
	table.addValue(new ValueMeta(KettleDatabaseRepository.FIELD_VALUE_IS_NULL, ValueMetaInterface.TYPE_BOOLEAN), Boolean.valueOf(isnull));

	String sql = "SELECT " + quote(KettleDatabaseRepository.FIELD_VALUE_ID_VALUE) + " FROM " + quoteTable(KettleDatabaseRepository.TABLE_R_VALUE) + " ";
	sql += "WHERE " + quote(KettleDatabaseRepository.FIELD_VALUE_NAME) + "       = ? ";
	sql += "AND   " + quote(KettleDatabaseRepository.FIELD_VALUE_VALUE_TYPE) + " = ? ";
	sql += "AND   " + quote(KettleDatabaseRepository.FIELD_VALUE_VALUE_STR) + "  = ? ";
	sql += "AND   " + quote(KettleDatabaseRepository.FIELD_VALUE_IS_NULL) + "    = ? ";

	RowMetaAndData result = repository.connectionDelegate.getOneRow(sql, table.getRowMeta(), table.getData());
	if (result != null && result.getData()!=null && result.isNumeric(0))
		return new LongObjectId( result.getInteger(0, 0L) );
	else
		return null;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:21,代码来源:KettleDatabaseRepositoryConditionDelegate.java

示例6: loadJobEntryBase

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public void loadJobEntryBase(JobEntryBase jobEntryBase, ObjectId id_jobentry, List<DatabaseMeta> databases, List<SlaveServer> slaveServers) throws KettleException {
	try {
		RowMetaAndData r = getJobEntry(id_jobentry);
		if (r != null) {
			jobEntryBase.setName(r.getString("NAME", null));

			jobEntryBase.setDescription(r.getString("DESCRIPTION", null));
			long id_jobentry_type = r.getInteger("ID_JOBENTRY_TYPE", 0);
			RowMetaAndData jetrow = getJobEntryType(new LongObjectId(id_jobentry_type) );
			if (jetrow != null) {
				jobEntryBase.setPluginId(jetrow.getString("CODE", null));
			}
		}
	} catch (KettleDatabaseException dbe) {
		throw new KettleException("Unable to load base job entry information from the repository for id_jobentry=" + id_jobentry, dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:KettleDatabaseRepositoryJobEntryDelegate.java

示例7: getTransAttributesWithPrefix

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public synchronized List<Object[]> getTransAttributesWithPrefix( ObjectId id_transformation, String codePrefix ) throws KettleException {
  String sql =
    "SELECT *"
      + " FROM "
      + databaseMeta
        .getQuotedSchemaTableCombination( null, KettleDatabaseRepository.TABLE_R_TRANS_ATTRIBUTE )
      + " WHERE " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_ID_TRANSFORMATION ) + " = ?"
      + " AND " + quote( KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_CODE ) + " LIKE '" + codePrefix
      + "%'";

  RowMetaAndData table = new RowMetaAndData();
  table.addValue(
    new ValueMetaInteger(
      KettleDatabaseRepository.FIELD_TRANS_ATTRIBUTE_ID_TRANSFORMATION ),
    new LongObjectId( id_transformation ) );
  return callRead( () -> database.getRows( sql, table.getRowMeta(), table.getData(), ResultSet.FETCH_FORWARD, false, 0, null ) );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:18,代码来源:KettleDatabaseRepositoryConnectionDelegate.java

示例8: testInsertTransformationSlave

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
@Test
public void testInsertTransformationSlave() throws KettleException {
  ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass( String.class );
  ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass( RowMetaAndData.class );
  doNothing().when( repo.connectionDelegate ).insertTableRow( argumentTableName.capture(), argumentTableData.capture() );
  doReturn( new LongObjectId( 789 ) ).when( repo.connectionDelegate ).getNextTransformationSlaveID();

  ObjectId result = repo.insertTransformationSlave( new LongObjectId( 456 ), new LongObjectId( 123 ) );

  RowMetaAndData insertRecord = argumentTableData.getValue();
  assertEquals( KettleDatabaseRepository.TABLE_R_TRANS_SLAVE, argumentTableName.getValue() );
  assertEquals( 3, insertRecord.size() );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 0 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_TRANS_SLAVE_ID_TRANS_SLAVE, insertRecord.getValueMeta( 0 ).getName() );
  assertEquals( Long.valueOf( 789 ), insertRecord.getInteger( 0 ) );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 1 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_TRANS_SLAVE_ID_TRANSFORMATION, insertRecord.getValueMeta( 1 ).getName() );
  assertEquals( Long.valueOf( 456 ), insertRecord.getInteger( 1 ) );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 2 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_TRANS_SLAVE_ID_SLAVE, insertRecord.getValueMeta( 2 ).getName() );
  assertEquals( Long.valueOf( 123 ), insertRecord.getInteger( 2 ) );
  assertEquals( new LongObjectId( 789 ), result );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:KettleDatabaseRepositoryTest.java

示例9: getElements

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
@Override
public List<IMetaStoreElement> getElements( String namespace, IMetaStoreElementType elementType ) throws MetaStoreException {
  try {
    IMetaStoreElementType type = getElementTypeByName( namespace, elementType.getName() );
    if ( type == null ) {
      return new ArrayList<IMetaStoreElement>();
    }
    Collection<RowMetaAndData> elementRows =
      delegate.getElements( new LongObjectId( new StringObjectId( type.getId() ) ) );
    List<IMetaStoreElement> elements = new ArrayList<IMetaStoreElement>();
    for ( RowMetaAndData elementRow : elementRows ) {
      IMetaStoreElement element = delegate.parseElement( elementType, elementRow );
      elements.add( element );
    }
    return elements;
  } catch ( Exception e ) {
    throw new MetaStoreException( "Unable to get list of elements from namespace '"
      + namespace + "' and for element type '" + elementType.getName() + "'", e );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:21,代码来源:KettleDatabaseRepositoryMetaStore.java

示例10: getNextID

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public synchronized LongObjectId getNextID(String tableName, String fieldName) throws KettleException
{
    String counterName = tableName+"."+fieldName;
    Counter counter = Counters.getInstance().getCounter(counterName);
    if (counter==null)
    {
    	LongObjectId id = getNextTableID(tableName, fieldName);
        counter = new Counter(id.longValue());
        Counters.getInstance().setCounter(counterName, counter);
        return new LongObjectId(counter.next());
    }
    else
    {
        return new LongObjectId(counter.next());
    }
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:17,代码来源:KettleDatabaseRepositoryConnectionDelegate.java

示例11: saveDatabaseMetaJobEntryAttribute

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
/**
 * This method saves the object ID of the database object (if not null) in the step attributes
 *
 * @param id_job
 * @param nr
 * @param id_jobentry
 * @param nameCode
 * @param nameCode
 * @param idCode
 * @param database
 */
public void saveDatabaseMetaJobEntryAttribute( ObjectId id_job, ObjectId id_jobentry, int nr, String nameCode,
  String idCode, DatabaseMeta database ) throws KettleException {
  ObjectId id = null;
  if ( database != null ) {
    id = database.getObjectId();
    Long id_database = id == null ? Long.valueOf( -1L ) : new LongObjectId( id ).longValue();

    // Save both the ID and the name of the database connection...
    //
    saveJobEntryAttribute( id_job, id_jobentry, nr, idCode, id_database );
    saveJobEntryAttribute( id_job, id_jobentry, nr, nameCode, id_database );

    insertJobEntryDatabase( id_job, id_jobentry, id );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:27,代码来源:KettleDatabaseRepository.java

示例12: testInsertJobEntryDatabase

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
@Test
public void testInsertJobEntryDatabase() throws KettleException {
  doReturn( getNullIntegerRow() ).when( repo.connectionDelegate ).getOneRow(
    anyString(), anyString(), any( ObjectId.class ) );
  ArgumentCaptor<String> argumentTableName = ArgumentCaptor.forClass( String.class );
  ArgumentCaptor<RowMetaAndData> argumentTableData = ArgumentCaptor.forClass( RowMetaAndData.class );
  doNothing().when( repo.connectionDelegate ).insertTableRow( argumentTableName.capture(), argumentTableData.capture() );

  repo.insertJobEntryDatabase( new LongObjectId( 234 ), new LongObjectId( 345 ), new LongObjectId( 456 ) );

  RowMetaAndData insertRecord = argumentTableData.getValue();
  assertEquals( KettleDatabaseRepository.TABLE_R_JOBENTRY_DATABASE, argumentTableName.getValue() );
  assertEquals( 3, insertRecord.size() );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 0 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_JOB, insertRecord.getValueMeta( 0 ).getName() );
  assertEquals( Long.valueOf( 234 ), insertRecord.getInteger( 0 ) );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 1 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_JOBENTRY, insertRecord.getValueMeta( 1 ).getName() );
  assertEquals( Long.valueOf( 345 ), insertRecord.getInteger( 1 ) );
  assertEquals( ValueMetaInterface.TYPE_INTEGER, insertRecord.getValueMeta( 2 ).getType() );
  assertEquals( KettleDatabaseRepository.FIELD_JOBENTRY_DATABASE_ID_DATABASE, insertRecord.getValueMeta( 2 ).getName() );
  assertEquals( Long.valueOf( 456 ), insertRecord.getInteger( 2 ) );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:KettleDatabaseRepositoryTest.java

示例13: getTransformationsWithIDList

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public String[] getTransformationsWithIDList( List<Object[]> list, RowMetaInterface rowMeta ) throws KettleException {
  String[] transList = new String[list.size()];
  for ( int i = 0; i < list.size(); i++ ) {
    long id_transformation =
      rowMeta.getInteger(
        list.get( i ), quote( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_TRANSFORMATION ), -1L );
    if ( id_transformation > 0 ) {
      RowMetaAndData transRow = getTransformation( new LongObjectId( id_transformation ) );
      if ( transRow != null ) {
        String transName =
          transRow.getString( KettleDatabaseRepository.FIELD_TRANSFORMATION_NAME, "<name not found>" );
        long id_directory =
          transRow.getInteger( KettleDatabaseRepository.FIELD_TRANSFORMATION_ID_DIRECTORY, -1L );
        RepositoryDirectoryInterface dir =
          repository.loadRepositoryDirectoryTree().findDirectory( new LongObjectId( id_directory ) );

        transList[i] = dir.getPathObjectCombination( transName );
      }
    }
  }

  return transList;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:24,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例14: loadJobEntryBase

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
public void loadJobEntryBase( JobEntryBase jobEntryBase, ObjectId id_jobentry, List<DatabaseMeta> databases,
  List<SlaveServer> slaveServers ) throws KettleException {
  try {
    RowMetaAndData r = getJobEntry( id_jobentry );
    if ( r != null ) {
      jobEntryBase.setName( r.getString( "NAME", null ) );

      jobEntryBase.setDescription( r.getString( "DESCRIPTION", null ) );
      long id_jobentry_type = r.getInteger( "ID_JOBENTRY_TYPE", 0 );
      RowMetaAndData jetrow = getJobEntryType( new LongObjectId( id_jobentry_type ) );
      if ( jetrow != null ) {
        jobEntryBase.setPluginId( jetrow.getString( "CODE", null ) );
      }
    }
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( "Unable to load base job entry information from the repository for id_jobentry="
      + id_jobentry, dbe );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:20,代码来源:KettleDatabaseRepositoryJobEntryDelegate.java

示例15: testLoadRepositoryObjectsNulled

import org.pentaho.di.repository.LongObjectId; //导入依赖的package包/类
@Test
public void testLoadRepositoryObjectsNulled() throws Exception {
  RepositoryDirectory root = new RepositoryDirectory();
  root.setObjectId( new LongObjectId( 0L ) );
  RepositoryDirectory dir = new RepositoryDirectory();
  dir.setObjectId( new LongObjectId( 1L ) );
  root.addSubdirectory( dir );
  RepositoryElementMetaInterface meta = mock( RepositoryElementMetaInterface.class );
  when( meta.getObjectType() ).thenReturn( RepositoryObjectType.TRANSFORMATION );

  Repository repo = mock( Repository.class );
  when( repo.getJobAndTransformationObjects( dir.getObjectId(), false ) ).thenReturn(
      Collections.singletonList( meta ) );
  when( repo.getJobAndTransformationObjects( root.getObjectId(), false ) ).thenReturn( Collections.emptyList() );

  assertTrue( RepositoryDirectoryUI.loadRepositoryObjects( root, true, true, repo ).isEmpty() );
  assertEquals( 1, RepositoryDirectoryUI.loadRepositoryObjects( dir, true, true, repo ).size() );
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:19,代码来源:RepositoryDirectoryUITest.java


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