/** * @param bindingParameterTypeName * @param parameter * @return * @throws ODataException */ private boolean isEntityPreviousTypeCompatibleToBindingParam(final FullQualifiedName bindingParameterTypeName, final CsdlParameter parameter) throws ODataException { return provider.getEntityType(bindingParameterTypeName) != null && provider.getEntityType(bindingParameterTypeName).getBaseTypeFQN() != null && provider.getEntityType(bindingParameterTypeName).getBaseTypeFQN().equals(parameter.getTypeFQN()); }
/** * @param bindingParameterTypeName * @param parameter * @return * @throws ODataException */ private boolean isEntityPreviousTypeCompatibleToBindingParam(final FullQualifiedName bindingParameterTypeName, final CsdlParameter parameter) throws ODataException { return provider.getEntityType(bindingParameterTypeName) != null && provider.getEntityType(bindingParameterTypeName).getBaseTypeFQN() != null && provider.getEntityType(bindingParameterTypeName).getBaseTypeFQN().equals(parameter.getTypeFQN()); }
@Override public EdmEntityType createEntityType(final FullQualifiedName entityTypeName) { try { CsdlEntityType entityType = provider.getEntityType(entityTypeName); if (entityType != null) { return new EdmEntityTypeImpl(this, entityTypeName, entityType); } return null; } catch (ODataException e) { throw new EdmException(e); } }
@Override public EdmEntityType createEntityType(final FullQualifiedName entityTypeName) { try { CsdlEntityType entityType = provider.getEntityType(entityTypeName); if (entityType != null) { if (!isEntityDerivedFromES()) { addAnnotations(entityType, entityTypeName); } return new EdmEntityTypeImpl(this, entityTypeName, entityType); } return null; } catch (ODataException e) { throw new EdmException(e); } }
/** * @param bindingParameterTypeName * @param parameter * @param isBindingParameterCollection * @return * @throws ODataException */ private boolean isComplexPreviousTypeCompatibleToBindingParam( final FullQualifiedName bindingParameterTypeName, final CsdlParameter parameter, Boolean isBindingParameterCollection) throws ODataException { CsdlComplexType complexType = provider.getComplexType(bindingParameterTypeName); if(provider.getEntityType(parameter.getTypeFQN()) == null){ return false; } List<CsdlProperty> properties = provider.getEntityType(parameter.getTypeFQN()).getProperties(); for (CsdlProperty property : properties) { String paramPropertyTypeName = property.getTypeAsFQNObject().getFullQualifiedNameAsString(); if ((complexType != null && complexType.getBaseType() != null && complexType.getBaseTypeFQN().getFullQualifiedNameAsString().equals(paramPropertyTypeName)) || paramPropertyTypeName.equals(bindingParameterTypeName.getFullQualifiedNameAsString()) && isBindingParameterCollection.booleanValue() == property.isCollection()) { return true; } } return false; }
/** * @param bindingParameterTypeName * @param parameter * @param isBindingParameterCollection * @return * @throws ODataException */ private boolean isComplexPreviousTypeCompatibleToBindingParam( final FullQualifiedName bindingParameterTypeName, final CsdlParameter parameter, Boolean isBindingParameterCollection) throws ODataException { CsdlComplexType complexType = provider.getComplexType(bindingParameterTypeName); if(provider.getEntityType(parameter.getTypeFQN()) == null){ return false; } List<CsdlProperty> properties = provider.getEntityType(parameter.getTypeFQN()).getProperties(); for (CsdlProperty property : properties) { String paramPropertyTypeName = property.getTypeAsFQNObject().getFullQualifiedNameAsString(); if ((complexType != null && complexType.getBaseType() != null && complexType.getBaseTypeFQN().getFullQualifiedNameAsString().equals(paramPropertyTypeName)) || paramPropertyTypeName.equals(bindingParameterTypeName.getFullQualifiedNameAsString()) && isBindingParameterCollection.booleanValue() == property.isCollection()) { return true; } } return false; }
/** * @param singleton * @return */ private CsdlEntityType fetchEntityTypeFromSingleton(CsdlSingleton singleton) { CsdlEntityType entityType; try { entityType = singleton.getTypeFQN() != null ? this.provider.getEntityType(new FullQualifiedName( singleton.getTypeFQN().getFullQualifiedNameAsString())) : null; } catch (ODataException e) { throw new EdmException(e); } return entityType; }
/** * @param entitySet * @return */ private CsdlEntityType getCsdlEntityTypeFromEntitySet(CsdlEntitySet entitySet) { CsdlEntityType entityType; try { entityType = entitySet.getTypeFQN() != null ? this.provider.getEntityType(new FullQualifiedName( entitySet.getTypeFQN().getFullQualifiedNameAsString())) : null; } catch (ODataException e) { throw new EdmException(e); } return entityType; }