}
return result;
}
private void addTable(DescribeGlobalSObjectResult object) throws TranslatorException {
DescribeSObjectResult objectMetadata = null;
try {
objectMetadata = connection.getObjectMetaData(object.getName());
} catch (ResourceException e) {
throw new TranslatorException(e);
}
String name = NameUtil.normalizeName(objectMetadata.getName());
Table table = metadataFactory.addTable(name);
table.setNameInSource(objectMetadata.getName());
tableMap.put(name, table);
getRelationships(objectMetadata);
table.setProperty(TABLE_CUSTOM, String.valueOf(objectMetadata.isCustom()));
table.setProperty(TABLE_SUPPORTS_CREATE, String.valueOf(objectMetadata.isCreateable()));
table.setProperty(TABLE_SUPPORTS_DELETE, String.valueOf(objectMetadata.isDeletable()));
table.setProperty(TABLE_SUPPORTS_MERGE, String.valueOf(objectMetadata.isMergeable()));
table.setProperty(TABLE_SUPPORTS_QUERY, String.valueOf(objectMetadata.isQueryable()));
table.setProperty(TABLE_SUPPORTS_REPLICATE, String.valueOf(objectMetadata.isReplicateable()));
table.setProperty(TABLE_SUPPORTS_RETRIEVE, String.valueOf(objectMetadata.isRetrieveable()));
table.setProperty(TABLE_SUPPORTS_SEARCH, String.valueOf(objectMetadata.isSearchable()));
hasUpdateableColumn = false;
addColumns(objectMetadata, table);
// Some SF objects return true for isUpdateable() but have no updateable columns.
if(hasUpdateableColumn && objectMetadata.isUpdateable()) {
table.setSupportsUpdate(true);
}
}