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">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">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.GeometryType"<br>            update="true"<br>            insert="true"<br>            column="location"<br>         /><br>  </class><br></hibernate-mapping>
<br><br><br><br><br><br><br><br><br><div><span class="gmail_quote">On 11/17/06, <b class="gmail_sendername">Norman Barker</b> <<a href="mailto:nbarker@ittvis.com">nbarker@ittvis.com</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;">
Hi Sandeep,<br><br>the hibernate driver is at <a href="http://svn.refractions.net/postgis/trunk/java/ejb3/src/org/postgis/hibernate/GeometryType.java">http://svn.refractions.net/postgis/trunk/java/ejb3/src/org/postgis/hibernate/GeometryType.java
</a><br>and as I understand it this is sufficient for hibernate to persist Geometry types, or use in JBoss EJB3.  This hibernate driver in turn uses postgis.jar, which in turn uses the postgresql driver.<br><br>There has been a lot said about EJB3 versus Spring with Hibernate (and I have taken your bait!!).   I guess it is down to the level (scalable) of the system you want to build and whether you want to follow enterprise standards (EJB3 is the standard that builds on top of the lessons learnt in Hibernate and Spring IoC).  I would use either since JPA is also a standard, but I will be looking to port to Geronimo as soon as they get EJB3 to give container options; my reasons for EJB3 were
<br><br>(1) Scalability via clustering - this is very important for catalogs for disaster / crisis management<br>(2) Declarative security<br>(3) Transaction Management (potential WFS)<br>(4) Stateful sessions (for other parts of my app)
<br><br>Suddenly I was using more of a J2EE container than a lightweight framework.  I would say JBoss is light as well though!<br><br>The most important thing here is the Hibernate POJO Geometry Driver for PostGIS, the framework doesn't matter too much. If you want the PostGIS, Hibernate (JBoss EJB3) stack to go into a different direction (Spring) give me a compelling reason - or lets work together to make this stack 'enterprise ready' for the community!
<br><br>Let me know if you need any help.<br><br>Norman<br><br><br>-----Original Message-----<br>From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a> on behalf of Sandeep Kumar Jakkaraju
<br>Sent: Thu 11/16/2006 5:58 PM<br>To: PostGIS Users Discussion<br>Subject: Re: [postgis-users] Hibernate with PostGIS<br><br>Hi Norman<br><br>For using Hibernate with postgis ..i can directly use ur postgis.jar !!<br>right ...??
<br><br>Your Tutorial mainly aimed at using EJB3 with postgis ...<br>did u think of using Spring instead of EJB3 !! ??<br><br>Thanks<br>Sandeep<br><br><br><br>On 11/16/06, Norman Barker <<a href="mailto:nbarker@ittvis.com">
nbarker@ittvis.com</a>> wrote:<br>><br>>  Sandeep,<br>><br>><br>><br>> To use JBoss EJB3 with PostGIS I had to write a Hibernate Geometry Driver,<br>> the source code is in PostGIS SVN (LGPL) and there is a tutorial available
<br>> here<br>><br>> -<br>> <a href="http://postgis.refractions.net/support/wiki/index.php?SpatialEJB3">http://postgis.refractions.net/support/wiki/index.php?SpatialEJB3</a><br>><br>><br>><br>> It allows creation and updates through Java, the tutorial walks you
<br>> through a simple SOAP example.<br>><br>><br>><br>> I am very interested in using the hibernate lucene annotations (<br>> <a href="http://www.hibernate.org/hib_docs/annotations/reference/en/html/lucene.html">
http://www.hibernate.org/hib_docs/annotations/reference/en/html/lucene.html</a>)<br>> in conjunction with the Geometry driver to create some sort of catalog; so<br>> that we can do a proper geometry search on PostGIS through the business
<br>> layer (not just boxes!) and then seach on metadata with Lucene.<br>><br>><br>><br>> A couple of people have expressed interest in this hibernate geometry<br>> driver for Java, please give me some feedback on the future direction you
<br>> want this to go.<br>><br>><br>><br>> Thanks,<br>><br>><br>><br>> Norman<br>><br>><br>>  ------------------------------<br>><br>> *From:* <a href="mailto:postgis-users-bounces@postgis.refractions.net">
postgis-users-bounces@postgis.refractions.net</a> [mailto:<br>> <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>] *On Behalf Of *Sandeep<br>> Kumar Jakkaraju
<br>> *Sent:* 16 November 2006 15:30<br>> *To:* PostGIS Users Discussion<br>> *Subject:* [postgis-users] Hibernate with PostGIS<br>><br>><br>><br>> Hi All<br>><br>> I want to know if i can use Hibernate with PostGIS ??
<br>> if yes ..then can some one point me to some doc which tells abt this !!<br>><br>> I am just skeptical about the geometry column !!<br>><br>> Thanks<br>> Sandeep<br>><br>> _______________________________________________
<br>> postgis-users mailing list<br>> <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>><br>><br>><br><br><br>--<br>Sandeep Kumar Jakkaraju<br>WeBlog:<br><a href="http://jakkarajus.blogspot.com">http://jakkarajus.blogspot.com</a><br>
<br><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
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>