Oracle query also fetches results without spatial references

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Oracle query also fetches results without spatial references

Daniel
Hello,
I have got a problem with Hibernate Spatial in an Oracle environment. I've sent this text already over the mail address, but somehow it didn't get through.
The used software:
Java 6u24 Oracle 11g, Hibernate 3.3.2GA, HibernateSpatial 1.0

I am performing only basic HQL quries like this one:
SELECT distinct alias1  , alias1.DBID ,  alias4.id
FROM item alias1
LEFT JOIN alias1.subitem alias2
LEFT JOIN alias2.spatial alias3
LEFT JOIN alias2.tag alias4
WHERE ( intersects( alias3.spatialRef , :parameter_0 ) = true ) ORDER
BY  alias4.id ASC

The database holds several entries, some of them have a spatial
attribute set with a polygon, whereas on other entries the spatial field
is set to null. Basically, I only perform inside and intersect queries
on the database. I also perform these queries on a PostgreSQL database,
everything is fine there.
The problem with Oracle is that I also receive results that shouldn't be
in the result list, because they have the spatial field set to null.
Example:
The database holds three entries,
entry#   |   spatialInfo
---------------------
entry1   |   region1
entry2   |   null
entry3   |  region2
Performing a query with a spatial parameter that covers only region1, in
PostgreSQL I receive exactly one result, entry1, whereas in Oracle I
receive two results, entry1 and entry2.
I saw in the JDBC log that Hibernate Spatial is transferring the spatial
part of the query to a  call of the database method
MDSYS.OGC_INTERSECTS. I couldn't find any information about that method
in Oracle, only general OGC specifications.
I also tried setting the OGC_STRICT mode to false in a .properties file,
but this didn't change anything. I am not sure that the properties file
has been interpreted at all.
Any ideas what's going on?

Thank you,
Daniel