« Return to Thread: PostGIS - hibernate - EJB3

PostGIS - hibernate - EJB3

by Norman Barker-3 :: Rate this Message:

Reply to Author | View in Thread

Hi,

I am trying to use EJB3 in Java JBoss (which is hibernate behind the
scenes),

I have marked up a property as follows

        @Column(name="extents")
        public Geometry getExtents()
        {
                return extents;
        }

And my data source looks like

<datasources>
  <local-tx-datasource>
    <jndi-name>GeoDataDS</jndi-name>
 
<connection-url>jdbc:postgresql://127.0.0.1:5432/geometa</connection-url
>
    <driver-class>org.postgis.DriverWrapper</driver-class>
    <user-name>xxx</user-name>
    <password>xxx</password>
      <metadata>
         <type-mapping>PostgreSQL 8.1</type-mapping>
      </metadata>
  </local-tx-datasource>
</datasources>

Where extents is of type org.postgis.Geometry, when I tell the
entityManager to commit this I get invalid geometry error even when I
commit an empty polygon, or  simple linestring such as

LineString ls = new LineString("LINESTRING(191232 243118,191108
243242)");

If anyone has done this with EJB3 I would be really grateful for some
advice, but if you have done it with hibernate I would also be
interested as they are pretty similar.

Many thanks,

Norman
_______________________________________________
postgis-users mailing list
postgis-users@...
http://postgis.refractions.net/mailman/listinfo/postgis-users

 « Return to Thread: PostGIS - hibernate - EJB3