openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: OpenJPA and PostGIS or other spatial extensions
Date Fri, 16 Jul 2010 15:53:42 GMT
Hi Jerry and Harald,
It's always good to hear positive remarks about our OpenJPA efforts...

Besides Jerry's useful experiences, the other thing to point out is that you
should be able to extend the OpenJPA implementation to use the PostGIS
features more directly (vs native queries).  But, this would come with some
development costs.  It sounds like PostGIS has extended Postgres for the
spatial capabilities.  Would extending the Postgres data dictionary be
helpful with the additional PostGIS JDBC extensions?

Enhancing JPQL with some new operators similar to HQL may be a bit more
work.  You would have to modify the jjtree parser to allow the new
functions, and then map these to appropriate processing within the runtime
and dictionary to accomplish your goals.

So, yes, anything is doable...  :-)  You'll find that OpenJPA is actually an
open, flexible architecture.  Good luck on your findings and let us know how
it's going for you.

Kevin

On Fri, Jul 16, 2010 at 10:30 AM, No1UNo <jerry@jerrycarter.org> wrote:

>
> I've been walking down the same road.  I'm also working with PostGIS.  I
> started with Hibernate and then shifted to OpenJPA and haven't looked back.
>
> I am using the NativeQuery mechanism.  I had an exchange with Pinaki
> regarding the Critera API which was added to JPA 2.0 some number of weeks
> back.  This is one way to invoke PostGIS functions but it's really just
> hiding the native characteristic of what are necessarily native functions.
>  I do, however, specify the queries in a separate XML file and then refer to
> them by name.  In my mind, this will simplify migration to Oracle should it
> become necessary in future.
>
> As for the various geographic types, I build a custom AbstractValueHandler
> for serializing/converting the PostGIS representations into the form used in
> my code.  If you work with the org.postgis.* types, this may not even be
> necessary.
>
> In short, it's doable, but it may take a little work.
>
> -=- Jerry
>
>
> On Jul 16, 2010, at 11:02 AM, Harald Wellmann [via OpenJPA] wrote:
>
> > I'm currently evaluating OpenJPA as a replacement for Hibernate. I'm
> rather frustrated by the lack of JPA 2.0 compliance in Hibernate, and I'm
> glad to say I haven't run into any such problems with OpenJPA so far.
> >
> > On the other hand, there are some extensions beyond the scope of JPA
> which work with Hibernate and which would have to be replaced as well.
> >
> > Our project uses geodata stored in PostGIS. Hibernate Spatial provides
> type mappings for the geometry JDBC types and custom HQL operators like
> WITHIN() corresponding to PostGIS stored procedures.
> >
> > Would it be possible to hook into OpenJPA in a similar manner to support
> spatial extensions without resorting to native SQL?
> >
> > Best regards,
> >
> > Harald
> >
> >
> > View message @
> http://openjpa.208410.n2.nabble.com/OpenJPA-and-PostGIS-or-other-spatial-extensions-tp5302323p5302323.html
> > To start a new topic under OpenJPA Users, email
> ml-node+208411-1595610943-93721@n2.nabble.com<ml-node%2B208411-1595610943-93721@n2.nabble.com>
> > To unsubscribe from OpenJPA Users, click here.
> >
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/OpenJPA-and-PostGIS-or-other-spatial-extensions-tp5302323p5302479.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message