<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">Thanks a lot for your help.<br><br>Regards<br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message ----<br>From: Norman Barker &lt;nbarker@ittvis.com&gt;<br>To: PostGIS Users Discussion &lt;postgis-users@postgis.refractions.net&gt;<br>Sent: Friday, April 13, 2007 7:02:58 PM<br>Subject: RE: [postgis-users] RE: RE: RE: PostGIS - hibernate (new postgis.jar)<br><br><div>Hi,<br><br>Yes you should change the dialect type in persistence.xml to<br>PostGISDialect and include the java class in your archive.<br><br>It should then be possible to make spatial object queries e.g.<br><br>Query intersects = entityManager.createQuery("Select<br>spatial.Intersects(p.location, person.location) from
 PersonEntity p,<br>PersonEntity as person where person = :person");<br><br>intersects.setParameter("person", p);<br><br>then executing this query will return populated people objects who are<br>within the same area.<br><br>Norman<br><br><br>-----Original Message-----<br>From: postgis-users-bounces@postgis.refractions.net<br>[mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of<br>rabbiaqaswar<br>Sent: 13 April 2007 02:36<br>To: postgis-users@postgis.refractions.net<br>Subject: [postgis-users] RE: RE: RE: PostGIS - hibernate (new<br>postgis.jar)<br><br><br>Thanks a lot for your help. Earlier i just had the postgresql jdbc<br>driver &amp;<br>postgis.jar in my class path. In my entity bean POJO i did what was<br>mentioned in the ejb3spatial.pdf and included the package containing<br>your<br>GeometryType.java (user type) in my project. In the persistence.xml file<br>i<br>set the hibernate.dialect as org.hibernate.dialect.PostgreSQLDialect and<br>my<br>program was
 able to retrieve the data from the tables containing<br>geographical information.<br><br>So far things are good :) now should i add PostGISDialect in my<br>persistence.xml instead of org.hibernate.dialect.PostgreSQLDialect and<br>do i<br>have to include its java file with the GeometryType in my project? I am<br>a<br>complete newbie with geographical information related work so please<br>don't<br>mind my questions.<br><br>Many Thanks<br><br><br>Norman Barker-3 wrote:<br>&gt; <br>&gt; Hi,<br>&gt; <br>&gt; I appreciate your confusion it took me a while to work out what was<br>&gt; going on (I don't have commit access :-( )<br>&gt; <br>&gt; The dialect has been put in its own folder called hibernate at <br>&gt; <a target="_blank" href="http://svn.refractions.net/postgis/trunk/java/">http://svn.refractions.net/postgis/trunk/java/</a><br>&gt; <br>&gt; you will also need the user type from the ejb3 folder.&nbsp;&nbsp;Really they<br>&gt; should be together, my fault I should have
 communicated this better to<br>&gt; Markus.<br>&gt; <br>&gt; Let me know I can be of help.<br>&gt; <br>&gt; Thanks,<br>&gt; <br>&gt; Norman<br>&gt; <br>&gt; -----Original Message-----<br>&gt; From: postgis-users-bounces@postgis.refractions.net<br>&gt; [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of<br>&gt; rabbiaqaswar<br>&gt; Sent: 11 April 2007 23:38<br>&gt; To: postgis-users@postgis.refractions.net<br>&gt; Subject: [postgis-users] RE: RE: PostGIS - hibernate (new postgis.jar)<br>&gt; <br>&gt; <br>&gt; Hello<br>&gt; <br>&gt; Thanks for your reply. I found this <br>&gt; <a target="_blank" href="http://svn.refractions.net/postgis/trunk/java/ejb3/">http://svn.refractions.net/postgis/trunk/java/ejb3/</a> svn link&nbsp;&nbsp;from<br>your<br>&gt; earlier posts in this topic, which has that ejb3spatial.pdf file. Can<br>&gt; you<br>&gt; please tell me which svn link has the latest information.<br>&gt; <br>&gt; Many Thanks<br>&gt; <br>&gt; <br>&gt; <br>&gt;
 Norman Barker-3 wrote:<br>&gt;&gt; <br>&gt;&gt; Hi,<br>&gt;&gt; <br>&gt;&gt; There has been a lot of activity with the hibernate postgis driver,<br>&gt; just<br>&gt;&gt; everyone thinks it isn't of interest to the list and mail me<br>&gt; directly!!<br>&gt;&gt; (I have no problem with this). <br>&gt;&gt; <br>&gt;&gt; The major update is the spatial dialect for ejb3 (hibernate) allowing<br>&gt;&gt; you to make spatial queries in object space, e.g. select obj from<br>&gt;&gt; mytable where spatial.within(obj.box, ...) <br>&gt;&gt; <br>&gt;&gt; The code is in SVN, but I don't believe it is in postgis.jar, it is<br>&gt;&gt; heavily dependent on the JDBC driver and hibernate for its<br>&gt;&gt; functionality.<br>&gt;&gt; <br>&gt;&gt; Thanks,<br>&gt;&gt; <br>&gt;&gt; Norman<br>&gt;&gt; <br>&gt;&gt; -----Original Message-----<br>&gt;&gt; From: postgis-users-bounces@postgis.refractions.net<br>&gt;&gt; [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of<br>&gt;&gt;
 rabbiaqaswar<br>&gt;&gt; Sent: 10 April 2007 13:29<br>&gt;&gt; To: postgis-users@postgis.refractions.net<br>&gt;&gt; Subject: [postgis-users] RE: PostGIS - hibernate (new postgis.jar)<br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; Thankyou all for the support.<br>&gt;&gt; <br>&gt;&gt; I&nbsp;&nbsp;am using EJB3 with PostgreSQL &amp; JBoss. Read through the tutorial<br>on<br>&gt;&gt; svn<br>&gt;&gt; by Norman Barker. I compiled the GeometryType java file in<br>&gt;&gt; org.postgis.hibernate and included the org.postgis.hibernate package<br>&gt; in<br>&gt;&gt; my<br>&gt;&gt; classpath and the whole thing worked.<br>&gt;&gt; <br>&gt;&gt; Since the last post on this forum was in November 2006, i wanted to<br>&gt; know<br>&gt;&gt; that is there any change in the method to handle gis data from<br>&gt;&gt; postgresql<br>&gt;&gt; tables using ejb3 architecture? Is the GeometryType class by Norman<br>&gt;&gt; included<br>&gt;&gt; in the latest release of postgis.jar or should it be
 included<br>&gt; seperately<br>&gt;&gt; like i mentioned above?<br>&gt;&gt; <br>&gt;&gt; Thanks again<br>&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; Norman Barker-3 wrote:<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; I think I missed the start of this thread (and I can't find it in<br>the<br>&gt;&gt;&gt; archives), can you summarize the problem, and the server you are<br>&gt;&gt; using?<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; The GeometryUserType class doesn't do very much but call out to the<br>&gt;&gt;&gt; utility functions provided in the postgis jar, so it does sound like<br>&gt; a<br>&gt;&gt;&gt; classpath issue.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; If you can send me a summary I will try to recreate the problem.&nbsp;&nbsp;(I<br>&gt;&gt;&gt; have both tomcat and jboss set up here).<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; If the attachment is large please send it to<br>&gt;&gt; norman.barker&lt;at&gt;gmail.com<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Thanks,<br>&gt;&gt;&gt;
 <br>&gt;&gt;&gt; Norman<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; -----Original Message-----<br>&gt;&gt;&gt; From: postgis-users-bounces@postgis.refractions.net<br>&gt;&gt;&gt; [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of<br>&gt;&gt; Jan<br>&gt;&gt;&gt; Syryn<br>&gt;&gt;&gt; Sent: 27 November 2006 16:39<br>&gt;&gt;&gt; To: 'PostGIS Users Discussion'<br>&gt;&gt;&gt; Subject: RE: [postgis-users] PostGIS - hibernate (new postgis.jar)<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; ***********************<br>&gt;&gt;&gt; Warning: Your file, postgis2.jar, contains more than 32 files after<br>&gt;&gt;&gt; decompression and cannot be scanned.<br>&gt;&gt;&gt; ***********-***********<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Hi Markus,<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; The thing I did to be able to continue is I have created a<br>&gt;&gt;&gt; postgis_addon.jar<br>&gt;&gt;&gt; lib that contained only new stuff like BinaryWriter.class and<br>&gt;&gt;&gt;
 GeometryUserType.<br>&gt;&gt;&gt; And that works. It does not solve the problem, though I can use the<br>&gt;&gt;&gt; latest<br>&gt;&gt;&gt; version of postgis.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; I tried to use the tip I found in my previous posting by changing<br>the<br>&gt;&gt;&gt; name<br>&gt;&gt;&gt; of the postgresql-jdbc.jar drvier to pg-jdbc.jar driver with my new<br>&gt;&gt;&gt; build<br>&gt;&gt;&gt; postgis2.jar (version 1.1.5)<br>&gt;&gt;&gt; I did not help.&nbsp;&nbsp;<br>&gt;&gt;&gt; If I remove the 2 stub files (PGConnection and Connection) from<br>&gt;&gt;&gt; postgis2.jar<br>&gt;&gt;&gt; : same result.<br>&gt;&gt;&gt; It stucks again on "No suitable driver".<br>&gt;&gt;&gt; If I replace the postgis2.jar by postgis.jar(1.1.0) and<br>&gt;&gt;&gt; postgis_addon.jar by<br>&gt;&gt;&gt; changing the settings on the classpath, everything works again.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; So, I assume there is a thing in postgis2.jar.<br>&gt;&gt;&gt; And to create my
 postgis2.jar, I made a separate project in Eclipse,<br>&gt;&gt;&gt; created<br>&gt;&gt;&gt; a jar file of almost all java files(exl examples). This should do<br>it,<br>&gt;&gt; no<br>&gt;&gt;&gt; ?<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Anyway, I included my postgis2.jar so maybe one can replace his one<br>&gt;&gt; with<br>&gt;&gt;&gt; mine and see what that does.<br>&gt;&gt;&gt; Or maybe one sees what I am doing wrong elsewhere...<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; TIA,<br>&gt;&gt;&gt; Jan<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; -----Original Message-----<br>&gt;&gt;&gt; From: postgis-users-bounces@postgis.refractions.net<br>&gt;&gt;&gt; [mailto:postgis-users-bounces@postgis.refractions.net] On Behalf Of<br>&gt;&gt;&gt; Markus<br>&gt;&gt;&gt; Schaber<br>&gt;&gt;&gt; Sent: samedi 25 novembre 2006 10:16<br>&gt;&gt;&gt; To: PostGIS Users Discussion<br>&gt;&gt;&gt; Subject: Re: [postgis-users] RE: RE: RE: PostGIS - hibernate - EJB3<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Hi,<br>&gt;&gt;&gt;
 <br>&gt;&gt;&gt; Norman Barker wrote:<br>&gt;&gt;&gt; <br>&gt;&gt;&gt;&gt; 2. In the thread here, people are using:<br>&gt;&gt;&gt;&gt; &lt;driver-class&gt;org.postgis.DriverWrapper&lt;/driver-class&gt;<br>&gt;&gt;&gt;&gt; When I do the same, I get a "No suitable driver" exception.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; [...]<br>&gt;&gt;&gt;&gt; 3. I wanted to use the GeometryType that is packed in PostGIS<br>1.1.5.<br>&gt;&gt;&gt;&gt; After generating the new JAR and replacing the old one by this one,<br>&gt; I<br>&gt;&gt; <br>&gt;&gt;&gt;&gt; start getting new exceptions:<br>&gt;&gt;&gt;&gt; The class org.postgis.PGbox3d does not implement <br>&gt;&gt;&gt;&gt; org.postgresql.util.PGobject.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Those 2 things look like a classpath/classloader problem.<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; You have to make sure that the postgis.jar and the<br>&gt; postgresql-jdbc.jar<br>&gt;&gt;&gt; are<br>&gt;&gt;&gt; available via the same classloader (and that you
 don't have two<br>&gt;&gt;&gt; incarnations<br>&gt;&gt;&gt; of them in your classpath)<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; HTH,<br>&gt;&gt;&gt; Markus<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt;&gt; --<br>&gt;&gt;&gt; Markus Schaber | Logical Tracking&amp;Tracing International AG<br>&gt;&gt;&gt; Dipl. Inf.&nbsp;&nbsp;&nbsp;&nbsp; | Software Development GIS<br>&gt;&gt;&gt; <br>&gt;&gt;&gt; Fight against software patents in Europe! <a target="_blank" href="http://www.ffii.org">www.ffii.org</a><br>&gt;&gt;&gt; <a target="_blank" href="http://www.nosoftwarepatents.org">www.nosoftwarepatents.org</a><br>&gt;&gt;&gt; _______________________________________________<br>&gt;&gt;&gt; postgis-users mailing list<br>&gt;&gt;&gt; postgis-users@postgis.refractions.net<br>&gt;&gt;&gt; <a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt;&gt;&gt; <br>&gt;&gt;&gt;
 _______________________________________________<br>&gt;&gt;&gt; postgis-users mailing list<br>&gt;&gt;&gt; postgis-users@postgis.refractions.net<br>&gt;&gt;&gt; <a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt;&gt;&gt; <br>&gt;&gt;&gt; <br>&gt;&gt; <br>&gt;&gt; -- <br>&gt;&gt; View this message in context:<br>&gt;&gt;<br>&gt;<br><a target="_blank" href="http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9926716">http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9926716</a><br>&gt;&gt; Sent from the PostGIS - User mailing list archive at Nabble.com.<br>&gt;&gt; <br>&gt;&gt; _______________________________________________<br>&gt;&gt; postgis-users mailing list<br>&gt;&gt; postgis-users@postgis.refractions.net<br>&gt;&gt; <a target="_blank"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt;&gt; _______________________________________________<br>&gt;&gt; postgis-users mailing list<br>&gt;&gt; postgis-users@postgis.refractions.net<br>&gt;&gt; <a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt;&gt; <br>&gt;&gt; <br>&gt; <br>&gt; -- <br>&gt; View this message in context:<br>&gt;<br><a target="_blank" href="http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9953356">http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9953356</a><br>&gt; Sent from the PostGIS - User mailing list archive at Nabble.com.<br>&gt; <br>&gt; _______________________________________________<br>&gt; postgis-users mailing list<br>&gt; postgis-users@postgis.refractions.net<br>&gt; <a target="_blank"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt; _______________________________________________<br>&gt; postgis-users mailing list<br>&gt; postgis-users@postgis.refractions.net<br>&gt; <a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>&gt; <br>&gt; <br><br>-- <br>View this message in context:<br><a target="_blank" href="http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9974998">http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a9974998</a><br>Sent from the PostGIS - User mailing list archive at Nabble.com.<br><br>_______________________________________________<br>postgis-users mailing list<br>postgis-users@postgis.refractions.net<br><a target="_blank"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>_______________________________________________<br>postgis-users mailing list<br>postgis-users@postgis.refractions.net<br><a target="_blank" href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></div><br></div></div><br>



      <hr size=1>Ahhh...imagining that irresistible "new car" smell?<br> Check out
<a href="http://us.rd.yahoo.com/evt=48245/*http://autos.yahoo.com/new_cars.html;_ylc=X3oDMTE1YW1jcXJ2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDbmV3LWNhcnM-">new cars at Yahoo! Autos.</a>
</body></html>