PSQLException: can't infer the SQL type to use for an instance of org.postgis.PGgeometry

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

PSQLException: can't infer the SQL type to use for an instance of org.postgis.PGgeometry

Maurizio Bonani
Greetings,
I'm trying to set up a simple web project with JPA annotations using
Hibernate Spatial on JBoss 7.0.2 (with a Hibernate 3.6.7 module
instead of the 4 one, which is unsupported by Hibernate Spatial
right?).  My DB is PostgreSQL with PostGIS extension. I'm able to
interact with the DB using the @PersistenceContext annotated
EntityManager, however when I try to persist a simple Entity with a
Geometry type, I get the following exception:

Can't infer the SQL type to use for an instance of
<<org.postgis.PGgeometry>>. Use setObject() with an explicit Types
value to specify the type to use.

The Geometry field of my Entity class is annotated in the following way:

@Column(name = "coordinates", columnDefinition = "Geometry")
@Type(type = "org.hibernatespatial.GeometryUserType")
public Point getCoordinates() {
   return this.coordinates;
}

Does this seem right?

Thanks for any advice.

Regards,
Maurizio
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users