[postgis-users] Spatial Object Queries - complete
Norman Barker
nbarker at ittvis.com
Wed Jan 31 09:46:00 PST 2007
Hi,
After much time (and in the end a stupid mistake on my part of not
recognizing namespaces) I have added the code to do spatial object
queries (HibernateQL (HQL) and EJB(3)-QL) with PostGIS.
In the attached there is a service file PostGISService.java which
exercises all the functionality of PostGIS from Java Object Queries.
The advantage here is that when you perform these queries you get
complex objects back containing your data (no parsing of resultsets) and
these queries are polymorphic (so include sub-classes). e.g.
Query union = entityManager.createQuery("Select
spatial.Union(p.location, person.location) from PersonEntity p,
PersonEntity as person where person = :person");
union.setParameter("person", p);
The result is a person object (with a location geometry field).
If you use JBoss EJBs (rather than Spring + Hibernate) you will get an
implicit transaction lock on the entity as well.
Hopefully someone finds it of use since the hibernate dialect is
portable, it could be used for a WFS-T, Catalog etc. specific for
PostGIS.
My next step is to make it portable across DBs, and to integrate with
SOLR to give a catalog type interface.
Hopefully you are happy to keep this with PostGIS, and give me commit
access to SVN so that I don't have to attach files!!
Many thanks,
Norman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hql.zip
Type: application/x-zip-compressed
Size: 6518 bytes
Desc: hql.zip
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070131/c4ea64d4/attachment.bin>
More information about the postgis-users
mailing list