[postgis-users] RE: RE: PostGIS - hibernate - EJB3

Norman Barker nbarker at ittvis.com
Tue Sep 5 05:48:31 PDT 2006


Hi,

I have been a bit busy, but it is my intention to write a simple 'spatial' tutorial on EJB3 using the postgis geometry type, the functionality will be simple but should get you started.  I know I said I would have it done by last w/end so I will put it top on my priority list.

Apologies for the delay, posting code with no instructions is bad!

Norman 


-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net on behalf of coster
Sent: Tue 9/5/2006 6:49 AM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] RE: RE: PostGIS - hibernate - EJB3
 

hi, 
I have the same problem with JBoss and EJB3. 
The column is type "oid" instead of "geometry".

I would be very grateful for a solution - here are my postgis-ds.xml and my
persistence.xml:

<datasources>
  <local-tx-datasource>
    <jndi-name>PostgisDS</jndi-name>
    <connection-url>jdbc:postgresql://xxx:5432/tourguide</connection-url>
    <driver-class>org.postgis.DriverWrapper</driver-class>
    <user-name>xxx</user-name>
    <password>xxx</password>
    <new-connection-sql>select 1</new-connection-sql>
    <check-valid-connection-sql>select 1</check-valid-connection-sql>  
    <metadata>
       <type-mapping>PostgreSQL 8.1</type-mapping>
    </metadata>
  </local-tx-datasource>
</datasources>

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
    <persistence-unit name="tourguide">
        <jta-data-source>java:/PostgisDS</jta-data-source>      		
        <properties>
            <property name="hibernate.dialect"
value="org.hibernate.dialect.PostgreSQLDialect"/>
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="hibernate.show_sql" value="true"/>            
         </properties>        
    </persistence-unit>
</persistence>

Thanks!
Christian.


Norman Barker-3 wrote:
> 
> 
> 
> -----Original Message-----
> From: postgis-users-bounces at postgis.refractions.net
> [mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
> croisfert
> Sent: Monday, August 21, 2006 2:54 AM
> To: postgis-users at postgis.refractions.net
> Subject: [postgis-users] RE: PostGIS - hibernate - EJB3
> 
> 
> hi,  I am trying to use custom UserType, but it work fine in a pure
> Hibernate
> implementation , but not in JBOSS EJB3, the generated geometry column in
> postgres is of type "oid" instead of "geometry"    You have any
> suggestion,
> i am using jboss-EJB-3.0_RC8-FD and postgis 1.1.3 (on postgres 8.1.4)
> 
> 
> thanks.
> -- 
> 
> 
> Make sure that the usertype is available on your classpath, I have only
> tested it with the Geometry Column type (as the name implies!!), I also
> set up postgis as a datasource within JBoss - postgis-ds.xml, and
> configured the persistence.xml.  I am writing up a doc for this shortly;
> just don't have too much time this week.
> 
> Norman
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> 

-- 
View this message in context: http://www.nabble.com/PostGIS---hibernate---EJB3-tf2064211.html#a6146402
Sent from the PostGIS - User forum at Nabble.com.

_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20060905/378b55cf/attachment.html>


More information about the postgis-users mailing list