1

I'm working on GIS project.

In that I want produce a web GIS by JSF + Hibernate.

My Spatial data is in Oracle-Spatial 12c, for some Spatial Analysis I must be connect to Oracle DB and insert update a spatial Table.

I see this link Hibernate-Spatial

I first try to do this with Maven project in Net Beans 8.02 but not that work correct!!

And finally I have done these Step:

  1. creates a web Application with net Beans 8.02 with hibernate 4.3 and JSF

  2. Do the Step of this for the Hibernate

    https://netbeans.org/kb/docs/web/hibernate-webapp.html

  3. Download jar files of Geo-tools from this link and add to my Project

    http://sourceforge.net/projects/geotools/files/

  4. Download the Jar file of the hibernate-spatial 4.3 from this link and ojdbc7

    http://www.hibernatespatial.org/documentation/01-download/01-releases/

  5. Add two Spatial Table to My project(LINE POINT)

  6. a setting up this Steps in my project and my Line and point Class and .hbm.xml

    http://www.hibernatespatial.org/documentation/03-dialects/05-oracle/

    http://www.hibernatespatial.org/documentation/documentation/

  7. When I Build my project in net Beans and try get a Query this From Line this Error show

    java.lang.UnsupportedOperationException at org.hibernate.spatial.GeometrySqlTypeDescriptor.getExtractor(GeometrySqlTypeDescriptor.java:57) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:263) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:259) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:249) at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:334) at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2969) at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1695) at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1627) at org.hibernate.loader.Loader.getRow(Loader.java:1514) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:725) at org.hibernate.loader.Loader.processResultSet(Loader.java:952) at org.hibernate.loader.Loader.doQuery(Loader.java:920) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:354) at org.hibernate.loader.Loader.doList(Loader.java:2551) at org.hibernate.loader.Loader.doList(Loader.java:2537) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2367) at org.hibernate.loader.Loader.list(Loader.java:2362) at org.hibernate.hql.internal.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:939) at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:229) at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1260) at org.hibernate.internal.QueryImpl.list(QueryImpl.java:103)

Please help me how solve the problem Or is a best Solution than hibernate-spatial?

Stijn Geukens
  • 15,454
  • 8
  • 66
  • 101

1 Answers1

0

Looks like it is using a wrong dialect. The OracleSpatial10gDialect of Hibernate Spatial (HS) 4.3 will take care of those GeometrySqlTypeDescriptor re-mapping to a SDOGeometryTypeDescriptor which implements the SqlTypeDescriptor.getExtractor (see the remapSqlTypeDescriptor function in HS 4.3). So check your hibernate/persistence.xml configuration for the next properties:

<property name="hibernate.dialect">org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect</property>
<property name="hibernate.spatial.connection_finder">org.hibernate.spatial.dialect.oracle.DefaultConnectionFinder</property>

See this link for an explanation of connection_finder.

Be aware that you must use HS 4.3 because you are using Hibernate version 4.3. For father problems keep in mind this version of HS was tested on Oracle 10g and 11g but it says nothing about Oracle 12c.

Guillermo
  • 1,523
  • 9
  • 19