@Test public void testFunctionReturnComplexCollection() throws Exception { CsdlComplexType complex = complexType("Address"); CsdlReturnType returnType = new CsdlReturnType(); returnType.setType("namespace.Address"); returnType.setCollection(true); MetadataFactory mf = functionMetadata("invoke", returnType, complex); Procedure p = mf.getSchema().getProcedure("invoke"); assertNotNull(p); assertEquals(2, p.getParameters().size()); assertNotNull(p.getResultSet()); assertNull(getReturnParameter(p)); ColumnSet<Procedure> table = p.getResultSet(); ODataType type = ODataType.valueOf(p.getProperty(ODataMetadataProcessor.ODATA_TYPE, false)); assertEquals(ODataType.FUNCTION, type); type = ODataType.valueOf(table.getProperty(ODataMetadataProcessor.ODATA_TYPE, false)); assertEquals(ODataType.COMPLEX_COLLECTION, type); }
protected XMLMetadata getSchema(WSConnection conn) throws TranslatorException { if (this.ef != null) { return this.ef.getSchema(conn); } return null; }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { protected XMLMetadata getSchema(WSConnection conn) throws TranslatorException { if (this.ef != null) { return this.ef.getSchema(conn); } return null; } }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { protected XMLMetadata getSchema(WSConnection conn) throws TranslatorException { if (this.ef != null) { return this.ef.getSchema(conn); } return null; }  }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { protected XMLMetadata getSchema(WSConnection conn) throws TranslatorException { if (this.ef != null) { return this.ef.getSchema(conn); } return null; }  @Override void process(MetadataFactory mf, WSConnection conn); void setSchemaNamespace(String namespace); @TranslatorProperty(display="Schema Namespace", category=PropertyType.IMPORT, description="Namespace of the schema to import") String getSchemaNamespace(); }
ODataMetadataProcessor implements MetadataProcessor<WSConnection> { protected XMLMetadata getSchema(WSConnection conn) throws TranslatorException { if (this.ef != null) { return this.ef.getSchema(conn); } return null; }  @Override void process(MetadataFactory mf, WSConnection conn); void setSchemaNamespace(String namespace); @TranslatorProperty(display="Schema Namespace", category=PropertyType.IMPORT, description="Namespace of the schema to import") String getSchemaNamespace(); @ExtensionMetadataProperty(applicable = { Table.class, Procedure.class },
            datatype = String.class,
            display = "Name in OData Schema",
            description = "Name in OData Schema",
            required = true)
    static final String NAME_IN_SCHEMA; @ExtensionMetadataProperty(applicable = { Table.class, Procedure.class },
            datatype = String.class,
            display = "OData Type",
            description = "Type of OData Schema Item",
            allowed = "COMPLEX, NAVIGATION, ENTITY, ENTITY_COLLECTION, ACTION, FUNCTION, COMPLEX_COLLECTION, NAVIGATION_COLLECTION",
            required=true)
    static final String ODATA_TYPE; @ExtensionMetadataProperty(applicable=Column.class,
            datatype=String.class,
            display="Pseudo Column",
            description="Pseudo column for join purposes")
    static final String PSEUDO; }