PostGIS and JPA 2.0

感情迁移 提交于 2019-11-29 07:01:34

I googled for solutions or examples, but all I can find is, that JPA does not support mapping of custom data types. Is it still in JPA 2.0?

Yes. So you'll have to rely on specific extensions. For Hibernate, the Hibernate Spatial project provides ready to use spatial dialects and custom types:

Hibernate Spatial is a generic extension to Hibernate for handling geographic data. Hibernate Spatial is open source and licensed, like Hibernate, under the LGPL license.

Hibernate Spatial allows you to deal with geographic data in a standardized way. It abstracts away from the specific way your database supports geographic data, and provides a standardized, cross-database interface to geographic data storage and query functions.

Hibernate Spatial supports most of the functions of the OGC Simple Feature Specification. Supported databases are: Oracle 10g/11g, Postgresql/Postgis, Microsoft SQL Server and MySQL.

DataNucleus supports JPA1+2 and also has a Spatial plugin supporting PostGIS amongst other things

sauce

I just did this with Hibernate Spatial. They have a great tutorial on their website even though I assume you have found an answer from now.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!