[postgis-users] Experiment: Glassfish/EJB3 and PostGIS

Rabbia Qaswar rabbiaqaswar at yahoo.com
Fri May 11 05:13:06 PDT 2007


Hello

i tried working with EJB3 and PostGIS and it was surprisingly easy. Thanks to the thread i found at Nabble.  http://www.nabble.com/PostGIS---hibernate---EJB3-t2064211.html

and the work done in this is formally present here:
http://postgis.refractions.net/support/wiki/index.php?SpatialEJB3.

hope it solves your problem.

apart from that currently i am working with oracle spatial and ejb3 and i had the same problem as you are having with null values. Like PGGeometry in postgis there is a JGeometry class in oracle spatial library with a default no arg constructor. So whenever i had nothing to store in the geometry column i did:
User u = new User();
u.setRegion(new JGeometry());
em.persist(u);

This way an empty geometry is stored in the column, containing no geographical information. This way when you are not exactly storing 'null' in your column and when you retrieve the column value you can check the values of the Polygon and most probably they will all contain 0. So you know that no geographical information was stored in that column value.

regards
rabbia

----- Original Message ----
From: Gustavo Ces <g.ces at pettra.es>
To: PostGIS Users Discussion <postgis-users at postgis.refractions.net>
Sent: Friday, May 11, 2007 11:02:06 AM
Subject: Re: [postgis-users] Experiment: Glassfish/EJB3 and PostGIS

Hi Bastian,

    in geometry column ( region) you´re trying to insert a null value and 
program interprets that as a string one. In that type of columns you only 
can insert geometry types. Why it inserts null values as default is not a 
postgres sql problem, perhaps a interface one ( i´m not sure). Maybe if geom 
coumn is a not null one it doesn´t try to insert a null value, but i don´t 
know. But it´s a curious question. How do you insert a null into geometry 
type column?

Gus


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







 
____________________________________________________________________________________
No need to miss a message. Get email on-the-go 
with Yahoo! Mail for Mobile. Get started.
http://mobile.yahoo.com/mail 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070511/1d261494/attachment.html>


More information about the postgis-users mailing list