I want to use hibernate spatial to handle my spatial objects.I am using hibernate-spatial-4.0.1
with hibernate 4.2
. My dialect:
<property name="hibernate.dialect"> org.hibernate.spatial.dialect.postgis.PostgisDialect</property>
I have an Entity like this:
@Entity
@DiscriminatorValue(CK.LAYER_PICTURES)
public class PicsLayerItem extends LayerItem {
@Column(name = "place_name")
private String placeName;
public void setPlaceName(String name) {
this.placeName = name;
}
public String getPlaceName() {
return this.placeName;
}
@Type(type = "org.hibernate.spatial.GeometryType")
@Column(name = "locations", nullable = true)
private LineString locations;
public LineString getLocations() {
return locations;
}
}
The problem that when hibernate updates schema, it faced this error:
ERROR [http-nio-8084-exec-53] org.hibernate.tool.hbm2ddl.SchemaUpdate.execute HHH000388: Unsuccessful: alter table public.tree_item add column locations GEOMETRY
ERROR [http-nio-8084-exec-53] org.hibernate.tool.hbm2ddl.SchemaUpdate.execute ERROR: type "geometry" does not exist
I guess my postgresql does not support the geomtry types. I use PgAdminIII. It is postgis. It supports data types like polygon
.
What can I do solving this problem?
Similar question with no answer: Type geometry not found with postgis and hibernate-spatial