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


Java DatabaseMeta.getObjectId方法代码示例

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


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

示例1: saveDatabaseMetaStepAttribute

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * This method saves the object ID of the database object (if not null) in the step attributes
 * @param id_transformation
 * @param id_step
 * @param string
 * @param database
 */
public void saveDatabaseMetaStepAttribute(ObjectId id_transformation, ObjectId id_step, String code, 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();
		saveStepAttribute(id_transformation, id_step, code, id_database);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:16,代码来源:KettleDatabaseRepository.java

示例2: saveDatabaseMetaJobEntryAttribute

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * This method saves the object ID of the database object (if not null) in the step attributes
 * @param id_transformation
 * @param id_step
 * @param linkCode
 * @param nameCode
 * @param idCode
 * @param database
 */
public void saveDatabaseMetaJobEntryAttribute(ObjectId id_job, ObjectId id_jobentry, 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, idCode, id_database);
		saveJobEntryAttribute(id_job, id_jobentry, nameCode, id_database);
		
		insertJobEntryDatabase(id_job, id_jobentry, id);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:24,代码来源:KettleDatabaseRepository.java

示例3: setDatabaseMeta

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
public void setDatabaseMeta(DatabaseMeta dbMeta){
  databaseMeta = dbMeta;
  databaseMetaObjectId = dbMeta.getObjectId();
  if (dbMeta != null) {
    databaseName = databaseMeta.getName();
  }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:8,代码来源:XulDatabaseDialog.java

示例4: saveDatabaseMeta

import org.pentaho.di.core.database.DatabaseMeta; //导入方法依赖的package包/类
/**
 * Saves the database information into a given repository.
 * 
 * @param databaseMeta The database metadata object to store
 * 
 * @throws KettleException if an error occurs.
 */
public void saveDatabaseMeta(DatabaseMeta databaseMeta) throws KettleException
{
	try
	{
           // If we don't have an ID, we don't know which entry in the database we need to update.
		// See if a database with the same name is already available...
		if (databaseMeta.getObjectId()==null)
		{
			databaseMeta.setObjectId(getDatabaseID(databaseMeta.getName()));
		}
		
		// Still not found? --> Insert
		if (databaseMeta.getObjectId()==null)
		{
			// Insert new Note in repository
			//
			databaseMeta.setObjectId(insertDatabase(databaseMeta.getName(), 
										databaseMeta.getPluginId(), 
										DatabaseMeta.getAccessTypeDesc(databaseMeta.getAccessType()), 
										databaseMeta.getHostname(), 
										databaseMeta.getDatabaseName(), 
										databaseMeta.getDatabasePortNumberString(), 
										databaseMeta.getUsername(), 
										databaseMeta.getPassword(),
										databaseMeta.getServername(),
										databaseMeta.getDataTablespace(),
										databaseMeta.getIndexTablespace()
									)
				); 
		}
		else // --> found entry with the same name...
		{
			// Update the note...
			updateDatabase(	databaseMeta.getObjectId(),
					databaseMeta.getName(), 
										databaseMeta.getPluginId(), 
										DatabaseMeta.getAccessTypeDesc(databaseMeta.getAccessType()), 
										databaseMeta.getHostname(), 
										databaseMeta.getDatabaseName(), 
										databaseMeta.getDatabasePortNumberString(), 
										databaseMeta.getUsername(), 
										databaseMeta.getPassword(),
										databaseMeta.getServername(),
										databaseMeta.getDataTablespace(),
										databaseMeta.getIndexTablespace()
									);
		}
           
           // For the extra attributes, just delete them and re-add them.
           delDatabaseAttributes(databaseMeta.getObjectId());
           
           // OK, now get a list of all the attributes set on the database connection...
           // 
           Properties attributes = databaseMeta.getAttributes();
           Enumeration<Object> keys = databaseMeta.getAttributes().keys();
           while (keys.hasMoreElements())
           {
               String code = (String) keys.nextElement();
               String attribute = (String)attributes.get(code);
               
               // Save this attribute
               //
               insertDatabaseAttribute(databaseMeta.getObjectId(), code, attribute);
           }
	}
	catch(KettleDatabaseException dbe)
	{
		throw new KettleException("Error saving database connection or one of its attributes to the repository.", dbe);
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:78,代码来源:KettleDatabaseRepositoryDatabaseDelegate.java


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