Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Postgis Eclipselink JPA(Postgres Postgis Eclipselink JPA support)
Postgis Eclipselink JPA [message #636934] Wed, 03 November 2010 12:36 Go to next message
Dan Hargreaves is currently offline Dan HargreavesFriend
Messages: 7
Registered: November 2010
Junior Member
Hi,

We currently have a JPA setup using eclipselink persisting out entities in a postgres database. We use JPA to create the schema as well as persisting everything.

What we would like to do is introduce some spatial data into the database and use the database to perform queries on this.

I have installed and followed some simple examples of Postgis and determined that it could support the queries we want however I have fallen down at trying to integrate it with our JPA setup.

Seraching the web there appears to be almost no indication that this could work apart from a few message board posts a considerable amount of time ago.

I have followed the suggestions I've found, using a postgis driver, using postgis and vividsolutions data types and supplying a @Converter however these seem to have little impact on the resulting schema. The field type is either bytea or if a converter is supplied varchar.

Can anybody clarify whether this is supported so I can look at something else or identify where I might be going wrong.

Many thanks,

Dan.

[Updated on: Wed, 03 November 2010 13:58]

Report message to a moderator

Re: Postgis Eclipselink JPA [message #637195 is a reply to message #636934] Thu, 04 November 2010 14:45 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

If you want to use spatial datatype you will need to set the type in your @Column "columnDefinition" attribute.


James : Wiki : Book : Blog : Twitter
Re: Postgis Eclipselink JPA [message #637214 is a reply to message #637195] Thu, 04 November 2010 15:45 Go to previous message
Dan Hargreaves is currently offline Dan HargreavesFriend
Messages: 7
Registered: November 2010
Junior Member
Hi James,

thanks for the reply. Following your suggestion I have added an annotation on the field of

@Column( columnDefinition="geometry" )

this appears to produce the correct SQL to create the table.

The problem I seem to have now is that the database JPA is creating is not spatially enabled in that the functions that exist in the test database I created while installing postgis do not exist in the JPA database. As a result type 'geometry' is not recognised during the creation process and an exception is thrown.

If you have any ideas on what else I could be missing please let me know.

Many thanks,
Dan.
Previous Topic:EclipseLink 2.0 ManyToOne not working correctly
Next Topic:Get exception when calling getIdClassAttributes in child class
Goto Forum:
  


Current Time: Thu Apr 25 03:45:19 GMT 2024

Powered by FUDForum. Page generated in 0.03290 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top