Java Code Examples for org.apache.olingo.odata2.api.edm.FullQualifiedName#getNamespace()

The following examples show how to use org.apache.olingo.odata2.api.edm.FullQualifiedName#getNamespace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ODataJPAEdmProvider.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
@Override
public EntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException {

  String strEdmFQName = null;

  if (edmFQName != null) {
    strEdmFQName = edmFQName.toString();
    if (entityTypes.containsKey(strEdmFQName)) {
      return entityTypes.get(strEdmFQName);
    } else if (schemas == null) {
      getSchemas();
    }

    String entityTypeNamespace = edmFQName.getNamespace();
    String entityTypeName = edmFQName.getName();

    for (Schema schema : schemas) {
      String schemaNamespace = schema.getNamespace();
      if (schemaNamespace.equals(entityTypeNamespace)) {
        if (schema.getEntityTypes() == null) {
          return null;
        }
        for (EntityType et : schema.getEntityTypes()) {
          if (et.getName().equals(entityTypeName)) {
            entityTypes.put(strEdmFQName, et);
            return et;
          }
        }
      }
    }
  }

  return null;
}
 
Example 2
Source File: EdmImplProv.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
@Override
protected EdmEntityType createEntityType(final FullQualifiedName fqName) throws ODataException {
  EntityType entityType = edmProvider.getEntityType(fqName);
  if (entityType == null) {
    return null;
  }

  return new EdmEntityTypeImplProv(this, entityType, fqName.getNamespace());
}
 
Example 3
Source File: EdmImplProv.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
@Override
protected EdmComplexType createComplexType(final FullQualifiedName fqName) throws ODataException {
  ComplexType complexType = edmProvider.getComplexType(fqName);
  if (complexType == null) {
    return null;
  }
  return new EdmComplexTypeImplProv(this, complexType, fqName.getNamespace());
}
 
Example 4
Source File: EdmImplProv.java    From olingo-odata2 with Apache License 2.0 5 votes vote down vote up
@Override
protected EdmAssociation createAssociation(final FullQualifiedName fqName) throws ODataException {
  Association association = edmProvider.getAssociation(fqName);
  if (association == null) {
    return null;
  }
  return new EdmAssociationImplProv(this, association, fqName.getNamespace());
}
 
Example 5
Source File: AnnotationEdmProvider.java    From olingo-odata2 with Apache License 2.0 4 votes vote down vote up
public TypeBuilder(final FullQualifiedName fqn) {
  namespace = fqn.getNamespace();
  name = fqn.getName();
}