Hibernate Spatial Oracle Provider Usage

Basic usage

To have Hibernate Spatial use this provider, simply drop the jar on the class-path alongside the hibernate-spatial.jar. When the Hibernate Spatial library is loaded it will find the provider and use it to retrieve the Hibernate dialect for Oracle Spatial. This dialect is a subclass of org.hibernate.dialect.Oracle9Dialect

With the provider installed, you can use it by setting the dialect in the Hibernate configuration file as in the following snippet.

	  	...
		<property name="hibernate.dialect">
			org.hibernatespatial.oracle.OracleSpatial10gDialect
		</property>
		...
	  	

Oracle Specific Configuration

You can configure the Oracle provider by creating a properties file with the name org.hibernatespatial.oracle.OracleSpatial10gDialect.java and putting it on the classpath.

The ConnectionFinder Interface

The SDOGeometryType requires access to an OracleConnection object when converting a geometry to SDO_GEOMETRY, prior to setting the geometry attribute in prepared statements. In some environments, however, the prepared statements do not return an OracleConnection but a wrapper object. Implementations of this interface attempt to retrieve the OracleConnection from the wrapper in such cases.

You can provide your own implementation of this interface to Hibernate Spatial by adding a property CONNECTION-FINDER in the properties file, and setting it to the fully-qualified class name of your implementation.

		CONNECTION-FINDER = <fully qualified class name>
		

OGC Compliance Setting

This provider can be configured to run in either OGC strict or non-strict mode. In OGC strict mode, the Open Geospatial compliant functions of Oracle Spatial are used in spatial operations. In non-strict mode the usual Oracle Spatial functions are used directly, and mimic the OGC semantics. The default is OGC strict mode. You can change this to non-strict mode by adding the following line to the properties file:

      	OGC_STRICT = false
      	

Note that changing from strict to non-strict mode changes the semantics of the spatial operation. We have attempted to implement the OGC semantics as well we could using the standard Oracle Spatial operators, but this was not possible in all cases.