Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2013 SAP AG Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. /
 
 package com.sap.core.odata.core.edm.provider;
 
 import java.util.Map;
 

Author(s):
SAP AG
 
 
   private EdmImplProv edm;
   private boolean isDefaultContainer;
 
   public EdmEntityContainerImplProv(final EdmImplProv edmfinal EntityContainerInfo entityContainerthrows EdmException {
     this. = edm;
     this. = entityContainer;
      = new HashMap<StringEdmEntitySet>();
      = entityContainer.isDefaultEntityContainer();
 
     if (entityContainer.getExtendz() != null) {
        = edm.getEntityContainer(entityContainer.getExtendz());
       if ( == null) {
         throw new EdmException(.);
       }
     }
   }
 
   @Override
   public String getName() throws EdmException {
     return .getName();
   }
 
   @Override
   public EdmEntitySet getEntitySet(final String namethrows EdmException {
     EdmEntitySet edmEntitySet = .get(name);
     if (edmEntitySet != null) {
       return edmEntitySet;
     }
 
     EntitySet entitySet;
     try {
       entitySet = ..getEntitySet(.getName(), name);
     } catch (ODataException e) {
       throw new EdmException(.e);
     }
 
     if (entitySet != null) {
       edmEntitySet = createEntitySet(entitySet);
       .put(nameedmEntitySet);
     } else if ( != null) {
       edmEntitySet = .getEntitySet(name);
       if (edmEntitySet != null) {
         .put(nameedmEntitySet);
       }
     }
 
     return edmEntitySet;
   }
 
   @Override
   public EdmFunctionImport getFunctionImport(final String namethrows EdmException {
    EdmFunctionImport edmFunctionImport = .get(name);
    if (edmFunctionImport != null) {
      return edmFunctionImport;
    }
    FunctionImport functionImport;
    try {
      functionImport = ..getFunctionImport(.getName(), name);
    } catch (ODataException e) {
      throw new EdmException(.e);
    }
    if (functionImport != null) {
      edmFunctionImport = createFunctionImport(functionImport);
      .put(nameedmFunctionImport);
    } else if ( != null) {
      edmFunctionImport = .getFunctionImport(name);
      if (edmFunctionImport != null) {
        .put(nameedmFunctionImport);
      }
    }
    return edmFunctionImport;
  }
  public EdmAssociationSet getAssociationSet(final EdmEntitySet sourceEntitySetfinal EdmNavigationProperty navigationPropertythrows EdmException {
    EdmAssociation edmAssociation = navigationProperty.getRelationship();
    String association = edmAssociation.getNamespace() + "." + edmAssociation.getName();
    String entitySetName = sourceEntitySet.getName();
    String entitySetFromRole = navigationProperty.getFromRole();
    String key = entitySetName + ">>" + association + ">>" + entitySetFromRole;
    EdmAssociationSet edmAssociationSet = .get(key);
    if (edmAssociationSet != null) {
      return edmAssociationSet;
    }
    AssociationSet associationSet;
    FullQualifiedName associationFQName = new FullQualifiedName(edmAssociation.getNamespace(), edmAssociation.getName());
    try {
      associationSet = ..getAssociationSet(.getName(), associationFQNameentitySetNameentitySetFromRole);
    } catch (ODataException e) {
      throw new EdmException(.e);
    }
    if (associationSet != null) {
      edmAssociationSet = createAssociationSet(associationSet);
      .put(keyedmAssociationSet);
      return edmAssociationSet;
    } else if ( != null) {
      edmAssociationSet = .getAssociationSet(sourceEntitySetnavigationProperty);
      .put(keyedmAssociationSet);
      return edmAssociationSet;
    } else {
      throw new EdmException(.);
    }
  }
  private EdmEntitySet createEntitySet(final EntitySet entitySetthrows EdmException {
    return new EdmEntitySetImplProv(entitySetthis);
  }
  private EdmFunctionImport createFunctionImport(final FunctionImport functionImportthrows EdmException {
    return new EdmFunctionImportImplProv(functionImportthis);
  }
  private EdmAssociationSet createAssociationSet(final AssociationSet associationSetthrows EdmException {
    return new EdmAssociationSetImplProv(associationSetthis);
  }
  public boolean isDefaultEntityContainer() {
    return ;
  }
  public EdmAnnotations getAnnotations() throws EdmException {
  }
New to GrepCode? Check out our FAQ X