Class SpatialExpressionFactory
java.lang.Object
org.eclipse.persistence.expressions.spatial.SpatialExpressionFactory
This class is used to construct expressions that use Oracle Spatial operators
ExpressionBuilder builder = new ExpressionBuilder(); Expression withinDistance = SpatialExpressions.withinDistance(myJGeometry1, myJGeometry2, "DISTANCE=10"); session.readAllObjects(GeometryHolder.class, withinDistance);
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Expression
filter
(Expression geom1, Object geom2, SpatialParameters params) PUBLIC: Return an Expression for the MDSYS.SDO_FILTER Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesstatic Expression
getSpatialExpression
(int operator, Expression geom1, Object geom2, String params) INTERNAL: A utility method to build a SpatialExpressionstatic Expression
nearestNeighbor
(Expression geom1, Object geom2, SpatialParameters params) PUBLIC: Return an Expression for the MDSYS.SDO_NN Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesstatic Expression
relate
(Expression geom1, Object geom2, SpatialParameters params) PUBLIC: Return an Expression for the MDSYS.MDSYS.SDO_RELATE Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesstatic Expression
withinDistance
(Expression geom1, Object geom2, SpatialParameters params) PUBLIC: Return an Expression for the MDSYS.SDO_WITHIN_DISTANCE Spatial Operator on the Oracle Database Use of this expression requires the Java spatial classes
-
Constructor Details
-
SpatialExpressionFactory
public SpatialExpressionFactory()
-
-
Method Details
-
withinDistance
PUBLIC: Return an Expression for the MDSYS.SDO_WITHIN_DISTANCE Spatial Operator on the Oracle Database Use of this expression requires the Java spatial classesSpatialParameters parameters = new SpatialParameters(); parameters.setDistance(10d); Expression selectCriteria = SpatialExpressions.withinDistance(jGeometry1, jGeometry2, parameters);
- Parameters:
geom1
- an Expression representing a JGeometryObjectgeom2
- a JGeometryObject or an Expression representing a JGeometryObjectparams
- a SpatialParameters object configured with the parameters to the call- Returns:
- a TopLink Expression
-
relate
PUBLIC: Return an Expression for the MDSYS.MDSYS.SDO_RELATE Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesSpatialParameters parameters = new SpatialParameters(); parameters..setMask(Mask.ANYINTERACT).setQueryType(QueryType.WINDOW); Expression selectCriteria = SpatialExpressions.relate(jGeometry1, jGeometry2, parameters);
- Parameters:
geom1
- an Expression representing a JGeometryObjectgeom2
- a JGeometryObject or an Expression representing a JGeometryObjectparams
- a SpatialParameters object configured with the parameters to the call- Returns:
- a TopLink Expression
-
filter
PUBLIC: Return an Expression for the MDSYS.SDO_FILTER Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesSpatialParameters parameters = new SpatialParameters(); parameters.setQueryType(QueryType.WINDOW); Expression selectCriteria = SpatialExpressions.filter(jGeometry1, jGeometry2, parameters);
- Parameters:
geom1
- an Expression representing a JGeometryObjectgeom2
- a JGeometryObject or an Expression representing a JGeometryObjectparams
- a SpatialParameters object configured with the parameters to the call- Returns:
- a TopLink Expression
-
nearestNeighbor
PUBLIC: Return an Expression for the MDSYS.SDO_NN Spatial Operator on the Oracle Database Use of this operator requires the Java spatial classesSpatialParameters parameters = new SpatialParameters(); parameters.setUnit(Units.M); Expression selectCriteria = SpatialExpressions.nearestNeighbor(jGeometry1, jGeometry2, parameters);
- Parameters:
geom1
- an Expression representing a JGeometryObjectgeom2
- a JGeometryObject or an Expression representing a JGeometryObjectparams
- a SpatialParameters object configured with the parameters to the call- Returns:
- a TopLink Expression
-
getSpatialExpression
public static Expression getSpatialExpression(int operator, Expression geom1, Object geom2, String params) INTERNAL: A utility method to build a SpatialExpression- Parameters:
operator
- the ordinal of the operatorgeom1
-geom2
-params
-- Returns:
-