@TeiidFunction(name=SourceSystemFunctions.ST_ASEWKB, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static BlobType asEwkb(final GeometryType geometry) { return GeometryUtils.geometryToEwkb(geometry); }
@TeiidFunction(name=SourceSystemFunctions.ST_ASGEOJSON, category=FunctionCategoryConstants.GEOMETRY, pushdown=PushDown.CAN_PUSHDOWN, nullOnNull=true) public static ClobType asGeoJson(GeometryType geometry) throws FunctionExecutionException { return GeometryUtils.geometryToGeoJson(geometry); }
@TeiidFunction(name=SourceSystemFunctions.ST_ASGML, category=FunctionCategoryConstants.GEOMETRY, pushdown=PushDown.CAN_PUSHDOWN, nullOnNull=true) public static ClobType asGml(CommandContext context, GeometryType geometry) throws FunctionExecutionException { return GeometryUtils.geometryToGml(context, geometry, true); }
@TeiidFunction(name=SourceSystemFunctions.ST_SIMPLIFY, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType simplify(GeometryType geom, double tolerance) throws FunctionExecutionException { return GeometryUtils.simplify(geom, tolerance); }
@TeiidFunction(name=SourceSystemFunctions.ST_BOUNDARY, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType boundary(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.boundary(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_ENDPOINT, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType endPoint(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.startEndPoint(geom, false); }
@TeiidFunction(name=SourceSystemFunctions.ST_LENGTH, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Double length(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.length(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_NUMGEOMETRIES, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Integer numGeometries(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.numGeometries(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_RELATE, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static String relate(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return GeometryUtils.relate(geom1, geom2); }
@TeiidFunction(name=SourceSystemFunctions.ST_SYMDIFFERENCE, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType symDifference(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return GeometryUtils.symDifference(geom1, geom2); }
@TeiidFunction(name=SourceSystemFunctions.ST_UNION, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType union(GeometryType geom1, GeometryType geom2) throws FunctionExecutionException { return GeometryUtils.union(geom1, geom2); }
@TeiidFunction(name=SourceSystemFunctions.ST_Z, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Double ordinateZ(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.ordinate(geom, GeometryUtils.Ordinate.Z); }
@TeiidFunction(name=SourceSystemFunctions.ST_SRID, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static int getSrid(GeometryType geom1) { return geom1.getSrid(); }
@TeiidFunction(name=SourceSystemFunctions.ST_ENVELOPE, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType envelope(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.envelope(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_ISEMPTY, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Boolean isEmpty(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.isEmpty(geom); }
@TeiidFunction(name=SourceSystemFunctions.ST_POINT, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType point(double x, double y) { return GeometryUtils.point(x, y); }
@TeiidFunction(name=SourceSystemFunctions.ST_Y, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static Double ordinateY(GeometryType geom) throws FunctionExecutionException { return GeometryUtils.ordinate(geom, GeometryUtils.Ordinate.Y); }
@TeiidFunction(category=FunctionCategoryConstants.DATETIME, pushdown=PushDown.CAN_PUSHDOWN) public static String from_unixtime(long count) throws FunctionExecutionException { if (count > Long.MAX_VALUE/1000 || count < Long.MIN_VALUE/1000) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID31264, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31264)); } String string = new Timestamp(count*1000l).toString(); return string.substring(0, string.length()-2); }
@TeiidFunction(name=SourceSystemFunctions.ST_GEOMFROMEWKT, category=FunctionCategoryConstants.GEOMETRY, nullOnNull=true, pushdown=PushDown.CAN_PUSHDOWN) public static GeometryType geomFromEwkt(ClobType ewkt) throws FunctionExecutionException { return GeometryUtils.getGeometryType(GeometryUtils.geometryFromClob(ewkt, null, true)); }
@TeiidFunction(category=FunctionCategoryConstants.SECURITY, nullOnNull=true) public static BinaryType aes_decrypt(BinaryType dataBytes, BinaryType keyBytes) throws FunctionExecutionException { try { byte[] decryptResult = SymmetricCryptor.getSymmectricCryptor(padkey(keyBytes.getBytesDirect()), "AES", "AES/CBC/PKCS5Padding", new IvParameterSpec(iv)).decrypt(dataBytes.getBytesDirect()); //$NON-NLS-1$ //$NON-NLS-2$ return new BinaryType(decryptResult); } catch (CryptoException e) { throw new FunctionExecutionException(e); } }