Search in sources :

Example 1 with OracleSpatial10gDialect

use of org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect in project hibernate-orm by hibernate.

the class DWithinExpression method getTypedValues.

@Override
public TypedValue[] getTypedValues(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
    final SpatialDialect spatialDialect = ExpressionUtil.getSpatialDialect(criteriaQuery, SpatialFunction.dwithin);
    TypedValue typedDistanceValue = new TypedValue(StandardBasicTypes.DOUBLE, distance);
    if (spatialDialect instanceof OracleSpatial10gDialect) {
        typedDistanceValue = new TypedValue(StandardBasicTypes.STRING, "distance=" + distance);
    }
    return new TypedValue[] { criteriaQuery.getTypedValue(criteria, propertyName, geometry), typedDistanceValue };
}
Also used : SpatialDialect(org.hibernate.spatial.SpatialDialect) OracleSpatial10gDialect(org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect) TypedValue(org.hibernate.engine.spi.TypedValue)

Aggregations

TypedValue (org.hibernate.engine.spi.TypedValue)1 SpatialDialect (org.hibernate.spatial.SpatialDialect)1 OracleSpatial10gDialect (org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect)1