Search in sources :

Example 1 with ClobToStringTransform

use of org.teiid.core.types.basic.ClobToStringTransform in project teiid by teiid.

the class MongoDBSelectVisitor method convertGeometryToJson.

private void convertGeometryToJson(BasicDBObjectBuilder builder, GeometryType object) throws TranslatorException {
    try {
        ClobType clob = GeometryUtils.geometryToGeoJson(object);
        ClobToStringTransform clob2str = new ClobToStringTransform();
        String geometry = (String) clob2str.transform(clob, String.class);
        builder.add("$geometry", geometry);
    } catch (FunctionExecutionException | TransformationException e) {
        throw new TranslatorException(e);
    }
}
Also used : ClobType(org.teiid.core.types.ClobType) TransformationException(org.teiid.core.types.TransformationException) FunctionExecutionException(org.teiid.api.exception.query.FunctionExecutionException) ClobToStringTransform(org.teiid.core.types.basic.ClobToStringTransform) TranslatorException(org.teiid.translator.TranslatorException)

Aggregations

FunctionExecutionException (org.teiid.api.exception.query.FunctionExecutionException)1 ClobType (org.teiid.core.types.ClobType)1 TransformationException (org.teiid.core.types.TransformationException)1 ClobToStringTransform (org.teiid.core.types.basic.ClobToStringTransform)1 TranslatorException (org.teiid.translator.TranslatorException)1