Uploaded image for project: 'Hibernate ORM'
  1. HHH-10157

Postgis geometry type for JTS geometrys not usable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 5.0.1, 5.0.2
    • Fix Version/s: 5.0.5
    • Component/s: hibernate-spatial
    • Labels:
      None
    • Environment:
      hibernate-core, hibernate-spatial 5.0.2
      postgresql 9.1-901-1.jdbc4
      postgis-jdbc 1.5.2
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      The following error is generated when trying to read a geometry field from the database.

      Example class:

      public class Demo {
          @Id
          private long id;
      
          private com.vividsolutions.jts.geom.Geometry geometry;
      
          ...
      }
      

      Exception:

      java.lang.NumberFormatException: For input string: "SR"
      	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      	at java.lang.Integer.parseInt(Integer.java:580)
      	at org.geolatte.geom.ByteBuffer.from(ByteBuffer.java:78)
      	at org.hibernate.spatial.dialect.postgis.PGGeometryTypeDescriptor.toGeometry(PGGeometryTypeDescriptor.java:99)
      	at org.hibernate.spatial.dialect.postgis.PGGeometryTypeDescriptor.access$000(PGGeometryTypeDescriptor.java:38)
      	at org.hibernate.spatial.dialect.postgis.PGGeometryTypeDescriptor$2.doExtract(PGGeometryTypeDescriptor.java:77)
      	at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:47)
      	at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:241)
      	at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:237)
      	at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:227)
      	at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:303)
      	at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2726)
      	at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1728)
      	at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1654)
      	at org.hibernate.loader.Loader.getRow(Loader.java:1543)
      	at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:727)
      	at org.hibernate.loader.Loader.processResultSet(Loader.java:972)
      	at org.hibernate.loader.Loader.doQuery(Loader.java:930)
      	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
      	at org.hibernate.loader.Loader.doList(Loader.java:2611)
      	at org.hibernate.loader.Loader.doList(Loader.java:2594)
      	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2423)
      	at org.hibernate.loader.Loader.list(Loader.java:2418)
      	at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:109)
      	at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1705)
      	at org.hibernate.internal.CriteriaImpl.list(CriteriaImpl.java:363)
      

        Attachments

          Issue links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: