Subversion Repositories hibernate-spatial

Rev

Rev 40 | Rev 170 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<?xml version="1.0" encoding="UTF-8"?>

<document>
        <header />


        <body>
                <section name="Hibernate Spatial Postgis Provider Usage">
                        <p>
                                To have Hibernate Spatial use this provider, simply drop
                                the jar on the class-path alongside the
                                hibernate-spatial.jar. When the Hibernate Spatial
                                library is loaded it will find the provider and use it
                                to retrieve the Hibernate dialect for Postgresql with
                                the Postgis extension. This dialect is a subclass of
                                <code>org.hibernate.dialect.PostgreSQLDialect</code>
                        </p>
                        <p>
                                With the provider installed, you can use it by setting
                                the dialect in the Hibernate configuration file as in
                                the following snippet.
                        </p>
                        <source>
... 
        &lt;property name="hibernate.dialect"&gt;
                org.hibernatespatial.postgis.PostgisDialect
        &lt;/property&gt; 
...
                        </source>

                        <p>
                                When there is more than one Hibernate Spatial provider
                                on the Class-Path, you should explicitly label the
                                dialect for the Geometry valued properties.
                        </p>
                        <source>
... 
        &lt;property name="geometry"
                type="org.hibernatespatial.GeometryUserType"&gt;
                &lt;column name="geom" /&gt; 
                &lt;param name="dialect"&gt;postgis&lt;/param&gt;
        &lt;/property&gt; 
...
                        </source>
                </section>

        </body>
</document>