@Test public void testAssociationCache() throws EdmException { assertEquals(edm.getAssociation("foo", "bar"), edm.getAssociation("foo", "bar")); assertNotSame(edm.getAssociation("foo", "bar"), edm.getAssociation("bar", "foo")); }
@Override public EdmAssociation getAssociation(final String namespaceOrAlias, final String name) throws EdmException { String finalNamespace = getNamespaceForAlias(namespaceOrAlias); FullQualifiedName fqName = new FullQualifiedName(finalNamespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation = createAssociation(fqName); if (edmAssociation != null) { edmAssociations.put(fqName, edmAssociation); } } catch (EdmException e) { throw e; } catch (ODataException e) { throw new EdmException(EdmException.COMMON, e); } return edmAssociation; }
EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespaceOrAlias, final String name) throws EdmException { String finalNamespace = getNamespaceForAlias(namespaceOrAlias); FullQualifiedName fqName = new FullQualifiedName(finalNamespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation = createAssociation(fqName); if (edmAssociation != null) { edmAssociations.put(fqName, edmAssociation); } } catch (EdmException e) { throw e; } catch (ODataException e) { throw new EdmException(EdmException.COMMON, e); } return edmAssociation; } }
EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespaceOrAlias, final String name) throws EdmException { String finalNamespace = getNamespaceForAlias(namespaceOrAlias); FullQualifiedName fqName = new FullQualifiedName(finalNamespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation = createAssociation(fqName); if (edmAssociation != null) { edmAssociations.put(fqName, edmAssociation); } } catch (EdmException e) { throw e; } catch (ODataException e) { throw new EdmException(EdmException.COMMON, e); } return edmAssociation; } EdmImpl(final EdmServiceMetadata edmServiceMetadata); }
EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespaceOrAlias, final String name) throws EdmException { String finalNamespace = getNamespaceForAlias(namespaceOrAlias); FullQualifiedName fqName = new FullQualifiedName(finalNamespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation = createAssociation(fqName); if (edmAssociation != null) { edmAssociations.put(fqName, edmAssociation); } } catch (EdmException e) { throw e; } catch (ODataException e) { throw new EdmException(EdmException.COMMON, e); } return edmAssociation; } EdmImpl(final EdmServiceMetadata edmServiceMetadata); @Override EdmEntityContainer getEntityContainer(final String name); @Override EdmEntityType getEntityType(final String namespaceOrAlias, final String name); @Override EdmComplexType getComplexType(final String namespaceOrAlias, final String name); @Override EdmAssociation getAssociation(final String namespaceOrAlias, final String name); @Override EdmServiceMetadata getServiceMetadata(); @Override EdmEntityContainer getDefaultEntityContainer(); @Override List<EdmEntitySet> getEntitySets(); @Override List<EdmFunctionImport> getFunctionImports(); }
EdmImpl implements Edm { @Override public EdmAssociation getAssociation(final String namespaceOrAlias, final String name) throws EdmException { String finalNamespace = getNamespaceForAlias(namespaceOrAlias); FullQualifiedName fqName = new FullQualifiedName(finalNamespace, name); if (edmAssociations.containsKey(fqName)) { return edmAssociations.get(fqName); } EdmAssociation edmAssociation = null; try { edmAssociation = createAssociation(fqName); if (edmAssociation != null) { edmAssociations.put(fqName, edmAssociation); } } catch (EdmException e) { throw e; } catch (ODataException e) { throw new EdmException(EdmException.COMMON, e); } return edmAssociation; } EdmImpl(final EdmServiceMetadata edmServiceMetadata); @Override EdmEntityContainer getEntityContainer(final String name); @Override EdmEntityType getEntityType(final String namespaceOrAlias, final String name); @Override EdmComplexType getComplexType(final String namespaceOrAlias, final String name); @Override EdmAssociation getAssociation(final String namespaceOrAlias, final String name); @Override EdmServiceMetadata getServiceMetadata(); @Override EdmEntityContainer getDefaultEntityContainer(); @Override List<EdmEntitySet> getEntitySets(); @Override List<EdmFunctionImport> getFunctionImports();  }