我正在尝试使用postgis设置一个带有hibernate-spatial的项目。按照hibernate-space4.0-m1的教程,我首先遇到了找不到依赖postgis-jdbc-1.5.3.jar的问题。就像有人在这里建议的那样,我使用了1.5.2版,然后教程就会编译。
但是如果我尝试运行它,我会得到一个错误。我将hibernate的调试级别设置为debug,并偶然发现了以下问题:
DEBUG SQL -
create table Event (
id int8 not null,
date timestamp,
location GEOMETRY,
title varchar(255),
primary key (id)
)
Hibernate:
create table Event (
id int8 not null,
date timestamp,
location GEOMETRY,
title varchar(255),
primary key (id)
)
ERROR SchemaExport - HHH000389: Unsuccessful: create table Event (id int8 not null, date timestamp, location GEOMETRY, title varchar(255), primary key (id))
ERROR SchemaExport - FEHLER: Typ ╗geometry½ existiert nicht Position: 94该错误是德语的,但意味着‘geometry型’类型不存在。
如果我使用create table语句,并在pgadmin中执行它,那么它将工作于find,所以我认为数据库设置正确。
我的版本:
postgres - 9.0 64Bit
postgis - 2.0.1 64Bit
hibernate-spatial - 4.0-M1
hibernate - 4.0.0-Final
postgis-jdbc - 1.5.2Thx请求帮助
JayBee
发布于 2015-02-01 01:27:31
您的Postgresql不支持几何图形。您需要为其添加postgis扩展才能创建空间数据库。因此,请从here下载适用于您postgresql的postgis扩展。然后将其安装在postgresql安装文件夹中,例如(在我的系统中),路径如下:
C:\Program Files (x86)\OpenGeo\OpenGeo Suite\pgsql\9.1https://stackoverflow.com/questions/14518130
复制相似问题