diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/SpatialFunctionsRegistry.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/SpatialFunctionsRegistry.java index 97f107677a..f86d6fa7b9 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/SpatialFunctionsRegistry.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/SpatialFunctionsRegistry.java @@ -6,6 +6,7 @@ */ package org.hibernate.spatial.dialect; +import java.io.Serializable; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -18,15 +19,15 @@ import org.hibernate.dialect.function.StandardSQLFunction; * * Created by Karel Maesen, Geovise BVBA on 29/10/16. */ -public abstract class SpatialFunctionsRegistry implements Iterable> { - protected final Map functionMap = new HashMap(); +public abstract class SpatialFunctionsRegistry implements Iterable>, Serializable { + protected final Map functionMap = new HashMap(); public void put(String name, StandardSQLFunction function ) { this.functionMap.put( name, function ); } @Override - public Iterator> iterator() { + public Iterator> iterator() { return functionMap.entrySet().iterator(); } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java index a0d7dfd7cf..8a2acdf4b4 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL56SpatialDialect.java @@ -16,6 +16,7 @@ import java.util.Map; import org.hibernate.HibernateException; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.MySQL5Dialect; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.dialect.function.StandardSQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; @@ -48,7 +49,7 @@ public class MySQL56SpatialDialect extends MySQL5Dialect implements SpatialDiale "GEOMETRY" ); final MySQLSpatialFunctions functionsToRegister = overrideObjectShapeFunctions( new MySQLSpatialFunctions() ); - for ( Map.Entry entry : functionsToRegister ) { + for ( Map.Entry entry : functionsToRegister ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5InnoDBSpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5InnoDBSpatialDialect.java index b293cf836f..bd7c7280a9 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5InnoDBSpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQL5InnoDBSpatialDialect.java @@ -11,7 +11,7 @@ import java.util.Map; import org.hibernate.HibernateException; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.MySQL5InnoDBDialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; @@ -36,7 +36,7 @@ public class MySQL5InnoDBSpatialDialect extends MySQL5InnoDBDialect implements S MySQLGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : new MySQLSpatialFunctions() ) { + for ( Map.Entry entry : new MySQLSpatialFunctions() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLSpatialDialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLSpatialDialect.java index f87a249ad3..40b8854e93 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLSpatialDialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/mysql/MySQLSpatialDialect.java @@ -10,8 +10,7 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.MySQLDialect; -import org.hibernate.dialect.function.StandardSQLFunction; - +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.GeolatteGeometryType; import org.hibernate.spatial.JTSGeometryType; @@ -35,7 +34,7 @@ public class MySQLSpatialDialect extends MySQLDialect implements SpatialDialect MySQLGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : new MySQLSpatialFunctions() ) { + for ( Map.Entry entry : new MySQLSpatialFunctions() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG82Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG82Dialect.java index b88ac160a9..2189f53017 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG82Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG82Dialect.java @@ -10,20 +10,20 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL82Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - * Extends the {@code PostgreSQL82Dialect} to add support for the Postgis spatial types, functions and operators . - * + * Extends the {@code PostgreSQL82Dialect} to add support for the Postgis spatial types, functions and operators . + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG82Dialect extends PostgreSQL82Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); /** * Creates an instance @@ -34,7 +34,7 @@ public class PostgisPG82Dialect extends PostgreSQL82Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG91Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG91Dialect.java index b88e2db46f..cc02adb9fc 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG91Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG91Dialect.java @@ -10,20 +10,21 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL91Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** * Extends the {@code PostgreSQL91Dialect} to add support for the Postgis spatial types, functions and operators . - * + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG91Dialect extends PostgreSQL91Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -33,7 +34,7 @@ public class PostgisPG91Dialect extends PostgreSQL91Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG92Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG92Dialect.java index f510af1055..0f4b8897b3 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG92Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG92Dialect.java @@ -10,20 +10,21 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL92Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - * Extends the {@code PostgreSQL92Dialect} to add support for the Postgis spatial types, functions and operators . - * + * Extends the {@code PostgreSQL92Dialect} to add support for the Postgis spatial types, functions and operators . + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG92Dialect extends PostgreSQL92Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -33,7 +34,7 @@ public class PostgisPG92Dialect extends PostgreSQL92Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG93Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG93Dialect.java index b9d014c2ce..f4e109ebc1 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG93Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG93Dialect.java @@ -10,20 +10,21 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL93Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - * Extends the {@code PostgreSQL93Dialect} to add support for the Postgis spatial types, functions and operators . - * + * Extends the {@code PostgreSQL93Dialect} to add support for the Postgis spatial types, functions and operators . + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG93Dialect extends PostgreSQL93Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -33,7 +34,7 @@ public class PostgisPG93Dialect extends PostgreSQL93Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG94Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG94Dialect.java index cdb290f950..8d70859352 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG94Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG94Dialect.java @@ -10,20 +10,21 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL94Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - * Extends the {@code PostgreSQL94Dialect} to add support for the Postgis spatial types, functions and operators . - * + * Extends the {@code PostgreSQL94Dialect} to add support for the Postgis spatial types, functions and operators . + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG94Dialect extends PostgreSQL94Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -33,7 +34,7 @@ public class PostgisPG94Dialect extends PostgreSQL94Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG95Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG95Dialect.java index 75fa9b5250..3db378fd82 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG95Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG95Dialect.java @@ -10,19 +10,20 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL95Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - * Extends the {@code PostgreSQL95Dialect} to add support for the Postgis spatial types, functions and operators . + * Extends the {@code PostgreSQL95Dialect} to add support for the Postgis spatial types, functions and operators . * Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG95Dialect extends PostgreSQL95Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -32,7 +33,7 @@ public class PostgisPG95Dialect extends PostgreSQL95Dialect implements SpatialDi PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG9Dialect.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG9Dialect.java index 40e70a89c5..5f22fcaf38 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG9Dialect.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisPG9Dialect.java @@ -10,20 +10,21 @@ import java.util.Map; import org.hibernate.boot.model.TypeContributions; import org.hibernate.dialect.PostgreSQL9Dialect; -import org.hibernate.dialect.function.StandardSQLFunction; +import org.hibernate.dialect.function.SQLFunction; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.SpatialDialect; import org.hibernate.spatial.SpatialFunction; /** - ** Extends the {@code PostgreSQL9Dialect} to add support for the Postgis spatial types, functions and operators . - * + * * Extends the {@code PostgreSQL9Dialect} to add support for the Postgis spatial types, functions and operators . + *

* Created by Karel Maesen, Geovise BVBA on 01/11/16. */ public class PostgisPG9Dialect extends PostgreSQL9Dialect implements SpatialDialect { - private PostgisSupport support = new PostgisSupport(); + transient private PostgisSupport support = new PostgisSupport(); + /** * Creates an instance */ @@ -33,7 +34,7 @@ public class PostgisPG9Dialect extends PostgreSQL9Dialect implements SpatialDial PGGeometryTypeDescriptor.INSTANCE.getSqlType(), "GEOMETRY" ); - for ( Map.Entry entry : support.functionsToRegister() ) { + for ( Map.Entry entry : support.functionsToRegister() ) { registerFunction( entry.getKey(), entry.getValue() ); } } diff --git a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSupport.java b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSupport.java index e0f14ad136..2ab8550998 100644 --- a/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSupport.java +++ b/hibernate-spatial/src/main/java/org/hibernate/spatial/dialect/postgis/PostgisSupport.java @@ -6,6 +6,8 @@ */ package org.hibernate.spatial.dialect.postgis; +import java.io.Serializable; + import org.hibernate.boot.model.TypeContributions; import org.hibernate.service.ServiceRegistry; import org.hibernate.spatial.GeolatteGeometryType; @@ -18,7 +20,7 @@ import org.hibernate.spatial.SpatialRelation; /** * Created by Karel Maesen, Geovise BVBA on 29/10/16. */ -public class PostgisSupport implements SpatialDialect { +public class PostgisSupport implements SpatialDialect, Serializable { private PostgisFunctions postgisFunctions = new PostgisFunctions();