/** * All functions with the given name * @param name the name * @return a list of functions */ public List<CsdlFunction> getFunctions(final String name) { return getAllByName(name, getFunctions()); }
/** * All functions with the given name * @param name the name * @return a list of functions */ public List<CsdlFunction> getFunctions(final String name) { return getAllByName(name, getFunctions()); }
private List<CsdlFunction> getFunctions(XMLMetadata metadata, String name) throws TranslatorException { if (name.contains(".")) { int idx = name.lastIndexOf('.'); CsdlSchema schema = metadata.getSchema(name.substring(0, idx)); if (schema == null) { throw new TranslatorException(ODataPlugin.Util.gs(ODataPlugin.Event.TEIID17021, name)); } return schema.getFunctions(name.substring(idx+1)); } return getDefaultSchema(metadata).getFunctions(name); }
@Override public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException { CsdlSchema schema = xmlSchemas.get(functionName.getNamespace()); if (schema != null) { return schema.getFunctions(functionName.getName()); } return null; }
@Override public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException { CsdlSchema schema = xmlSchemas.get(functionName.getNamespace()); if (schema != null) { return schema.getFunctions(functionName.getName()); } return null; }
@Override public List<CsdlFunction> getFunctions(FullQualifiedName fqn) throws ODataException { ArrayList<CsdlFunction> foundFuncs = new ArrayList<CsdlFunction>(); CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { List<CsdlFunction> functions = schema.getFunctions(); if (functions != null) { for (CsdlFunction func : functions) { if (func.getName().equals(fqn.getName())) { foundFuncs.add(func); } } } } return foundFuncs; }
protected List<EdmFunction> createFunctions() { final List<EdmFunction> edmFunctions = new ArrayList<EdmFunction>(); final List<CsdlFunction> providerFunctions = schema.getFunctions(); if (providerFunctions != null) { for (CsdlFunction function : providerFunctions) { FullQualifiedName functionName = new FullQualifiedName(namespace, function.getName()); EdmFunctionImpl functionImpl = new EdmFunctionImpl(edm, functionName, function); edmFunctions.add(functionImpl); edm.cacheFunction(functionName, functionImpl); } } return edmFunctions; }
protected List<EdmFunction> createFunctions() { final List<EdmFunction> edmFunctions = new ArrayList<EdmFunction>(); final List<CsdlFunction> providerFunctions = schema.getFunctions(); if (providerFunctions != null) { for (CsdlFunction function : providerFunctions) { FullQualifiedName functionName = new FullQualifiedName(namespace, function.getName()); EdmFunctionImpl functionImpl = new EdmFunctionImpl(edm, functionName, function); edmFunctions.add(functionImpl); edm.cacheFunction(functionName, functionImpl); } } return edmFunctions; }
@Override public List<CsdlFunction> getFunctions(FullQualifiedName fqn) throws ODataException { ArrayList<CsdlFunction> foundFuncs = new ArrayList<CsdlFunction>(); CsdlSchema schema = getSchema(fqn.getNamespace()); if (schema != null) { List<CsdlFunction> functions = schema.getFunctions(); if (functions != null) { for (CsdlFunction func : functions) { if (func.getName().equals(fqn.getName())) { foundFuncs.add(func); } } } } return foundFuncs; }
@Override public List<CsdlFunction> getFunctions(final FullQualifiedName functionName) throws ODataException { for (final CsdlSchema schema : serviceDocument.getEdmSchemas()) { if (schema.getNamespace().equals(functionName.getNamespace())) { return schema.getFunctions(functionName.getName()); } } return null; // NOSONAR see documentation }
@Override public List<CsdlFunction> getFunctions(FullQualifiedName functionName) throws ODataException { List<CsdlSchema> csdlSchemas = xmlMetadata.getSchemas(); for (CsdlSchema csdlSchema : csdlSchemas) { if (csdlSchema.getNamespace().equals(functionName.getNamespace())||csdlSchema.getAlias().equals(functionName.getNamespace())) { return csdlSchema.getFunctions(functionName.getName()); } } return null; }
boundFunctionStream = metadataInfo.getEdmxMetadataProvider().getSchemas().stream().flatMap(schema->schema.getFunctions().stream()).filter(function->function.isBound()); } catch (Exception e) { boundFunctionStream = Stream.empty();
private void readFunction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { CsdlFunction function = new CsdlFunction(); function.setParameters(new ArrayList<CsdlParameter>()); function.setName(attr(element, "Name")); function.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); function.setComposable(Boolean.parseBoolean(attr(element, "IsComposable"))); String entitySetPath = attr(element, "EntitySetPath"); if (entitySetPath != null) { // TODO: need to parse into binding and path. function.setEntitySetPath(entitySetPath); } readOperationParameters(reader, function); schema.getFunctions().add(function); }
private void readFunction(XMLEventReader reader, StartElement element, CsdlSchema schema) throws XMLStreamException { CsdlFunction function = new CsdlFunction(); function.setParameters(new ArrayList<CsdlParameter>()); function.setName(attr(element, "Name")); function.setBound(Boolean.parseBoolean(attr(element, "IsBound"))); function.setComposable(Boolean.parseBoolean(attr(element, "IsComposable"))); String entitySetPath = attr(element, "EntitySetPath"); if (entitySetPath != null) { // TODO: need to parse into binding and path. function.setEntitySetPath(entitySetPath); } readOperationParameters(reader, function); schema.getFunctions().add(function); }
csdlSchema.getNamespace(), csdlAction.getName()), csdlAction); List<CsdlFunction> csdlFunctions = csdlSchema.getFunctions(); for (CsdlFunction csdlFunction : csdlFunctions) { csdlFunctionsMap.put(
csdlSchema.getNamespace(), csdlAction.getName()), csdlAction); List<CsdlFunction> csdlFunctions = csdlSchema.getFunctions(); for (CsdlFunction csdlFunction : csdlFunctions) { csdlFunctionsMap.put(
public static CommonJavaObjectForEdmx convertFromActionsNfunctions(CommonJavaObjectForEdmx comModel, CDXEdmProvider edmxProvider, Map<String, String> namespaceToServMap) { CommonJavaObjectForEdmx updatedComModel = comModel; try { List<CsdlAction> actions = edmxProvider.getSchemas().get(0).getActions(); for (CsdlAction action : actions) { if (action.getReturnType() != null && !action.getReturnType().getType().startsWith("Edm")) { FullQualifiedName fqn = action.getReturnType().getTypeFQN(); updatedComModel = addCsdlComplexOrEntityToComModel(comModel, edmxProvider, fqn, namespaceToServMap); } } List<CsdlFunction> functions = edmxProvider.getSchemas().get(0).getFunctions(); for (CsdlFunction function : functions) { if (function.getReturnType() != null && function.getReturnType().getType().startsWith("Edm")) { FullQualifiedName fqn = function.getReturnType().getTypeFQN(); updatedComModel = addCsdlComplexOrEntityToComModel(updatedComModel, edmxProvider, fqn, namespaceToServMap); } } } catch (ODataException e) { PojoGenUtil.logDebug(log, "Could not parse Action/Function return type"); } return updatedComModel; }