@Test public void testFunctionImportCache() throws EdmException { assertEquals(edmEntityContainer.getFunctionImport("foo"), edmEntityContainer.getFunctionImport("foo")); assertNotSame(edmEntityContainer.getFunctionImport("foo"), edmEntityContainer.getFunctionImport("bar")); }
@Override public EdmFunctionImport getFunctionImport(final String name) throws EdmException { EdmFunctionImport edmFunctionImport = edmFunctionImports.get(name); if (edmFunctionImport != null) { return edmFunctionImport; } FunctionImport functionImport; try { functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name); } catch (ODataException e) { throw new EdmException(EdmException.PROVIDERPROBLEM, e); } if (functionImport != null) { edmFunctionImport = createFunctionImport(functionImport); edmFunctionImports.put(name, edmFunctionImport); } else if (edmExtendedEntityContainer != null) { edmFunctionImport = edmExtendedEntityContainer.getFunctionImport(name); if (edmFunctionImport != null) { edmFunctionImports.put(name, edmFunctionImport); } } return edmFunctionImport; }
EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnotatable { @Override public EdmFunctionImport getFunctionImport(final String name) throws EdmException { EdmFunctionImport edmFunctionImport = edmFunctionImports.get(name); if (edmFunctionImport != null) { return edmFunctionImport; } FunctionImport functionImport; try { functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name); } catch (ODataException e) { throw new EdmException(EdmException.PROVIDERPROBLEM, e); } if (functionImport != null) { edmFunctionImport = createFunctionImport(functionImport); edmFunctionImports.put(name, edmFunctionImport); } else if (edmExtendedEntityContainer != null) { edmFunctionImport = edmExtendedEntityContainer.getFunctionImport(name); if (edmFunctionImport != null) { edmFunctionImports.put(name, edmFunctionImport); } } return edmFunctionImport; } }
EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnotatable { @Override public EdmFunctionImport getFunctionImport(final String name) throws EdmException { EdmFunctionImport edmFunctionImport = edmFunctionImports.get(name); if (edmFunctionImport != null) { return edmFunctionImport; } FunctionImport functionImport; try { functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name); } catch (ODataException e) { throw new EdmException(EdmException.PROVIDERPROBLEM, e); } if (functionImport != null) { edmFunctionImport = createFunctionImport(functionImport); edmFunctionImports.put(name, edmFunctionImport); } else if (edmExtendedEntityContainer != null) { edmFunctionImport = edmExtendedEntityContainer.getFunctionImport(name); if (edmFunctionImport != null) { edmFunctionImports.put(name, edmFunctionImport); } } return edmFunctionImport; } EdmEntityContainerImplProv(final EdmImplProv edm, final EntityContainerInfo entityContainerInfo); }
EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnotatable { @Override public EdmFunctionImport getFunctionImport(final String name) throws EdmException { EdmFunctionImport edmFunctionImport = edmFunctionImports.get(name); if (edmFunctionImport != null) { return edmFunctionImport; } FunctionImport functionImport; try { functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name); } catch (ODataException e) { throw new EdmException(EdmException.PROVIDERPROBLEM, e); } if (functionImport != null) { edmFunctionImport = createFunctionImport(functionImport); edmFunctionImports.put(name, edmFunctionImport); } else if (edmExtendedEntityContainer != null) { edmFunctionImport = edmExtendedEntityContainer.getFunctionImport(name); if (edmFunctionImport != null) { edmFunctionImports.put(name, edmFunctionImport); } } return edmFunctionImport; } EdmEntityContainerImplProv(final EdmImplProv edm, final EntityContainerInfo entityContainerInfo); @Override String getName(); @Override EdmEntitySet getEntitySet(final String name); @Override EdmFunctionImport getFunctionImport(final String name); @Override EdmAssociationSet getAssociationSet(final EdmEntitySet sourceEntitySet,
      final EdmNavigationProperty navigationProperty); @Override boolean isDefaultEntityContainer(); @Override EdmAnnotations getAnnotations(); @Override List<EdmEntitySet> getEntitySets(); @Override List<EdmAssociationSet> getAssociationSets(); @Override String getNamespace(); }
EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnotatable { @Override public EdmFunctionImport getFunctionImport(final String name) throws EdmException { EdmFunctionImport edmFunctionImport = edmFunctionImports.get(name); if (edmFunctionImport != null) { return edmFunctionImport; } FunctionImport functionImport; try { functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name); } catch (ODataException e) { throw new EdmException(EdmException.PROVIDERPROBLEM, e); } if (functionImport != null) { edmFunctionImport = createFunctionImport(functionImport); edmFunctionImports.put(name, edmFunctionImport); } else if (edmExtendedEntityContainer != null) { edmFunctionImport = edmExtendedEntityContainer.getFunctionImport(name); if (edmFunctionImport != null) { edmFunctionImports.put(name, edmFunctionImport); } } return edmFunctionImport; } EdmEntityContainerImplProv(final EdmImplProv edm, final EntityContainerInfo entityContainerInfo); @Override String getName(); @Override EdmEntitySet getEntitySet(final String name); @Override EdmFunctionImport getFunctionImport(final String name); @Override EdmAssociationSet getAssociationSet(final EdmEntitySet sourceEntitySet,
      final EdmNavigationProperty navigationProperty); @Override boolean isDefaultEntityContainer(); @Override EdmAnnotations getAnnotations(); @Override List<EdmEntitySet> getEntitySets(); @Override List<EdmAssociationSet> getAssociationSets(); @Override String getNamespace();  }