Hello Jan ..<br><br>Thanks for ur reply .. u r right i am newbie in Hibernate and Spring !! <br><br>I thought that creating table schema automatically is a GOOD feature of Hibernate ..<br><br>For example:-<br><br>If your application is using some tables .. u create those tables in your db ..
<br>but when u want to use some other db ..u have to send all the sql scripts with schema.. and some has to run it ...to create the table schemas... <br>But If you u r using hibernate ...there is no need for this ..because it automatically creates the table schemas .. 
<br><br>Please correct do me ..if my argument is wrong ..<br><br>With Hibernate-PostGIS .. it is not able to create the Geometry column automatically .. i thought it was <span style="font-weight: bold;">BUG </span>which needed attention .. so i posted it ... 
<br><br>I have no other problem with using Hibernate with postgis ....<br><br>I really appreciate  ur other suggestions as well..<br><br>Thanks <br>Regards<br>Sandeep<br><br><br><br><div><span class="gmail_quote">On 11/22/06, 
<b class="gmail_sendername">Jan Syryn</b> <<a href="mailto:jan.syryn@trasys.be">jan.syryn@trasys.be</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Hi Sandeep,</font></span><br></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I am also doing a project with PostgresSQL/PostGIS and 
Hibernate.</font></span></div>
<div dir="ltr" align="left"><span></span>  </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">In general: it seems that you are lacking a common 
knowledge of Hibernate in general and that you problems are merely related to 
Hibernate than to PostGIS.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">In a normal Hibernate situation, you don't need to create 
the database schema automatically, so you should not use the property 
hbm2dll.auto.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">I propose you leave it out of you config 
file.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">You just create the Geometry column in your table of the 
DB.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Also, it is a good practice to add a constructor to your 
POJO objects This helps of easely creating objects that need to persisted in the 
database </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Little suggestion: </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">- make the geometry column 
nullable. </font></span><span><font color="#0000ff" face="Arial" size="2">With the correction of Dave you should be able of doing so 
with the GeometryUserType.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">- Add for exemple an extra 'name' field to your 
table.</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">- Try to add a line in your DB without the geometry column. 
</font></span></div>
<div dir="ltr" align="left"><span><font face="Arial"><font color="#0000ff" size="2">for exemple: </font></font></span></div>
<div dir="ltr" align="left"><span><font face="Arial"><font color="#0000ff" size="2">      session.save(new 
RoadNetwork("sandeep"))</font></font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">This way, you know a) your keygenerator works b) a session 
is well intantiated c) transaction did work</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">- If this goes well, try to use the postgis 
component:</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">      Geometry myGeom = 
factory.createGeometry();</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">      session.save(new 
RoadNetwork("sandeep",myGeom))</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">HIH (I hope it helps), </font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">Jan</font></span></div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2"></font></span> </div>
<div dir="ltr" align="left"><span><font color="#0000ff" face="Arial" size="2">PS: I am also using Spring. But this is not your problem. 
The use of Spring only complicate the things. Try to get the thing fired as 
simple as possible. Then start building things up from 
there.</font></span></div><br>
<div dir="ltr" align="left" lang="en-us">
<hr>
<font face="Tahoma" size="2"><b>From:</b> 
<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a> 
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">postgis-users-bounces@postgis.refractions.net</a>] <b>On Behalf Of 
</b>Sandeep Kumar Jakkaraju<br><b>Sent:</b> samedi 18 novembre 2006 
15:54<span class="q"><br><b>To:</b> PostGIS Users Discussion<br><b>Subject:</b> Re: 
[postgis-users] Hibernate with PostGIS<br></span></font><br></div>
<div><span class="e" id="q_10f1014ffaeccbd4_3"><div></div><br>I think Hibernate cannot create that Geometry column 
automatically !!! <br>is it something to do with hbm2ddl.auto !! <br><br><br>I 
am able to ..get the geometry from a table with geometry column already created 
...<br><br>Norman -->> Would you like me to create a simple tutorial on 
how to use Hibernate with Postgis ..your tutorial .. is not easy to understand 
...<br><br><br>Thanks<br>Sandeep<br><br><br><br></span></div></div>

<br>_______________________________________________<br>postgis-users mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net
</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Sandeep Kumar Jakkaraju <br>WeBlog:<br><a href="http://jakkarajus.blogspot.com">http://jakkarajus.blogspot.com</a>