diff --git a/hibernate-spatial/databases/postgis/jdbc/postgis-jdbc-1.5.2.jar b/hibernate-spatial/databases/postgis/jdbc/postgis-jdbc-1.5.2.jar new file mode 100644 index 0000000000..5c063f65e6 Binary files /dev/null and b/hibernate-spatial/databases/postgis/jdbc/postgis-jdbc-1.5.2.jar differ diff --git a/hibernate-spatial/databases/postgis/matrix.gradle b/hibernate-spatial/databases/postgis/matrix.gradle new file mode 100644 index 0000000000..78c7bc8678 --- /dev/null +++ b/hibernate-spatial/databases/postgis/matrix.gradle @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * Copyright (c) 2011, Red Hat Inc. or third-party contributors as + * indicated by the @author tags or express copyright attribution + * statements applied by the authors. All third-party contributions are + * distributed under license by Red Hat Inc. + * + * This copyrighted material is made available to anyone wishing to use, modify, + * copy, or redistribute it subject to the terms and conditions of the GNU + * Lesser General Public License, as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this distribution; if not, write to: + * Free Software Foundation, Inc. + * 51 Franklin Street, Fifth Floor + * Boston, MA 02110-1301 USA + */ +jdbcDependency "postgresql:postgresql:8.4-701.jdbc4" \ No newline at end of file diff --git a/hibernate-spatial/databases/postgis/resources/hibernate.properties b/hibernate-spatial/databases/postgis/resources/hibernate.properties new file mode 100644 index 0000000000..b126326228 --- /dev/null +++ b/hibernate-spatial/databases/postgis/resources/hibernate.properties @@ -0,0 +1,42 @@ +# +# Hibernate, Relational Persistence for Idiomatic Java +# +# Copyright (c) 2011, Red Hat Inc. or third-party contributors as +# indicated by the @author tags or express copyright attribution +# statements applied by the authors. All third-party contributions are +# distributed under license by Red Hat Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# Lesser General Public License, as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License +# for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this distribution; if not, write to: +# Free Software Foundation, Inc. +# 51 Franklin Street, Fifth Floor +# Boston, MA 02110-1301 USA +# + +hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisDialect +hibernate.connection.driver_class org.postgresql.Driver +hibernate.connection.url jdbc:postgresql://localhost:5432:hibbrtru +hibernate.connection.username hibbrtru +hibernate.connection.password hibbrtru + + +hibernate.connection.pool_size 5 + +hibernate.show_sql true +hibernate.format_sql true + +hibernate.max_fetch_depth 5 + +hibernate.cache.region_prefix hibernate.test +hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory + + diff --git a/hibernate-spatial/databases/postgis/resources/postgis-functions-test.xml b/hibernate-spatial/databases/postgis/resources/postgis-functions-test.xml new file mode 100644 index 0000000000..5d09dd0829 --- /dev/null +++ b/hibernate-spatial/databases/postgis/resources/postgis-functions-test.xml @@ -0,0 +1,78 @@ + + + + 1 + POINT + POINT(10 5) + 4326 + + + 2 + POINT + POINT(79 79) + 4326 + + + 3 + POINT + POINT(50 50) + 4326 + + + 4 + POINT + POINT(10 20) + 4326 + + + 5 + POINT + POINT(-4 -5) + 4326 + + + + 6 + LINESTRING + LINESTRING(10.0 5.0, 20.0 15.0) + 4326 + + + + 7 + LINESTRING + LINESTRING(10.0 5.0 1, 20.0 15.0 2, 30.3 22.4 5, 10 30.0 2) + 4326 + + + + 8 + LINESTRING + LINESTRING(10.0 5.0 1 1, 20.0 15.0 2 3, 30.3 22.4 5 10, 10 30.0 2 12) + 4326 + + + + 9 + MULTILINESTRING + MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40 14.0)) + + 4326 + + + + 10 + POLYGON + POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) ) + 4326 + + + + 11 + MULTIPOLYGON + MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((15 10, 12 14, 13 13, 15 10)) ) + 4326 + + + + diff --git a/hibernate-spatial/databases/postgis/resources/test-data-set.xml b/hibernate-spatial/databases/postgis/resources/test-data-set.xml new file mode 100644 index 0000000000..95cba85ade --- /dev/null +++ b/hibernate-spatial/databases/postgis/resources/test-data-set.xml @@ -0,0 +1,298 @@ + + + 1 + POINT + POINT(10 5) + 0 + + + 2 + POINT + POINT(52.25 2.53) + 4326 + + + + 3 + POINT + POINT(150000 200000) + 31370 + + + 4 + POINT + POINT(10.0 2.0 1.0 3.0) + 4326 + + + + 5 + LINESTRING + LINESTRING(10.0 5.0, 20.0 15.0) + 4326 + + + + 6 + LINESTRING + LINESTRING(10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0) + 4326 + + + + 7 + LINESTRING + LINESTRING(10.0 5.0 0.0, 20.0 15.0 3.0) + 4326 + + + + 8 + LINESTRING + LINESTRING(10.0 5.0 0.0 0.0, 20.0 15.0 3.0 1.0) + 4326 + + + + 9 + LINESTRING + LINESTRING(10.0 5.0 1, 20.0 15.0 2, 30.3 22.4 5, 10 30.0 2) + 4326 + + + + 10 + LINESTRING + LINESTRING(10.0 5.0 1 1, 20.0 15.0 2 3, 30.3 22.4 5 10, 10 30.0 2 12) + 4326 + + + + 11 + MULTILINESTRING + MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)) + 4326 + + + + 12 + MULTILINESTRING + MULTILINESTRING((10.0 5.0, 20.0 15.0, 30.3 22.4, 10 30.0), (40.0 20.0, 42.0 18.0, 43.0 16.0, 40 14.0)) + + 4326 + + + + 13 + MULTILINESTRING + MULTILINESTRING((10.0 5.0 1.0, 20.0 15.0 2.0, 30.3 22.4 1.0, 10 30.0 1.0),(40.0 20.0 0.0, 42.0 18.0 1.0, + 43.0 16.0 2.0, 40 14.0 3.0)) + + 4326 + + + + 14 + MULTILINESTRING + MULTILINESTRING((10.0 5.0 1.0 0.0, 20.0 15.0 2.0 0.0, 30.3 22.4 1.0 1.0, 10 30.0 1.0 2.0),(40.0 20.0 0.0 + 3.0, 42.0 18.0 1.0 4.0, 43.0 16.0 2.0 5.0, 40 14.0 3.0 6.0)) + + 4326 + + + + 15 + MULTILINESTRING + MULTILINESTRING((10.0 5.0 1.0 0.0, 20.0 15.0 2.0 0.0, 30.3 22.4 1.0 1.0, 10 30.0 1.0 2.0)) + 4326 + + + + 16 + POLYGON + POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0) ) + 4326 + + + 17 + POLYGON + POLYGON( (0 0 0, 0 10 1, 10 10 1, 10 0 1, 0 0 0) ) + 4326 + + + 18 + POLYGON + POLYGON( (0 0, 0 10, 10 10, 10 0, 0 0), (2 2, 2 5, 5 5,5 2, 2 2)) + 4326 + + + 19 + POLYGON + POLYGON( (110 110, 110 120, 120 120, 120 110, 110 110) ) + 4326 + + + + 20 + MULTIPOLYGON + MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, 120 140, 130 134, 105 100)) ) + 4326 + + + 21 + MULTIPOLYGON + MULTIPOLYGON( ((10 20 1, 30 40 2, 44 50 2, 10 20 1)), ((105 100 0, 120 140 10, 130 134 20, 105 100 0)) ) + + 4326 + + + 22 + MULTIPOLYGON + MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((105 100, 120 140, 130 + 134, 105 100)) ) + + 4326 + + + + + 25 + MULTIPOINT + MULTIPOINT(21 2, 25 5, 30 3) + 4326 + + + 26 + MULTIPOINT + MULTIPOINT(21 2) + 4326 + + + 27 + MULTIPOINT + MULTIPOINT(21 2 1, 25 5 2, 30 3 5) + 4326 + + + 28 + MULTIPOINT + MULTIPOINT(21 2 1 0, 25 5 2 4, 30 3 5 2) + 4326 + + + + 30 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3)) + 4326 + + + 31 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0))) + 4326 + + + 32 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), LINESTRING(4 2, 5 3), POLYGON((0 0, 3 0, 3 3,0 3, 0 0),(1 1, 2 1, 2 2, 1 2, + 1 1))) + + 4326 + + + 33 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, + 120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))) + + 4326 + + + 34 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), POINT EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 35 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), LINESTRING EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 36 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), GEOMETRYCOLLECTION EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 37 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), POLYGON EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 38 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), MULTILINESTRING EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 39 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), MULTIPOINT EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + 40 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION(POINT(4 0), MULTIPOLYGON EMPTY, LINESTRING(4 2, 5 3)) + 4326 + + + + 50 + POINT + POINT EMPTY + 4326 + + + 51 + LINESTRING + LINESTRING EMPTY + 4326 + + + 52 + POLYGON + POLYGON EMPTY + 4326 + + + 53 + MULTIPOINT + MULTIPOINT EMPTY + 4326 + + + 54 + MULTILINESTRING + MULTILINESTRING EMPTY + 4326 + + + 55 + MULTIPOLYGON + MULTIPOLYGON EMPTY + 4326 + + + 56 + GEOMETRYCOLLECTION + GEOMETRYCOLLECTION EMPTY + 4326 + + + + diff --git a/hibernate-spatial/matrix-test.sh b/hibernate-spatial/matrix-test.sh new file mode 100755 index 0000000000..b2571b1c32 --- /dev/null +++ b/hibernate-spatial/matrix-test.sh @@ -0,0 +1,3 @@ +#! /bin/sh +# gradle -Dhibernate-matrix-databases=/home/maesenka/workspaces/github/hibernate-core/hibernate-spatial/databases +gradle -Dhibernate-matrix-databases="/home/maesenka/workspaces/github/hibernate-core/hibernate-spatial/databases" -Dhibernate-matrix-ignore='mysql50,mysql51,postgresql82,postgresql83,postgresql84' $@