PostgisDialect与PostgreSQLDialect或两者兼而有之?

编程入门 行业动态 更新时间:2024-10-25 04:16:05
本文介绍了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或两者兼而有之?

本文发布于:2023-10-21 17:23:13,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:兼而有之   PostgisDialect   PostgreSQLDialect

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!