PostgisDialect与PostgreSQLDialect或两者兼而有之? [英] PostgisDialect vs PostgreSQLDialect or both?

查看:1223
本文介绍了PostgisDialect与PostgreSQLDialect或两者兼而有之?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序将使用以下技术:


  • Postgresql

  • Postgis

  • JPA / Hibernate

  • Spring

  • Spring数据JPA


我理解(从Hibernate Spatial文档中)必须使用以下方言: org.hibernate.spatial.dialect.postgis.PostgisDialect

我不明白的是,上面的方言与标准的Posgresql方言有关,即 org.hibernate.dialect。 PostgreSQLDialect ...



Postgis方言是标准Posgresql方言的超集吗?



最新的标准Posgresql方言的所有功能都可以用Postgis方言吗?



我猜我可以在同一个entityManager工厂中使用多个/多个方言......那么,什么是最好的方法来获得两种方言的最佳效果?

解决方案

PostgisDialect实际上扩展了Postgresql方言,所以,它是一个超集。请参阅类声明: PostgisDialect类声明



这里有一个很好的教程: Hibernate spatial with Postgis ,这表明您只需要包含Postgis Dialect就可以保留空间和非空间字段。



Postgis主要为Postgresql之上的空间对象提供支持。 Postgis安装还包括提供许多实际几何功能的GEOS(Java拓扑套件的C ++端口),Proj4,它提供对不同坐标系/投影和GDAL的支持,GDAL是各种地理数据格式之间的转换工具。 / p>

My application is going to use the following technologies:

  • Postgresql
  • Postgis
  • JPA/Hibernate
  • Spring
  • Spring Data JPA

I understand (from the Hibernate Spatial documentation) that one has to use the following dialect: org.hibernate.spatial.dialect.postgis.PostgisDialect

What I don't understand though is how the above dialect relates to the standard Posgresql dialect, i.e. org.hibernate.dialect.PostgreSQLDialect...

Is the Postgis dialect a superset of the standard Posgresql dialect?

Will all features of the latest standard Posgresql dialect be available in the Postgis dialect?

I guess I can't use several/multiple dialects on the same entityManager factory... Then what are the best practices to get the best of both dialects?

解决方案

The PostgisDialect actually extends the Postgresql dialect, so, yes, it is a superset. See the class declaration: PostgisDialect class declaration

There is a good tutorial here: Hibernate spatial with Postgis that show that you only need to include the Postgis Dialect in order to persist both spatial and non-spatial fields.

Postgis primary provides support for spatial objects on top of Postgresql. A Postgis installation also includes GEOS (a C++ port of Java Topology Suite) which provides many of the actual geometric functions, Proj4, which provides support for different coordinate systems/projections and GDAL, which is a conversion utility between various geographical data formats.

这篇关于PostgisDialect与PostgreSQLDialect或两者兼而有之?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆