我想绑定一个("b_shp")
“几何”类型的 PostgreSQL 列。特别是以下查询给出“POLYGON”结果:
SELECT GeometryType(b_shp) ==> "POLYGON"
@Column "b_shp"
我在@Entity 中找不到正确的注释。
我试过这些注释:
@Column(name="b_shp", columnDefinition="geometry(MultiPolygon,4326)")
private com.vividsolutions.jts.geom.MultiPolygon b_shp;
和:
@Column(name="b_shp", columnDefinition="geometry")
private com.vividsolutions.jts.geom.Geometry b_shp;
获得此错误:
ERROR:
javax.ejb.EJBException: java.lang.IllegalStateException: Received object of type org.postgresql.util.PGobject
我在用着:
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.0.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-spatial</artifactId>
<version>5.0.4.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>5.0.4.Final</version>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>9.4-1205-jdbc42</version>
</dependency>
<dependency>
<groupId>org.postgis</groupId>
<artifactId>postgis-jdbc</artifactId>
<version>1.3.3</version>
</dependency>
什么是正确的注释?