@Test public void testEscaping() { FullyQualifiedName fqn = new FullyQualifiedName("a", "b"); fqn.append("hello world", "/value").append("other?", "1"); assertEquals("a=b/hello+world=%2Fvalue/other%3F=1", fqn.toString()); }
table.setSupportsUpdate(true); if (parent != null) { FullyQualifiedName rn = new FullyQualifiedName("embedded", tableName); //$NON-NLS-1$ String parentfqn = parent.getProperty(FQN, false); table.setProperty(FQN, parentfqn + FullyQualifiedName.SEPARATOR + rn.toString()); } else { FullyQualifiedName fqn = new FullyQualifiedName("collection", tableName); //$NON-NLS-1$ table.setProperty(FQN, fqn.toString());
public FullyQualifiedName(String name, String value) { super(); append(name, value); }
/** * Adds new table to metadata. * * @param spreadsheet Name of the spreadsheet * @param worksheet Name of the worksheet * @throws TranslatorException */ private void addTable(MetadataFactory mf, Worksheet worksheet) { if (worksheet.getColumnCount() == 0){ return; } Table table = mf.addTable(worksheet.getName()); table.setProperty(FQN, new FullyQualifiedName("worksheet", worksheet.getName()).toString()); //$NON-NLS-1$ table.setNameInSource(worksheet.getName()); if (worksheet.isHeaderEnabled()) { table.setSupportsUpdate(true); } addColumnsToTable(mf, table, worksheet); }
/** * * @param metadataFactory * @param tableCatalog * @param tableSchema * @param tableName * @param remarks * @param fullName * @return */ protected Table addTable(MetadataFactory metadataFactory, String tableCatalog, String tableSchema, String tableName, String remarks, String fullName) { Table table = metadataFactory.addTable(useFullSchemaName?fullName:tableName); table.setNameInSource(getFullyQualifiedName(tableCatalog, tableSchema, tableName, true)); //create a fqn for the table FullyQualifiedName fqn = new FullyQualifiedName(); if (tableCatalog != null && !tableCatalog.isEmpty()) { fqn.append(getCatalogTerm(), tableCatalog); } if (tableSchema != null && !tableSchema.isEmpty()) { fqn.append(getSchemaTerm(), tableSchema); } fqn.append(getTableTerm(), tableName); table.setProperty(FQN, fqn.toString()); table.setSupportsUpdate(true); table.setAnnotation(remarks); return table; }
private void addTable(DescribeGlobalSObjectResult objectMetadata) { String name = objectMetadata.getName(); if (normalizeNames) { name = NameUtil.normalizeName(name); } if (!allowedToAdd(name)) { return; } Table table = metadataFactory.addTable(name); FullyQualifiedName fqn = new FullyQualifiedName("sobject", objectMetadata.getName()); //$NON-NLS-1$ table.setProperty(FQN, fqn.toString()); table.setNameInSource(objectMetadata.getName()); tableMap.put(objectMetadata.getName(), table); 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())); }
FullyQualifiedName fqn = new FullyQualifiedName("entity container", container.getName()==null?"default":container.getName()); //$NON-NLS-1$ //$NON-NLS-2$ fqn.append("entity set", entitySet.getName()); //$NON-NLS-1$ t.setProperty(FQN, fqn.toString()); FullyQualifiedName fqn = new FullyQualifiedName("entity container", container.getName()==null?"default":container.getName()); //$NON-NLS-1$ //$NON-NLS-2$ fqn.append("singleton", singleton.getName()); //$NON-NLS-1$ t.setProperty(FQN, fqn.toString());
toTable.setProperty(FQN, parent + FullyQualifiedName.SEPARATOR + new FullyQualifiedName("contained", property.getName()).toString()); //$NON-NLS-1$ } else { toTable = addNavigationAsTable(mf, metadata, fromTable, property); String parent = fromTable.getProperty(FQN, false); toTable.setProperty(FQN, parent + FullyQualifiedName.SEPARATOR + new FullyQualifiedName().append("self join", property.getName()).toString()); //$NON-NLS-1$
Table childTable = buildTable(mf, tableName); String parent = parentTable.getProperty(FQN, false); childTable.setProperty(FQN, parent + FullyQualifiedName.SEPARATOR + new FullyQualifiedName("complex property", parentProperty.getName()).toString()); //$NON-NLS-1$