hibernate 支持postgis函数
参考:
http://www.hibernatespatial.org/documentation/02-Tutorial/01-tutorial4/
https://stackoverflow.com/questions/34136676/hibernate-spatial-4-3-not-found-in-maven
maven 项目
使用hisbernate版本 但是在https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial 中没有4.3版本
可以这样做:
在pom中添加
<project....
<repositories>
<repository>
<id>Hibernate Spatial repo</id>
<url>http://www.hibernatespatial.org/repository</url>
</repository>
</repositories>
再添加
<!-- https://mvnrepository.com/artifact/org.postgis/postgis-jdbc -->
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
<dependency>
<groupId>com.spatial4j</groupId>
<artifactId>spatial4j</artifactId>
<version>0.5</version>
</dependency>
<dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-spatial -->
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>4.3</version>
<exclusions>
<exclusion>
<artifactId>dom4j</artifactId>
<groupId>dom4j</groupId>
</exclusion>
<exclusion>
<artifactId>hibernate-core</artifactId>
<groupId>org.hibernate</groupId>
</exclusion>
<exclusion>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</exclusion>
</exclusions>
</dependency>
...project>
///////////////////安装步骤:
windos
下载 postgit
在Windows上安装PostGIS时,您不必担心任何这些先决条件。您只需要为您的平台安装Postgresql安装程序即可。然后,您可以启动Application Stack Builder来安装PostGIS。


您可以在Boston GIS网站上找到更详细的安装说明。
如果遇到了
23:00:20: XML解析错误: 'no element found' 位于 行 1
23:00:20: 无法分析应用程序列表:http://www.postgresql.org/applications-v2.xml
这样的问题得话 可以直接在:https://winnie.postgis.net/download/windows/ 下载对应的版本

浙公网安备 33010602011771号