@Test public void testLoadMappingModel() { VARIANT_MAPPING_FILE = 1; loadMappingModel(); assertTrue(isMappingModelExists()); }
@Override public void loadMappingModel() { InputStream is = null; if (mappingModelExists) { JAXBContext context; try { context = JAXBContext.newInstance(JPAEdmMappingModel.class); Unmarshaller unmarshaller = context.createUnmarshaller(); is = loadMappingModelInputStream(); if (is == null) { mappingModelExists = false; return; } mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); if (mappingModel != null) { mappingModelExists = true; } } catch (JAXBException e) { mappingModelExists = false; ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { } } } }
JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public void loadMappingModel() { InputStream is = null; if (mappingModelExists) { JAXBContext context; try { context = JAXBContext.newInstance(JPAEdmMappingModel.class); Unmarshaller unmarshaller = context.createUnmarshaller(); is = loadMappingModelInputStream(); if (is == null) { mappingModelExists = false; return; } mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); if (mappingModel != null) { mappingModelExists = true; } } catch (JAXBException e) { mappingModelExists = false; ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { } } } } }
JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public void loadMappingModel() { InputStream is = null; if (mappingModelExists) { JAXBContext context; try { context = JAXBContext.newInstance(JPAEdmMappingModel.class); Unmarshaller unmarshaller = context.createUnmarshaller(); is = loadMappingModelInputStream(); if (is == null) { mappingModelExists = false; return; } mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); if (mappingModel != null) { mappingModelExists = true; } } catch (JAXBException e) { mappingModelExists = false; ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { } } } } JPAEdmMappingModelService(final ODataJPAContext ctx); }
JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public void loadMappingModel() { InputStream is = null; if (mappingModelExists) { JAXBContext context; try { context = JAXBContext.newInstance(JPAEdmMappingModel.class); Unmarshaller unmarshaller = context.createUnmarshaller(); is = loadMappingModelInputStream(); if (is == null) { mappingModelExists = false; return; } mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); if (mappingModel != null) { mappingModelExists = true; } } catch (JAXBException e) { mappingModelExists = false; ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { } } } } JPAEdmMappingModelService(final ODataJPAContext ctx); @Override void loadMappingModel(); @Override boolean isMappingModelExists(); @Override JPAEdmMappingModel getJPAEdmMappingModel(); @Override String mapJPAPersistenceUnit(final String persistenceUnitName); @Override String mapJPAEntityType(final String jpaEntityTypeName); @Override String mapJPAEntitySet(final String jpaEntityTypeName); @Override String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName); @Override String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName); @Override String mapJPAEmbeddableType(final String jpaEmbeddableTypeName); @Override String mapJPAEmbeddableTypeAttribute(final String jpaEmbeddableTypeName, final String jpaAttributeName); @Override boolean checkExclusionOfJPAEntityType(final String jpaEntityTypeName); @Override boolean checkExclusionOfJPAAttributeType(final String jpaEntityTypeName, final String jpaAttributeName); @Override boolean checkExclusionOfJPAEmbeddableType(final String jpaEmbeddableTypeName); @Override boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName,
      final String jpaAttributeName); }
JPAEdmMappingModelService implements JPAEdmMappingModelAccess { @Override public void loadMappingModel() { InputStream is = null; if (mappingModelExists) { JAXBContext context; try { context = JAXBContext.newInstance(JPAEdmMappingModel.class); Unmarshaller unmarshaller = context.createUnmarshaller(); is = loadMappingModelInputStream(); if (is == null) { mappingModelExists = false; return; } mappingModel = (JPAEdmMappingModel) unmarshaller.unmarshal(is); if (mappingModel != null) { mappingModelExists = true; } } catch (JAXBException e) { mappingModelExists = false; ODataJPAModelException.throwException(ODataJPAModelException.GENERAL, e); } finally { try { if (is != null) { is.close(); } } catch (IOException e) { } } } } JPAEdmMappingModelService(final ODataJPAContext ctx); @Override void loadMappingModel(); @Override boolean isMappingModelExists(); @Override JPAEdmMappingModel getJPAEdmMappingModel(); @Override String mapJPAPersistenceUnit(final String persistenceUnitName); @Override String mapJPAEntityType(final String jpaEntityTypeName); @Override String mapJPAEntitySet(final String jpaEntityTypeName); @Override String mapJPAAttribute(final String jpaEntityTypeName, final String jpaAttributeName); @Override String mapJPARelationship(final String jpaEntityTypeName, final String jpaRelationshipName); @Override String mapJPAEmbeddableType(final String jpaEmbeddableTypeName); @Override String mapJPAEmbeddableTypeAttribute(final String jpaEmbeddableTypeName, final String jpaAttributeName); @Override boolean checkExclusionOfJPAEntityType(final String jpaEntityTypeName); @Override boolean checkExclusionOfJPAAttributeType(final String jpaEntityTypeName, final String jpaAttributeName); @Override boolean checkExclusionOfJPAEmbeddableType(final String jpaEmbeddableTypeName); @Override boolean checkExclusionOfJPAEmbeddableAttributeType(final String jpaEmbeddableTypeName,
      final String jpaAttributeName);  }