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


Java DescribeGlobalResult.getSobjects方法代码示例

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


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

示例1: fillCacheTableOfGetTables

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
@Override
protected void fillCacheTableOfGetTables(String catalog, String schemaPattern, String tableNamePattern,
		String[] types) throws SQLException {
	try {
		// build cache of table info
		final DescribeGlobalResult descResult = ((BlancoSfdcJdbcConnection) conn).getPartnerConnection()
				.describeGlobal();
		for (DescribeGlobalSObjectResult sobjectResult : descResult.getSobjects()) {
			if (sobjectResult.isQueryable() == false) {
				// skip because non queryable.");
				continue;
			}

			final PreparedStatement pstmt = conn.getCacheConnection()
					.prepareStatement("INSERT INTO GMETA_TABLES SET TABLE_NAME = ?, REMARKS = ?");
			try {
				pstmt.setString(1, sobjectResult.getName());
				pstmt.setString(2, sobjectResult.getLabel());
				pstmt.execute();
			} finally {
				pstmt.close();
			}
		}
	} catch (ConnectionException ex) {
		throw new SQLException(ex);
	}
}
 
开发者ID:igapyon,项目名称:blanco-sfdc-jdbc-driver,代码行数:28,代码来源:BlancoSfdcJdbcDatabaseMetaData.java

示例2: generatePartnerOutput

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
public void generatePartnerOutput() throws CommanderException {
    connPool = SfdcConnectionPool.getInstance();

    // prepare XLS output folder
    File outputFolder = new File(tmpConfig.getXlsPath() + "/"
            + tmpConfig.getSourceSfdcConfig().getSystemName());
    if (outputFolder.exists()) {
        deleteDirectory(outputFolder);
    }
    outputFolder.mkdirs();

    commander.info("Generating XLS output.");

    binding = connPool.getBinding(tmpConfig.getSourceSfdcConfig());

    // run the different examples
    DescribeGlobalResult global;
    try {
        global = binding.describeGlobal();
        for (DescribeGlobalSObjectResult objectGlobalResult : global
                .getSobjects()) {
            renderObjectXls(objectGlobalResult, outputFolder);
        }
        commander.info("XLS output successfully generated.");
    } catch (RemoteException e) {
        throw new CommanderException(
                "Could not describe salesforce metadata to render object-schema as xls-file.",
                e);
    }

}
 
开发者ID:jwiesel,项目名称:sfdcCommander,代码行数:32,代码来源:XlsRenderer.java

示例3: getSchemaNames

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
public static List<NamedThing> getSchemaNames(PartnerConnection connection) throws IOException {
    List<NamedThing> returnList = new ArrayList<>();
    DescribeGlobalResult result = null;
    try {
        result = connection.describeGlobal();
    } catch (ConnectionException e) {
        throw new ComponentException(e);
    }
    DescribeGlobalSObjectResult[] objects = result.getSobjects();
    for (DescribeGlobalSObjectResult obj : objects) {
        LOG.debug("module label: " + obj.getLabel() + " name: " + obj.getName());
        returnList.add(new SimpleNamedThing(obj.getName(), obj.getLabel()));
    }
    return returnList;
}
 
开发者ID:Talend,项目名称:components,代码行数:16,代码来源:SalesforceRuntimeCommon.java

示例4: getSchemaNames

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
protected List<NamedThing> getSchemaNames(PartnerConnection connection) throws IOException {
    List<NamedThing> returnList = new ArrayList<>();
    DescribeGlobalResult result = null;
    try {
        result = connection.describeGlobal();
    } catch (ConnectionException e) {
        throw new ComponentException(e);
    }
    DescribeGlobalSObjectResult[] objects = result.getSobjects();
    for (DescribeGlobalSObjectResult obj : objects) {
        LOG.debug("module label: " + obj.getLabel() + " name: " + obj.getName());
        returnList.add(new SimpleNamedThing(obj.getName(), obj.getLabel()));
    }
    return returnList;
}
 
开发者ID:Talend,项目名称:components,代码行数:16,代码来源:SalesforceSourceOrSink.java

示例5: getAllAvailableObjects

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
public String[] getAllAvailableObjects(boolean OnlyQueryableObjects) throws KettleException
{
  DescribeGlobalResult dgr=null;
  List<String> objects = null;
  DescribeGlobalSObjectResult[] sobjectResults=null;
  try  {
	  // Get object
	  dgr = getBinding().describeGlobal();
	  // let's get all objects
      sobjectResults = dgr.getSobjects();
      int nrObjects= dgr.getSobjects().length;
      
      objects = new ArrayList<String>();
      
      for(int i=0; i<nrObjects; i++) {
    	  DescribeGlobalSObjectResult o= dgr.getSobjects(i);
    	  if((OnlyQueryableObjects && o.isQueryable()) || !OnlyQueryableObjects) {
    		  objects.add(o.getName());
    	  }
      }
      return  (String[]) objects.toArray(new String[objects.size()]);
   } catch(Exception e){
	   throw new KettleException(BaseMessages.getString(PKG, "SalesforceInput.Error.GettingModules"),e);
   }finally  {
	   if(dgr!=null) dgr=null;
	   if(objects!=null) {
		   objects.clear();
		   objects=null;
	   }
	   if(sobjectResults!=null) {
		   sobjectResults=null;
	   }
   }
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:35,代码来源:SalesforceConnection.java

示例6: getAllAvailableObjects

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
public String[] getAllAvailableObjects( boolean OnlyQueryableObjects ) throws KettleException {
  DescribeGlobalResult dgr = null;
  List<String> objects = null;
  DescribeGlobalSObjectResult[] sobjectResults = null;
  try {
    // Get object
    dgr = getBinding().describeGlobal();
    // let's get all objects
    sobjectResults = dgr.getSobjects();
    int nrObjects = dgr.getSobjects().length;

    objects = new ArrayList<String>();

    for ( int i = 0; i < nrObjects; i++ ) {
      DescribeGlobalSObjectResult o = dgr.getSobjects()[i];
      if ( ( OnlyQueryableObjects && o.isQueryable() ) || !OnlyQueryableObjects ) {
        objects.add( o.getName() );
      }
    }
    return objects.toArray( new String[objects.size()] );
  } catch ( Exception e ) {
    throw new KettleException( BaseMessages.getString( PKG, "SalesforceInput.Error.GettingModules" ), e );
  } finally {
    if ( dgr != null ) {
      dgr = null;
    }
    if ( objects != null ) {
      objects.clear();
      objects = null;
    }
    if ( sobjectResults != null ) {
      sobjectResults = null;
    }
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:36,代码来源:SalesforceConnection.java

示例7: populateFieldTrip

import com.sforce.soap.partner.DescribeGlobalResult; //导入方法依赖的package包/类
protected void populateFieldTrip() throws Exception {
	String fieldTripObjectName = "Field_Trip__Object_Analysis__c";
	Boolean hasFieldTrip = false;
	
	// Make the describeGlobal() call
	DescribeGlobalResult describeGlobalResult = partnerConnection.describeGlobal();

	// Get the sObjects from the describe global result
	DescribeGlobalSObjectResult[] sobjectResults = describeGlobalResult.getSobjects();
	for (DescribeGlobalSObjectResult sobjectResult : sobjectResults) {
		if(sobjectResult.getName().equals(fieldTripObjectName)) {
			hasFieldTrip = true;
			break;
		}
	}
	
	if (hasFieldTrip) {
		String objectQuery = "SELECT Field_Trip__Last_Analyzed__c,Field_Trip__Object_Label__c,Field_Trip__Object_Name__c,Id,Name FROM Field_Trip__Object_Analysis__c WHERE Field_Trip__Object_Name__c = '" +
				objectName + "' AND Field_Trip__Last_Analyzed__c != null ORDER BY Field_Trip__Last_Analyzed__c DESC NULLS LAST";
		com.sforce.soap.partner.QueryResult objectQueryResult = partnerConnection.query(objectQuery);
		com.sforce.soap.partner.sobject.SObject[] objectRecords = objectQueryResult.getRecords();
		if (objectRecords != null && objectRecords.length > 0) {
			// Use the first one
			com.sforce.soap.partner.sobject.SObject objectAnalysis = objectRecords[0];
			String objectAnalysisId = objectAnalysis.getId();
			
			String fieldQuery = "SELECT Field_Trip__Populated_On_Percent__c,Field_Trip__Populated_On__c,Id,Name FROM Field_Trip__Field_Analysis__c WHERE Field_Trip__Object_Analysis__c = '" +
					objectAnalysisId + "'";
			com.sforce.soap.partner.QueryResult fieldQueryResult = partnerConnection.query(fieldQuery);
			com.sforce.soap.partner.sobject.SObject[] fieldRecords = fieldQueryResult.getRecords();
			for (com.sforce.soap.partner.sobject.SObject fieldAnalysis : fieldRecords) {
				String fieldName = (String) fieldAnalysis.getField("Name");
				ObjectField field = objectFieldMap.get(fieldName.toLowerCase());
				if (field != null) {
					Double numberPopulated = new Double((String) fieldAnalysis.getField("Field_Trip__Populated_On__c"));
					field.numberPopulated = numberPopulated.intValue();
					Double percentPopulated = new Double((String) fieldAnalysis.getField("Field_Trip__Populated_On_Percent__c"));
					field.percentPopulated = percentPopulated.doubleValue();
				}
			}
			
			
		}
		
	}
}
 
开发者ID:YBS,项目名称:YBS-SFDC-Build,代码行数:47,代码来源:DocumentObjectFields.java


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