(no subject)

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

(no subject)

orkun
hello

I am using postgis 2.0svn, postgresql 9.2, hibernate 4, jboss as 7.1


here is my entity

    @Id
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }
    private Integer id;

    @Type(type = "org.hibernate.spatial.GeometryType")
    public com.vividsolutions.jts.geom.Point getLoc() {return
(com.vividsolutions.jts.geom.Point )loc;    }
    public void setLoc(com.vividsolutions.jts.geom.Point loc) {
        this.loc = loc;
    }
    private  com.vividsolutions.jts.geom.Point loc;

it creates geometry column in postgis

----
And I tried to persist it.

 member.setLoc((Point)geom);
 em.persist(member);

As a result I got:

20:29:34,838 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper]
(http--127.0.0.1-8080-2) 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.
20:29:34,840 INFO
[org.hibernate.engine.jdbc.batch.internal.AbstractBatchImpl]
(http--127.0.0.1-8080-2) HHH000010: On release of batch it still
contained JDBC statements


What do I do wrong ?

regards

----

--
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı


________________________

Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency
_______________________________________________
hibernatespatial-users mailing list
[hidden email]
http://www.hibernatespatial.org/cgi-bin/mailman/listinfo/hibernatespatial-users