Search in sources :

Example 1 with EdmComplexResponse

use of org.teiid.olingo.EdmComplexResponse in project teiid by teiid.

the class TeiidServiceHandler method crossJoin.

@Override
public void crossJoin(DataRequest request, List<String> entitySetNames, ODataResponse response) throws ODataLibraryException, ODataApplicationException {
    final ODataSQLBuilder visitor = new ODataSQLBuilder(this.odata, getClient().getMetadataStore(), this.prepared, true, request.getODataRequest().getRawBaseUri(), this.serviceMetadata);
    visitor.visit(request.getUriInfo());
    try {
        Query query = visitor.selectQuery();
        BaseResponse queryResponse = executeQuery(request, request.isCountRequest(), visitor, query);
        ContextURL.Builder builder = new ContextURL.Builder().asCollection().entitySetOrSingletonOrType("Edm.ComplexType");
        EdmComplexResponse complexResponse = EdmComplexResponse.getInstance(request, builder.build(), false, response);
        sendResults(request, visitor, queryResponse, complexResponse);
    } catch (Exception e) {
        throw new ODataApplicationException(e.getMessage(), HttpStatusCode.INTERNAL_SERVER_ERROR.getStatusCode(), Locale.getDefault(), e);
    }
}
Also used : BaseResponse(org.teiid.odata.api.BaseResponse) ContextURL(org.apache.olingo.commons.api.data.ContextURL) Query(org.teiid.query.sql.lang.Query) URISyntaxException(java.net.URISyntaxException) TransformationException(org.teiid.core.types.TransformationException) TeiidProcessingException(org.teiid.core.TeiidProcessingException) ODataLibraryException(org.apache.olingo.server.api.ODataLibraryException) TeiidException(org.teiid.core.TeiidException) EdmPrimitiveTypeException(org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException) SerializerException(org.apache.olingo.server.api.serializer.SerializerException) SQLException(java.sql.SQLException) MalformedURLException(java.net.MalformedURLException) TeiidRuntimeException(org.teiid.core.TeiidRuntimeException) ODataApplicationException(org.apache.olingo.server.api.ODataApplicationException) ODataApplicationException(org.apache.olingo.server.api.ODataApplicationException) EdmComplexResponse(org.teiid.olingo.EdmComplexResponse)

Aggregations

MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 SQLException (java.sql.SQLException)1 ContextURL (org.apache.olingo.commons.api.data.ContextURL)1 EdmPrimitiveTypeException (org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException)1 ODataApplicationException (org.apache.olingo.server.api.ODataApplicationException)1 ODataLibraryException (org.apache.olingo.server.api.ODataLibraryException)1 SerializerException (org.apache.olingo.server.api.serializer.SerializerException)1 TeiidException (org.teiid.core.TeiidException)1 TeiidProcessingException (org.teiid.core.TeiidProcessingException)1 TeiidRuntimeException (org.teiid.core.TeiidRuntimeException)1 TransformationException (org.teiid.core.types.TransformationException)1 BaseResponse (org.teiid.odata.api.BaseResponse)1 EdmComplexResponse (org.teiid.olingo.EdmComplexResponse)1 Query (org.teiid.query.sql.lang.Query)1