Hibernate Spatial and Oracle SDO Java API

2 messages Options
Embed this post
Permalink
Jeremy-78

Hibernate Spatial and Oracle SDO Java API

Reply Threaded More More options
Print post
Permalink
Hi again,

I still want to make a query on an Oracle Database. The oracle
provider uses the Oracle SDO Java API.
So when I define a geometry object as a parameter to a query, it is a
JGeometry object. However, I don't know how to specify its type. For a
PostGreSQL with JTS, the solution is Type geometryType = new
CustomType(GeometryUserType.class, null); (as written in the
tutorial). But it does work with the Oracle SDO Java API.

Have you any advice to do that?

Thanks in advance,

Jim
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users
Karel Maesen

Re: Hibernate Spatial and Oracle SDO Java API

Reply Threaded More More options
Print post
Permalink
Hi Jim,

On 05 Dec 2007, at 12:02, Jeremy wrote:

> I still want to make a query on an Oracle Database. The oracle
> provider uses the Oracle SDO Java API.
> So when I define a geometry object as a parameter to a query, it is a
> JGeometry object. However, I don't know how to specify its type. For a
> PostGreSQL with JTS, the solution is Type geometryType = new
> CustomType(GeometryUserType.class, null); (as written in the
> tutorial). But it does work with the Oracle SDO Java API.
>

It works exactly the same for Oracle Spatial as for Postgis. So also  
if you use Oracle, you should create a Type object with:

Type geometryType = new CustomType(GeometryUserType.class, null)

and pass this in the query.

In general, Hibernate Spatial maps all  vendor-specific DB geometry  
types to JTS Geometry, and client or application code must use the  
JTS geometry types.

In the current binary (snapshot) builds the JGeometries are converted  
to JTS Geometries.  If you build the Oracle Provider directly from  
source , however, you actually don't need the Oracle SDO API. The  
version in trunk can now convert directly from the JDBC return type  
to JTS Geometry without passing through JGeometry.

Hope this helps,

Karel

_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users