@Test public void checkGetEntityTypeByEdmTypeReturnNullOnUnkown() throws ODataJPAModelException { final EdmEntityType type = mock(EdmEntityType.class); when(type.getNamespace()).thenReturn("com.sap.olingo.jpa"); when(type.getName()).thenReturn("Unknown"); assertNull(cut.getEntity(type)); }
@Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; }
IntermediateServiceDocument implements JPAServiceDocument { @Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; } }
IntermediateServiceDocument implements JPAServiceDocument { @Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; } IntermediateServiceDocument(final String namespace, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName);   IntermediateServiceDocument(final JPAEdmNameBuilder nameBuilder, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName); }
IntermediateServiceDocument implements JPAServiceDocument { @Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; } IntermediateServiceDocument(final String namespace, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName);   IntermediateServiceDocument(final JPAEdmNameBuilder nameBuilder, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName); @Override List<CsdlSchema> getAllSchemas(); @Override CsdlEntityContainer getEdmEntityContainer(); @Override List<CsdlSchema> getEdmSchemas(); @Override JPAEntityType getEntity(final EdmType edmType); @Override JPAEntityType getEntity(final Class<?> entityClass); @Override JPAStructuredType getComplexType(final EdmComplexType edmType); @Override JPAEntityType getEntity(final FullQualifiedName typeName); @Override JPAEntityType getEntity(final String edmEntitySetName); @Override JPAEntitySet getEntitySet(final JPAEntityType entityType); @Override JPAFunction getFunction(final EdmFunction function); @Override JPAAction getAction(final EdmAction action); @Override List<EdmxReference> getReferences(); @Override CsdlTerm getTerm(final FullQualifiedName termName); @Override boolean hasETag(final EdmBindingTarget entitySetOrSingleton); @Override boolean hasMediaETag(final EdmBindingTarget entitySetOrSingleton); @Override JPAEnumerationAttribute getEnumType(final EdmEnumType type); @Override JPAEnumerationAttribute getEnumType(final String fqnAsString); }
IntermediateServiceDocument implements JPAServiceDocument { @Override public JPAEntityType getEntity(final EdmType edmType) throws ODataJPAModelException { final IntermediateSchema schema = schemaListInternalKey.get(edmType.getNamespace()); if (schema != null) return schema.getEntityType(edmType.getName()); return null; } IntermediateServiceDocument(final String namespace, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName);   IntermediateServiceDocument(final JPAEdmNameBuilder nameBuilder, final Metamodel jpaMetamodel,
      final JPAEdmMetadataPostProcessor postProcessor, final String[] packageName); @Override List<CsdlSchema> getAllSchemas(); @Override CsdlEntityContainer getEdmEntityContainer(); @Override List<CsdlSchema> getEdmSchemas(); @Override JPAEntityType getEntity(final EdmType edmType); @Override JPAEntityType getEntity(final Class<?> entityClass); @Override JPAStructuredType getComplexType(final EdmComplexType edmType); @Override JPAEntityType getEntity(final FullQualifiedName typeName); @Override JPAEntityType getEntity(final String edmEntitySetName); @Override JPAEntitySet getEntitySet(final JPAEntityType entityType); @Override JPAFunction getFunction(final EdmFunction function); @Override JPAAction getAction(final EdmAction action); @Override List<EdmxReference> getReferences(); @Override CsdlTerm getTerm(final FullQualifiedName termName); @Override boolean hasETag(final EdmBindingTarget entitySetOrSingleton); @Override boolean hasMediaETag(final EdmBindingTarget entitySetOrSingleton); @Override JPAEnumerationAttribute getEnumType(final EdmEnumType type); @Override JPAEnumerationAttribute getEnumType(final String fqnAsString);  }