extends Serializable {
-
- /**
- * Find a feature or property of a subject
- *
- * @param subject the object that is being searched
- *
- * @return the object sought
- *
- * @throws FinderException thrown when the feature can be found;
- */
- public T find(S subject) throws FinderException;
-
-}
diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java
deleted file mode 100644
index 0af4f0db3c..0000000000
--- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/PropertyFileReader.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * This file is part of Hibernate Spatial, an extension to the
- * hibernate ORM solution for spatial (geographic) data.
- *
- * Copyright © 2007-2012 Geovise BVBA
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-package org.hibernate.spatial.helper;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-import java.util.regex.Pattern;
-
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
-
-/**
- * Helper class to read settings and properties files.
- *
- * @author Karel Maesen
- */
-public class PropertyFileReader {
-
- private static final Log LOG = LogFactory.make();
- /**
- * pattern for comment lines. If it matches, it is a comment.
- */
- private static final Pattern NON_COMMENT_PATTERN = Pattern.compile( "^([^#]+)" );
-
- private InputStream is;
-
- /**
- * Constructs an instance from the specified {@code InputStream}
- * @param is The inputstream
- */
- public PropertyFileReader(InputStream is) {
- this.is = is;
- }
-
- /**
- * Returns the properties
- * @return {@code Properties}
- * @throws IOException if an error occurs when reading from the {@code InputStream}
- */
- public Properties getProperties() throws IOException {
- if ( is == null ) {
- return null;
- }
- final Properties props = new Properties();
- props.load( is );
- return props;
- }
-
- /**
- * Closes this instance, and closes the underlying {@code InputStream}
- */
- public void close() {
- try {
- this.is.close();
- }
- catch ( IOException e ) {
- LOG.warn( "Exception when closing PropertyFileReader: " + e );
- }
- }
-
-}
diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html b/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html
deleted file mode 100644
index 134d8a78ce..0000000000
--- a/hibernate-spatial/src/main/java/org/hibernate/spatial/helper/package.html
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
- This package contains general helper classes.
-
-
-
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java
index 71a636cfaf..d2fd757f61 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialFunctions.java
@@ -26,18 +26,21 @@ import java.util.HashMap;
import java.util.Map;
import com.vividsolutions.jts.geom.Geometry;
-import org.junit.Test;
+
+import org.jboss.logging.Logger;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.SpatialFunction;
import org.hibernate.spatial.dialect.h2geodb.GeoDBDialect;
import org.hibernate.spatial.dialect.oracle.OracleSpatial10gDialect;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
+
+import org.junit.Test;
+
import org.hibernate.testing.Skip;
import org.hibernate.testing.SkipForDialect;
@@ -49,10 +52,12 @@ import static java.lang.String.format;
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestSpatialFunctions extends SpatialFunctionalTestCase {
- private static Log LOG = LogFactory.make();
+ private static final HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ TestSpatialFunctions.class.getName()
+ );
-
- protected Log getLogger() {
+ protected HSMessageLogger getLogger() {
return LOG;
}
@@ -91,7 +96,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
Map dbexpected = expectationsFactory.getAsText();
String hql = format( "SELECT id, astext(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg );
- retrieveHQLResultsAndCompare( dbexpected, hql, pckg);
+ retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
}
@Test
@@ -227,7 +232,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getEnvelope();
- String hql = format("SELECT id, envelope(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg);
+ String hql = format( "SELECT id, envelope(geom) from org.hibernate.spatial.integration.%s.GeomEntity", pckg );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
}
@@ -246,8 +251,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getWithin( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, within(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where within(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, within(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where within(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -267,8 +274,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getEquals( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, equals(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where equals(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, equals(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where equals(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -288,8 +297,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getCrosses( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, crosses(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where crosses(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, crosses(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where crosses(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
@@ -302,7 +313,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_contains_on_geolatte() throws SQLException {
- contains( GEOLATTE);
+ contains( GEOLATTE );
}
public void contains(String pckg) throws SQLException {
@@ -310,8 +321,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getContains( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, contains(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where contains(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, contains(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where contains(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -323,7 +336,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_disjoint_on_geolatte() throws SQLException {
- disjoint( GEOLATTE);
+ disjoint( GEOLATTE );
}
public void disjoint(String pckg) throws SQLException {
@@ -331,8 +344,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getDisjoint( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, disjoint(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where disjoint(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, disjoint(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where disjoint(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -344,7 +359,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_intersects_on_geolatte() throws SQLException {
- intersects( GEOLATTE);
+ intersects( GEOLATTE );
}
public void intersects(String pckg) throws SQLException {
@@ -352,8 +367,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getIntersects( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, intersects(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where intersects(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, intersects(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where intersects(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -365,7 +382,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_overlaps_on_geolatte() throws SQLException {
- overlaps( GEOLATTE);
+ overlaps( GEOLATTE );
}
public void overlaps(String pckg) throws SQLException {
@@ -373,8 +390,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getOverlaps( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, overlaps(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where overlaps(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, overlaps(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where overlaps(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -386,15 +405,17 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_touches_on_geolatte() throws SQLException {
- touches( GEOLATTE);
+ touches( GEOLATTE );
}
public void touches(String pckg) throws SQLException {
if ( !isSupportedByDialect( SpatialFunction.touches ) ) {
return;
}
- String hql = format("SELECT id, touches(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where touches(geom, :filter) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, touches(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where touches(geom, :filter) = true and srid(geom) = 4326", pckg
+ );
Map dbexpected = expectationsFactory.getTouches( expectationsFactory.getTestPolygon() );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
@@ -407,7 +428,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_relate_on_geolatte() throws SQLException {
- relate( GEOLATTE);
+ relate( GEOLATTE );
}
public void relate(String pckg) throws SQLException {
@@ -419,8 +440,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
expectationsFactory.getTestPolygon(),
matrix
);
- String hql = format("SELECT id, relate(geom, :filter, :matrix) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where relate(geom, :filter, :matrix) = true and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, relate(geom, :filter, :matrix) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where relate(geom, :filter, :matrix) = true and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
params.put( "matrix", matrix );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
@@ -439,7 +462,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_distance_on_geolatte() throws SQLException {
- distance( GEOLATTE);
+ distance( GEOLATTE );
}
public void distance(String pckg) throws SQLException {
@@ -447,8 +470,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getDistance( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, distance(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, distance(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -460,7 +485,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_buffer_on_geolatte() throws SQLException {
- buffer( GEOLATTE);
+ buffer( GEOLATTE );
}
public void buffer(String pckg) throws SQLException {
@@ -468,8 +493,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getBuffer( Double.valueOf( 1.0 ) );
- String hql = format("SELECT id, buffer(geom, :distance) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, buffer(geom, :distance) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "distance", Double.valueOf( 1.0 ) );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
@@ -482,7 +509,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_convexhull_on_geolatte() throws SQLException {
- convexhull( GEOLATTE);
+ convexhull( GEOLATTE );
}
public void convexhull(String pckg) throws SQLException {
@@ -490,21 +517,25 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getConvexHull( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, convexhull(geomunion(geom, :polygon)) from org.hibernate.spatial.integration" +
- ".%s.GeomEntity where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, convexhull(geomunion(geom, :polygon)) from org.hibernate.spatial.integration" +
+ ".%s.GeomEntity where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
- @Test @SkipForDialect( value = GeoDBDialect.class)
- public void test_intersection_on_jts()throws SQLException {
+ @Test
+ @SkipForDialect(value = GeoDBDialect.class)
+ public void test_intersection_on_jts() throws SQLException {
intersection( JTS );
}
- @Test @SkipForDialect( value = GeoDBDialect.class)
- public void test_intersection_on_geolatte()throws SQLException {
- intersection( GEOLATTE);
+ @Test
+ @SkipForDialect(value = GeoDBDialect.class)
+ public void test_intersection_on_geolatte() throws SQLException {
+ intersection( GEOLATTE );
}
//skipped for GeoDBDialect because GeoDB throws exceptions in case the intersection is empty.
@@ -514,8 +545,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getIntersection( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, intersection(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, intersection(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -527,7 +560,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_difference_on_geolatte() throws SQLException {
- difference( GEOLATTE);
+ difference( GEOLATTE );
}
public void difference(String pckg) throws SQLException {
@@ -535,8 +568,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getDifference( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, difference(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, difference(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -548,7 +583,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_symdifference_on_geolatte() throws SQLException {
- symdifference( GEOLATTE);
+ symdifference( GEOLATTE );
}
public void symdifference(String pckg) throws SQLException {
@@ -556,8 +591,10 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getSymDifference( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, symdifference(geom, :polygon) from " +
- "org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, symdifference(geom, :polygon) from " +
+ "org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@@ -569,7 +606,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_geomunion_on_geolatte() throws SQLException {
- geomunion( GEOLATTE);
+ geomunion( GEOLATTE );
}
public void geomunion(String pckg) throws SQLException {
@@ -577,10 +614,12 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
return;
}
Map dbexpected = expectationsFactory.getGeomUnion( expectationsFactory.getTestPolygon() );
- String hql = format("SELECT id, geomunion(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, geomunion(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "polygon", expectationsFactory.getTestPolygon() );
- retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg);
+ retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
@Test
@@ -590,7 +629,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_dwithin_on_geolatte() throws SQLException {
- dwithin( GEOLATTE);
+ dwithin( GEOLATTE );
}
public void dwithin(String pckg) throws SQLException {
@@ -602,9 +641,11 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
expectationsFactory.getTestPoint(),
distance
);
- String hql = format("SELECT id, dwithin(geom, :filter, :distance) from " +
- "org.hibernate.spatial.integration.%s.GeomEntity where dwithin(geom, :filter, :distance) = true " +
- "and srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, dwithin(geom, :filter, :distance) from " +
+ "org.hibernate.spatial.integration.%s.GeomEntity where dwithin(geom, :filter, :distance) = true " +
+ "and srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "filter", expectationsFactory.getTestPoint() );
if ( getDialect() instanceof OracleSpatial10gDialect ) {
//because this uses the weird syntax and conventions of SDO_WITHIN_DISTANCE which returns a string (really)
@@ -625,7 +666,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
@Test
public void test_transform_on_geolatte() throws SQLException {
- transform( GEOLATTE);
+ transform( GEOLATTE );
}
public void transform(String pckg) throws SQLException {
@@ -634,18 +675,24 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
}
int epsg = 4324;
Map dbexpected = expectationsFactory.getTransform( epsg );
- String hql = format("SELECT id, transform(geom, :epsg) from org.hibernate.spatial.integration.%s.GeomEntity " +
- "where srid(geom) = 4326", pckg);
+ String hql = format(
+ "SELECT id, transform(geom, :epsg) from org.hibernate.spatial.integration.%s.GeomEntity " +
+ "where srid(geom) = 4326", pckg
+ );
Map params = createQueryParams( "epsg", Integer.valueOf( epsg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
}
public void retrieveHQLResultsAndCompare(Map dbexpected, String hql, String geometryType) {
- retrieveHQLResultsAndCompare( dbexpected, hql, null, geometryType);
+ retrieveHQLResultsAndCompare( dbexpected, hql, null, geometryType );
}
- protected void retrieveHQLResultsAndCompare(Map dbexpected, String hql, Map params, String geometryType) {
+ protected void retrieveHQLResultsAndCompare(
+ Map dbexpected,
+ String hql,
+ Map params,
+ String geometryType) {
Map hsreceived = new HashMap();
doInSession( hql, hsreceived, params );
compare( dbexpected, hsreceived, geometryType );
@@ -681,7 +728,7 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
if ( params == null ) {
return;
}
- for ( Map.Entry entry: params.entrySet() ) {
+ for ( Map.Entry entry : params.entrySet() ) {
query.setParameter( entry.getKey(), entry.getValue() );
}
}
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java
index cda2ffc03f..9000f7ee7e 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/TestSpatialRestrictions.java
@@ -25,14 +25,15 @@ import java.sql.SQLException;
import java.util.List;
import java.util.Map;
+import org.jboss.logging.Logger;
+
import org.junit.Test;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
import org.hibernate.criterion.Criterion;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.SpatialFunction;
import org.hibernate.spatial.criterion.SpatialRestrictions;
import org.hibernate.spatial.integration.jts.GeomEntity;
@@ -46,9 +47,12 @@ import static org.junit.Assert.fail;
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
- private static Log LOG = LogFactory.make();
+ private static HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ TestSpatialRestrictions.class.getName()
+ );
- protected Log getLogger() {
+ protected HSMessageLogger getLogger() {
return LOG;
}
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java
index 4378fe490c..658004ce19 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/geolatte/TestStoreRetrieveUsingGeolatte.java
@@ -9,13 +9,15 @@ import org.geolatte.geom.Geometry;
import org.geolatte.geom.GeometryEquality;
import org.geolatte.geom.GeometryPointEquality;
import org.geolatte.geom.codec.WktDecodeException;
+
+import org.jboss.logging.Logger;
+
import org.junit.Test;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.spatial.testing.TestDataElement;
@@ -32,9 +34,12 @@ import static org.junit.Assert.assertTrue;
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestStoreRetrieveUsingGeolatte extends SpatialFunctionalTestCase {
- private static Log LOG = LogFactory.make();
+ private static HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ TestStoreRetrieveUsingGeolatte.class.getName()
+ );
- protected Log getLogger() {
+ protected HSMessageLogger getLogger() {
return LOG;
}
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java
index daf1d9e5a1..c1214677e5 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/integration/jts/TestStoreRetrieveUsingJTS.java
@@ -6,13 +6,15 @@ import java.util.Map;
import com.vividsolutions.jts.geom.Geometry;
import com.vividsolutions.jts.io.ParseException;
+
+import org.jboss.logging.Logger;
+
import org.junit.Test;
import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.testing.SpatialDialectMatcher;
import org.hibernate.spatial.testing.SpatialFunctionalTestCase;
import org.hibernate.spatial.testing.TestDataElement;
@@ -29,9 +31,13 @@ import static org.junit.Assert.assertTrue;
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestStoreRetrieveUsingJTS extends SpatialFunctionalTestCase {
- private static Log LOG = LogFactory.make();
+ private static final HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ TestStoreRetrieveUsingJTS.class.getName()
+ );
- protected Log getLogger() {
+
+ protected HSMessageLogger getLogger() {
return LOG;
}
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java
index 2521913800..57464e0371 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/AbstractExpectationsFactory.java
@@ -35,8 +35,9 @@ import com.vividsolutions.jts.geom.Polygon;
import com.vividsolutions.jts.io.ParseException;
import com.vividsolutions.jts.io.WKTReader;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.jboss.logging.Logger;
+
+import org.hibernate.spatial.HSMessageLogger;
/**
* An AbstractExpectationsFactory
provides the expected
@@ -49,7 +50,10 @@ import org.hibernate.spatial.LogFactory;
*/
public abstract class AbstractExpectationsFactory {
- private static final Log LOG = LogFactory.make();
+ private static final HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ AbstractExpectationsFactory.class.getName()
+ );
public final static String TEST_POLYGON_WKT = "POLYGON((0 0, 50 0, 100 100, 0 100, 0 0))";
public final static String TEST_POINT_WKT = "POINT(0 0)";
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java
index 9aa2690c91..8ef02c4d24 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/DataSourceUtils.java
@@ -44,8 +44,9 @@ import org.geolatte.geom.codec.Wkt;
import org.geolatte.geom.codec.WktDecodeException;
import org.geolatte.geom.codec.WktDecoder;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.jboss.logging.Logger;
+
+import org.hibernate.spatial.HSMessageLogger;
/**
* Unit testsuite-suite support class.
@@ -55,7 +56,10 @@ import org.hibernate.spatial.LogFactory;
public class DataSourceUtils {
- private static Log LOG = LogFactory.make();
+ private static HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ DataSourceUtils.class.getName()
+ );
private final SQLExpressionTemplate sqlExpressionTemplate;
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java
index 4fe08202d3..6e3983f059 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/SpatialFunctionalTestCase.java
@@ -21,25 +21,29 @@
package org.hibernate.spatial.testing;
-import com.vividsolutions.jts.geom.Geometry;
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
-import org.hibernate.boot.registry.internal.StandardServiceRegistryImpl;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.service.ServiceRegistry;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.SpatialDialect;
-import org.hibernate.spatial.SpatialFunction;
-import org.hibernate.testing.AfterClassOnce;
-import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
-
import java.sql.BatchUpdateException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.*;
+import com.vividsolutions.jts.geom.Geometry;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.service.ServiceRegistry;
+import org.hibernate.spatial.HSMessageLogger;
+import org.hibernate.spatial.SpatialDialect;
+import org.hibernate.spatial.SpatialFunction;
+
+import org.hibernate.testing.AfterClassOnce;
+import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
+
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
/**
* @author Karel Maesen, Geovise BVBA
@@ -182,7 +186,7 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
return dialect.supportsFiltering();
}
- abstract protected Log getLogger();
+ abstract protected HSMessageLogger getLogger();
/**
* Adds the query results to a Map.
diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java
index 4033578d7e..98bc79f783 100644
--- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java
+++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/dialects/postgis/PostgisExpectationsFactory.java
@@ -29,8 +29,9 @@ import org.geolatte.geom.codec.WkbDecoder;
import org.geolatte.geom.jts.JTS;
import org.postgresql.util.PGobject;
-import org.hibernate.spatial.Log;
-import org.hibernate.spatial.LogFactory;
+import org.jboss.logging.Logger;
+
+import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.testing.AbstractExpectationsFactory;
import org.hibernate.spatial.testing.DataSourceUtils;
import org.hibernate.spatial.testing.NativeSQLStatement;
@@ -42,7 +43,10 @@ import org.hibernate.spatial.testing.NativeSQLStatement;
*/
public class PostgisExpectationsFactory extends AbstractExpectationsFactory {
- private static final Log LOG = LogFactory.make();
+ private static final HSMessageLogger LOG = Logger.getMessageLogger(
+ HSMessageLogger.class,
+ PostgisExpectationsFactory.class.getName()
+ );
public PostgisExpectationsFactory(DataSourceUtils utils) {