[Lada-commits] [PATCH 04 of 13] Use Postgis dialect to talk to the database

Wald Commits scm-commit at wald.intevation.org
Fri May 29 11:48:14 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1432300374 -7200
# Node ID e6564d5fdc7acc505a5248e65d4c389dad1c6615
# Parent  aeae6a81f28e953152a088eb39c0c3a20d0930f7
Use Postgis dialect to talk to the database.

diff -r aeae6a81f28e -r e6564d5fdc7a src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/intevation/lada/util/data/LadaPostgisDialect.java	Fri May 22 15:12:54 2015 +0200
@@ -0,0 +1,12 @@
+package de.intevation.lada.util.data;
+
+import java.sql.Types;
+
+import org.hibernate.spatial.dialect.postgis.PostgisDialect;
+
+public class LadaPostgisDialect extends PostgisDialect {
+    public LadaPostgisDialect() {
+        super();
+        this.registerColumnType(Types.ARRAY, "integer[]");
+    }
+}
diff -r aeae6a81f28e -r e6564d5fdc7a src/main/java/de/intevation/lada/util/data/LadaPostgreSQLDialect.java
--- a/src/main/java/de/intevation/lada/util/data/LadaPostgreSQLDialect.java	Fri May 22 15:11:40 2015 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-package de.intevation.lada.util.data;
-
-import java.sql.Types;
-
-import org.hibernate.dialect.PostgreSQL9Dialect;
-
-public class LadaPostgreSQLDialect extends PostgreSQL9Dialect {
-    public LadaPostgreSQLDialect() {
-        super();
-        this.registerColumnType(Types.ARRAY, "integer[]");
-    }
-
-}
diff -r aeae6a81f28e -r e6564d5fdc7a src/main/resources/META-INF/persistence.xml
--- a/src/main/resources/META-INF/persistence.xml	Fri May 22 15:11:40 2015 +0200
+++ b/src/main/resources/META-INF/persistence.xml	Fri May 22 15:12:54 2015 +0200
@@ -3,35 +3,31 @@
    xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
     <persistence-unit name="bund">
-        <!--provider>org.hibernate.jpa.HibernatePersistenceProvider</provider-->
         <jta-data-source>java:/jboss/lada-bund</jta-data-source>
         <exclude-unlisted-classes>false</exclude-unlisted-classes>
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/bund"/>
             <!-- Properties for Hibernate -->
             <property name="hibernate.show_sql" value="false" />
-            <property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgreSQLDialect"/>
+            <property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
-            <!-- property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform" /--> 
        </properties>
    	</persistence-unit>
    	<persistence-unit name="land">
-   	    <provider>org.hibernate.ejb.HibernatePersistence</provider>
-        <jta-data-source>java:/jboss/lada-land</jta-data-source>
+   	    <jta-data-source>java:/jboss/lada-land</jta-data-source>
        	<exclude-unlisted-classes>false</exclude-unlisted-classes>
     	<properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/land"/>
             <property name="hibernate.show_sql" value="true" />
-			<property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgreSQLDialect"/>
+			<property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgisDialect"/>
             <property name="hibernate.hbm2ddl.auto" value="none"/>
        </properties>
     </persistence-unit>
     <persistence-unit name="stamm">
-        <provider>org.hibernate.ejb.HibernatePersistence</provider>
         <jta-data-source>java:/jboss/lada-stamm</jta-data-source>
         <properties>
             <property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/stamm"/>
-			<property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgreSQLDialect"/>
+			<property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
             <property name="hibernate.show_sql" value="true" />
             <property name="hibernate.hbm2ddl.auto" value="none"/>
         </properties>


More information about the Lada-commits mailing list