Search in sources :

Example 1 with EdmReturnType

use of org.apache.olingo.commons.api.edm.EdmReturnType in project teiid by teiid.

the class OperationResponseImpl method setReturnValue.

@Override
public void setReturnValue(Object returnValue) throws SQLException {
    try {
        EdmReturnType returnType = this.procedureReturn.getReturnType();
        this.returnValue = // $NON-NLS-1$
        EntityCollectionResponse.buildPropery(// $NON-NLS-1$
        "return", (SingletonPrimitiveType) returnType.getType(), returnType.getPrecision(), returnType.getScale(), returnType.isCollection(), returnValue);
    } catch (TeiidProcessingException e) {
        throw new SQLException(e);
    } catch (IOException e) {
        throw new SQLException(e);
    }
}
Also used : EdmReturnType(org.apache.olingo.commons.api.edm.EdmReturnType) SingletonPrimitiveType(org.apache.olingo.commons.core.edm.primitivetype.SingletonPrimitiveType) SQLException(java.sql.SQLException) IOException(java.io.IOException) TeiidProcessingException(org.teiid.core.TeiidProcessingException)

Example 2 with EdmReturnType

use of org.apache.olingo.commons.api.edm.EdmReturnType in project teiid by teiid.

the class ComplexDocumentNode method addAllColumns.

@Override
protected void addAllColumns(boolean onlyPK) {
    for (final Column column : procedure.getResultSet().getColumns()) {
        if (column.isSelectable()) {
            EdmReturnType returnType = procedureReturn.getReturnType();
            EdmComplexType complexType = (EdmComplexType) returnType.getType();
            EdmPropertyImpl edmProperty = (EdmPropertyImpl) complexType.getProperty(column.getName());
            addProjectedColumn(new ElementSymbol(column.getName(), getGroupSymbol()), edmProperty.getType(), edmProperty, edmProperty.isCollection());
        }
    }
}
Also used : ElementSymbol(org.teiid.query.sql.symbol.ElementSymbol) EdmReturnType(org.apache.olingo.commons.api.edm.EdmReturnType) Column(org.teiid.metadata.Column) EdmComplexType(org.apache.olingo.commons.api.edm.EdmComplexType) EdmPropertyImpl(org.apache.olingo.commons.core.edm.EdmPropertyImpl)

Example 3 with EdmReturnType

use of org.apache.olingo.commons.api.edm.EdmReturnType in project teiid by teiid.

the class ComplexDocumentNode method addProjectedColumn.

@Override
protected void addProjectedColumn(final String columnName, final Expression expr) {
    EdmReturnType returnType = procedureReturn.getReturnType();
    EdmComplexType complexType = (EdmComplexType) returnType.getType();
    EdmPropertyImpl edmProperty = (EdmPropertyImpl) complexType.getProperty(columnName);
    addProjectedColumn(expr, edmProperty.getType(), edmProperty, edmProperty.isCollection());
}
Also used : EdmReturnType(org.apache.olingo.commons.api.edm.EdmReturnType) EdmComplexType(org.apache.olingo.commons.api.edm.EdmComplexType) EdmPropertyImpl(org.apache.olingo.commons.core.edm.EdmPropertyImpl)

Aggregations

EdmReturnType (org.apache.olingo.commons.api.edm.EdmReturnType)3 EdmComplexType (org.apache.olingo.commons.api.edm.EdmComplexType)2 EdmPropertyImpl (org.apache.olingo.commons.core.edm.EdmPropertyImpl)2 IOException (java.io.IOException)1 SQLException (java.sql.SQLException)1 SingletonPrimitiveType (org.apache.olingo.commons.core.edm.primitivetype.SingletonPrimitiveType)1 TeiidProcessingException (org.teiid.core.TeiidProcessingException)1 Column (org.teiid.metadata.Column)1 ElementSymbol (org.teiid.query.sql.symbol.ElementSymbol)1