I want to bind a PostgreSQL column ("b_shp")
of type "geometry".
In particular the following query give "POLYGON" result:
SELECT GeometryType(b_shp) ==> "POLYGON"
I can't find the right annotation for the @Column "b_shp"
in my @Entity.
I've tried these annotations:
@Column(name="b_shp", columnDefinition="geometry(MultiPolygon,4326)")
private com.vividsolutions.jts.geom.MultiPolygon b_shp;
and:
@Column(name="b_shp", columnDefinition="geometry")
private com.vividsolutions.jts.geom.Geometry b_shp;
obtaining this error:
ERROR:
javax.ejb.EJBException: java.lang.IllegalStateException: Received object of type org.postgresql.util.PGobject
I'm using:
<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>
What is the right annotation?