Hi Norman<br><br><br>Please Help .. <br><br>This my class definition ...<br><br>public class RoadNetwork {<br><br>private Geometry location=null;<br>private long id;<br><br>public long getId()<br>{<br>return id;<br>}<br><br>
public void setId(long id)<br>{<br><a href="http://this.id/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">this.id</a> = id;<br>}<br><br>public void setLocation(Geometry loc)<br>{<br>this.location
= loc;<br>}<br><br>public Geometry getLocation()<br>{<br>return location;
<br>}<br><br>}<br><br>My RoadNetwork.hbm.xml....<br><br><br><?xml version="1.0" encoding="UTF-8"?><br><br><!DOCTYPE hibernate-mapping PUBLIC<br> "-//Hibernate/Hibernate Mapping DTD 3.0
//EN"<br> "<a href="http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd
</a>"><br><br><hibernate-mapping<br>><br> <class<br>
name="hello.RoadNetwork"<br> table="Roads"<br> ><br><br> <id<br> name="id"<br> column="id"<br> type="java.lang.Long
"<br> ><br><br> <generator class="increment"><br><br> </generator><br> </id><br> <property<br> name="location"<br> type="
org.postgis.hibernate.GeometryT<div id="mb_4">ype"<br> update="true"<br> insert="true"<br> column="location"<br> /><br> </class><br></hibernate-mapping>
<div><div class="ea"><span id="e_10efb400d58305c5_1"><br><br>main method ..inserting in database...<br>{<br> SessionFactory sessions = new Configuration().configure().buildSessionFactory();<br> session =sessions.openSession
();<br> session.connection().setAutoCommit(true);<br> System.out.println("Inserting Record");<br><br> LineString geom = new LineString(lng_str);
<br> RoadNetwork net = new RoadNetwork();<br> net.setLocation(geom);<br> session.save(net);<br><br> session.flush();<br>
session.close();<br> System.out.println("Done");<br>}<br><br><br>Errors : I get <br><br> [java] Hibernate: insert into Roads (location, id) values (?, ?)<br> [java] 19:01:40,215 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState : null
<br> [java] 19:01:40,216 ERROR JDBCExceptionReporter:72 - Batch entry 0 insert i nto Roads (location, id) values (<stream of 105 bytes>, 1) was aborted. Call ge tNextException to see the cause.<br> [java] 19:01:40,217 WARN JDBCExceptionReporter:71 - SQL Error: 0, SQLState : 42804
<br> [java] 19:01:40,217 ERROR JDBCExceptionReporter:72 - ERROR: column "locatio n" is of type oid but expression is of type bytea<br> [java] 19:01:40,224 ERROR AbstractFlushingEventListener:300 - Could not syn chronize database state with session
<br> [java] org.hibernate.exception.SQLGrammarException: Could not execute JDBC batch update<br><br><br></span></div></div></div>