HHH-14442 Fix checkstyle errors

This commit is contained in:
Karel Maesen 2021-02-06 15:56:55 +01:00
parent f0a81898dc
commit 650a703e1c
53 changed files with 555 additions and 370 deletions

View File

@ -7,10 +7,11 @@
package org.hibernate.spatial; package org.hibernate.spatial;
import java.util.Locale;
import org.hibernate.type.descriptor.WrapperOptions; import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor; import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor; import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptorRegistry;
import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.ParseException; import org.locationtech.jts.io.ParseException;
@ -49,7 +50,7 @@ public class JTSGeometryJavaTypeDescriptor extends AbstractTypeDescriptor<Geomet
return reader.read( string ); return reader.read( string );
} }
catch (ParseException e) { catch (ParseException e) {
throw new RuntimeException( String.format( "Can't parse string %s as WKT", string ) ); throw new RuntimeException( String.format( Locale.ENGLISH, "Can't parse string %s as WKT", string ) );
} }
} }

View File

@ -29,8 +29,6 @@ import org.hibernate.spatial.SpatialRelation;
import org.hibernate.type.StandardBasicTypes; import org.hibernate.type.StandardBasicTypes;
import org.hibernate.type.Type; import org.hibernate.type.Type;
import static java.lang.String.format;
/** /**
* @author David Adler, Adtech Geospatial * @author David Adler, Adtech Geospatial
* creation-date: 5/22/2014 * creation-date: 5/22/2014
@ -228,24 +226,11 @@ public class DB2SpatialDialect extends DB2Dialect implements SpatialDialect {
) ); ) );
// Register non-SFS functions listed in Hibernate Spatial // Register non-SFS functions listed in Hibernate Spatial
registerFunction( "dwithin", new DWithinFunction()); registerFunction( "dwithin", new DWithinFunction() );
// // The srid parameter needs to be explicitly cast to INTEGER to avoid a -245 SQLCODE,
// // ambiguous parameter.
// registerFunction( "transform", new SQLFunctionTemplate(
// geolatteGemetryType,
// "DB2GSE.ST_Transform(?1, CAST (?2 AS INTEGER))"
// ) );
registerFunction( "geomFromText", new StandardSQLFunction( registerFunction( "geomFromText", new StandardSQLFunction(
"DB2GSE.ST_GeomFromText" "DB2GSE.ST_GeomFromText"
) ); ) );
// // Register spatial aggregate function
// registerFunction( "extent", new SQLFunctionTemplate(
// geolatteGemetryType,
// "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildMBRAggr(?1)))"
// ) );
} }
@Override @Override
@ -271,7 +256,7 @@ public class DB2SpatialDialect extends DB2Dialect implements SpatialDialect {
@Override @Override
public String getSpatialAggregateSQL(String columnName, int type) { public String getSpatialAggregateSQL(String columnName, int type) {
switch ( type ) { switch ( type ) {
case SpatialAggregate.EXTENT: // same as extent function above??? case SpatialAggregate.EXTENT:
return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildMBRAggr(" + columnName + ")))"; return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildMBRAggr(" + columnName + ")))";
case SpatialAggregate.UNION: case SpatialAggregate.UNION:
return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildUnionAggr(" + columnName + ")))"; return "db2gse.ST_GetAggrResult(MAX(db2gse.st_BuildUnionAggr(" + columnName + ")))";
@ -304,7 +289,8 @@ public class DB2SpatialDialect extends DB2Dialect implements SpatialDialect {
if ( spatialRelation != SpatialRelation.DISJOINT ) { if ( spatialRelation != SpatialRelation.DISJOINT ) {
return " db2gse." + relationName + "(" + columnName + ", ?) = 1 SELECTIVITY .0001"; return " db2gse." + relationName + "(" + columnName + ", ?) = 1 SELECTIVITY .0001";
} }
else { // SELECTIVITY not supported for ST_Disjoint UDF else {
// SELECTIVITY not supported for ST_Disjoint UDF
return " db2gse." + relationName + "(" + columnName + ", ?) = 1"; return " db2gse." + relationName + "(" + columnName + ", ?) = 1";
} }
} }
@ -328,17 +314,17 @@ public class DB2SpatialDialect extends DB2Dialect implements SpatialDialect {
private static class DWithinFunction extends StandardSQLFunction { private static class DWithinFunction extends StandardSQLFunction {
public DWithinFunction() { public DWithinFunction() {
super( "db2gse.ST_Dwithin" , StandardBasicTypes.NUMERIC_BOOLEAN); super( "db2gse.ST_Dwithin", StandardBasicTypes.NUMERIC_BOOLEAN );
} }
public String render(Type firstArgumentType, final List args, final SessionFactoryImplementor factory) { public String render(Type firstArgumentType, final List args, final SessionFactoryImplementor factory) {
StringBuilder sb = new StringBuilder( "db2gse.ST_Intersects( " ); StringBuilder sb = new StringBuilder( "db2gse.ST_Intersects( " );
sb.append( (String)args.get(0) ) // sb.append( (String) args.get( 0 ) )
.append(", db2gse.ST_Buffer(") .append( ", db2gse.ST_Buffer(" )
.append((String)args.get(1) ) .append( (String) args.get( 1 ) )
.append(", ") .append( ", " )
.append((String)args.get(2) ) .append( (String) args.get( 2 ) )
.append(", 'METER'))"); .append( ", 'METER'))" );
return sb.toString(); return sb.toString();
} }

View File

@ -8,6 +8,7 @@
package org.hibernate.spatial.dialect.h2geodb; package org.hibernate.spatial.dialect.h2geodb;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -177,7 +178,7 @@ public class GeoDBDialect extends H2Dialect implements SpatialDialect {
Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) { Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) {
int argumentCount = arguments.size(); int argumentCount = arguments.size();
if ( argumentCount != 2 ) { if ( argumentCount != 2 ) {
throw new QueryException( String.format( "2 arguments expected, received %d", argumentCount ) ); throw new QueryException( String.format( Locale.ENGLISH,"2 arguments expected, received %d", argumentCount ) );
} }
return Stream.of( return Stream.of(

View File

@ -11,6 +11,7 @@ import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.Locale;
import org.geolatte.geom.ByteBuffer; import org.geolatte.geom.ByteBuffer;
import org.geolatte.geom.ByteOrder; import org.geolatte.geom.ByteOrder;
@ -23,6 +24,10 @@ public class HANASpatialUtils {
private static final int POSTGIS_SRID_FLAG = 0x20000000; private static final int POSTGIS_SRID_FLAG = 0x20000000;
private HANASpatialUtils(){
//prevent instantiation of Utility class
}
@SuppressWarnings("resource") @SuppressWarnings("resource")
public static Geometry<?> toGeometry(ResultSet rs, String name) throws SQLException { public static Geometry<?> toGeometry(ResultSet rs, String name) throws SQLException {
ByteBuffer buffer = toByteBuffer( rs.getObject( name ) ); ByteBuffer buffer = toByteBuffer( rs.getObject( name ) );
@ -36,7 +41,7 @@ public class HANASpatialUtils {
String columnName = null; String columnName = null;
for ( int i = 1; i <= rs.getMetaData().getColumnCount(); i++ ) { for ( int i = 1; i <= rs.getMetaData().getColumnCount(); i++ ) {
if ( name.equals( rs.getMetaData().getColumnLabel( i ) ) || if ( name.equals( rs.getMetaData().getColumnLabel( i ) ) ||
name.toUpperCase().equals( rs.getMetaData().getColumnLabel( i ) ) ) { name.toUpperCase( Locale.ENGLISH ).equals( rs.getMetaData().getColumnLabel( i ) ) ) {
tableName = rs.getMetaData().getTableName( i ); tableName = rs.getMetaData().getTableName( i );
columnName = rs.getMetaData().getColumnName( i ); columnName = rs.getMetaData().getColumnName( i );
} }
@ -80,17 +85,20 @@ public class HANASpatialUtils {
} }
private static ByteBuffer addCrsId(byte[] wkb, byte orderByte, int typeCode, int crsId) { private static ByteBuffer addCrsId(byte[] wkb, byte orderByte, int typeCode, int crsId) {
ByteBuffer buffer = ByteBuffer.allocate( wkb.length + 4 ); // original capacity + 4 bytes for the CRS ID // original capacity + 4 bytes for the CRS ID
ByteBuffer buffer = ByteBuffer.allocate( wkb.length + 4 );
buffer.setByteOrder( ByteOrder.valueOf( orderByte ) ); buffer.setByteOrder( ByteOrder.valueOf( orderByte ) );
buffer.put( orderByte ); // write byte order // write byte order
buffer.put( orderByte );
buffer.putUInt( typeCode | POSTGIS_SRID_FLAG ); // set SRID flag // set SRID flag
buffer.putUInt( typeCode | POSTGIS_SRID_FLAG );
buffer.putInt( crsId ); // write CRS ID // write CRS ID
buffer.putInt( crsId );
// write remaining data // write remaining data
for ( int i = 5; i < wkb.length; i++ ) { for ( int i = 5; i < wkb.length; i++ ) {
buffer.put( wkb[i] ); buffer.put( wkb[i] );
} }

View File

@ -6,6 +6,7 @@
*/ */
package org.hibernate.spatial.dialect.mysql; package org.hibernate.spatial.dialect.mysql;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.hibernate.boot.model.TypeContributions; import org.hibernate.boot.model.TypeContributions;
@ -93,7 +94,10 @@ public class MySQLSpatialDialect extends MySQLDialect implements SpatialDialect
@Override @Override
public String getDWithinSQL(String columnName) { public String getDWithinSQL(String columnName) {
throw new UnsupportedOperationException( String.format( "Mysql doesn't support the Dwithin function" ) ); throw new UnsupportedOperationException( String.format(
Locale.ENGLISH,
"Mysql doesn't support the Dwithin function"
) );
} }
@Override @Override

View File

@ -42,11 +42,10 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil
OracleSpatial10gDialect.class.getName() OracleSpatial10gDialect.class.getName()
); );
private final boolean isOgcStrict;
private final SpatialFunctionsRegistry sdoFunctions; private final SpatialFunctionsRegistry sdoFunctions;
OracleSDOSupport(boolean isOgcStrict) { OracleSDOSupport(boolean isOgcStrict) {
this.isOgcStrict = isOgcStrict;
this.sdoFunctions = new OracleSpatialFunctions( isOgcStrict, this ); this.sdoFunctions = new OracleSpatialFunctions( isOgcStrict, this );
} }
@ -262,7 +261,7 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil
aggregateFunction.append( "SDOAGGRTYPE(" ); aggregateFunction.append( "SDOAGGRTYPE(" );
} }
aggregateFunction.append( columnName ); aggregateFunction.append( columnName );
// TODO tolerance must by configurable // Can we make tolerance configurable
if ( sa.isAggregateType() ) { if ( sa.isAggregateType() ) {
aggregateFunction.append( ", " ).append( .001 ).append( ")" ); aggregateFunction.append( ", " ).append( .001 ).append( ")" );
} }
@ -292,7 +291,7 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil
*/ */
@Override @Override
public String getHavingSridSQL(String columnName) { public String getHavingSridSQL(String columnName) {
return String.format( " (MDSYS.ST_GEOMETRY(%s).ST_SRID() = ?)", columnName , Locale.US); return String.format( Locale.ENGLISH, " (MDSYS.ST_GEOMETRY(%s).ST_SRID() = ?)", columnName );
} }
/** /**
@ -306,7 +305,12 @@ class OracleSDOSupport implements SpatialDialect, Serializable, WithCustomJPAFil
*/ */
@Override @Override
public String getIsEmptySQL(String columnName, boolean isEmpty) { public String getIsEmptySQL(String columnName, boolean isEmpty) {
return String.format( "( MDSYS.ST_GEOMETRY(%s).ST_ISEMPTY() = %d )", columnName, isEmpty ? 1 : 0 , Locale.US); return String.format(
Locale.ENGLISH,
"( MDSYS.ST_GEOMETRY(%s).ST_ISEMPTY() = %d )",
columnName,
isEmpty ? 1 : 0
);
} }
/** /**

View File

@ -7,6 +7,7 @@
package org.hibernate.spatial.dialect.postgis; package org.hibernate.spatial.dialect.postgis;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
@ -226,7 +227,11 @@ class PostgisFunctions extends SpatialFunctionsRegistry {
Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) { Type firstArgumentType, List arguments, SessionFactoryImplementor sessionFactory) {
int argumentCount = arguments.size(); int argumentCount = arguments.size();
if ( argumentCount != 2 ) { if ( argumentCount != 2 ) {
throw new QueryException( String.format( "2 arguments expected, received %d", argumentCount ) ); throw new QueryException( String.format(
Locale.ENGLISH,
"2 arguments expected, received %d",
argumentCount
) );
} }
return Stream.of( return Stream.of(

View File

@ -1,17 +1,28 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.dialect.hana; package org.hibernate.spatial.dialect.hana;
import static java.lang.String.format; import static java.lang.String.format;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.HashMap; import java.util.HashMap;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Configuration;
import org.hibernate.spatial.HSMessageLogger; import org.hibernate.spatial.HSMessageLogger;
import org.hibernate.spatial.integration.TestSpatialFunctions; import org.hibernate.spatial.integration.TestSpatialFunctions;
import org.hibernate.spatial.testing.dialects.hana.HANAExpectationsFactory; import org.hibernate.spatial.testing.dialects.hana.HANAExpectationsFactory;
import org.hibernate.testing.RequiresDialect; import org.hibernate.testing.RequiresDialect;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.junit.Test; import org.junit.Test;
import org.locationtech.jts.geom.Geometry; import org.locationtech.jts.geom.Geometry;
@ -24,7 +35,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
private static final HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
TestHANASpatialFunctions.class.getName() ); TestHANASpatialFunctions.class.getName()
);
protected HANAExpectationsFactory hanaExpectationsFactory; protected HANAExpectationsFactory hanaExpectationsFactory;
@ -52,8 +64,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void alphashape(String pckg) throws SQLException { public void alphashape(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getAlphaShape( 1 ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getAlphaShape( 1 );
String hql = format( String hql = format(
Locale.ENGLISH,
"SELECT id, alphashape(geom, 1) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point', 'ST_MultiPoint')", "SELECT id, alphashape(geom, 1) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point', 'ST_MultiPoint')",
pckg ); pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -71,7 +85,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getArea(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getArea();
String hql = format( String hql = format(
"SELECT id, area(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon')", "SELECT id, area(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon')",
pckg ); pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -151,7 +166,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void assvgaggr(String pckg) throws SQLException { public void assvgaggr(String pckg) throws SQLException {
Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsSVGAggr(); Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsSVGAggr();
String hql = format( "SELECT cast(count(g) as int), assvgaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", pckg ); String hql = format(
"SELECT cast(count(g) as int), assvgaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -199,7 +217,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void convexhullaggr(String pckg) throws SQLException { public void convexhullaggr(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getConvexHullAggr(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getConvexHullAggr();
String hql = format( "SELECT cast(count(g) as int), convexhullaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", pckg ); String hql = format(
"SELECT cast(count(g) as int), convexhullaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -215,7 +236,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void centroid(String pckg) throws SQLException { public void centroid(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getCentroid(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getCentroid();
String hql = format( "SELECT id, centroid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'", pckg ); String hql = format(
"SELECT id, centroid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -249,7 +273,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getCoveredBy( expectationsFactory.getTestPolygon() ); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getCoveredBy( expectationsFactory.getTestPolygon() );
String hql = format( String hql = format(
"SELECT id, coveredby(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where coveredby(geom, :filter) = true and srid(geom) = %d", "SELECT id, coveredby(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where coveredby(geom, :filter) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -268,7 +294,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getCovers( expectationsFactory.getTestPolygon() ); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getCovers( expectationsFactory.getTestPolygon() );
String hql = format( String hql = format(
"SELECT id, covers(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where covers(geom, :filter) = true and srid(geom) = %d", "SELECT id, covers(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where covers(geom, :filter) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -285,8 +313,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void endpoint(String pckg) throws SQLException { public void endpoint(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getEndPoint(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getEndPoint();
String hql = format( "SELECT id, endpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'", String hql = format(
pckg ); "SELECT id, endpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -302,7 +332,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void envelopeaggr(String pckg) throws SQLException { public void envelopeaggr(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getEnvelopeAggr(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getEnvelopeAggr();
String hql = format( "SELECT cast(count(g) as int), envelopeaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", pckg ); String hql = format(
"SELECT cast(count(g) as int), envelopeaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -318,8 +351,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void exteriorring(String pckg) throws SQLException { public void exteriorring(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getExteriorRing(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getExteriorRing();
String hql = format( "SELECT id, exteriorring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'", String hql = format(
pckg ); "SELECT id, exteriorring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -337,8 +372,11 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
WKBWriter writer = new WKBWriter( 2, true ); WKBWriter writer = new WKBWriter( 2, true );
byte[] ewkb = writer.write( expectationsFactory.getTestPolygon() ); byte[] ewkb = writer.write( expectationsFactory.getTestPolygon() );
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromEWKB( ewkb ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromEWKB( ewkb );
String hql = format( "SELECT 1, cast(geomfromewkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", String hql = format(
getGeometryTypeFromPackage( pckg ), pckg ); "SELECT 1, cast(geomfromewkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "param", ewkb ); Map<String, Object> params = createQueryParams( "param", ewkb );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -357,8 +395,11 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
WKTWriter writer = new WKTWriter(); WKTWriter writer = new WKTWriter();
String ewkt = "SRID=" + expectationsFactory.getTestSrid() + ";" + writer.write( expectationsFactory.getTestPolygon() ); String ewkt = "SRID=" + expectationsFactory.getTestSrid() + ";" + writer.write( expectationsFactory.getTestPolygon() );
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromEWKT( ewkt ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromEWKT( ewkt );
String hql = format( "SELECT 1, cast(geomfromewkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", String hql = format(
getGeometryTypeFromPackage( pckg ), pckg ); "SELECT 1, cast(geomfromewkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "param", ewkt ); Map<String, Object> params = createQueryParams( "param", ewkt );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -376,8 +417,11 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void geomfromtext(String pckg) throws SQLException { public void geomfromtext(String pckg) throws SQLException {
String text = expectationsFactory.getTestPolygon().toText(); String text = expectationsFactory.getTestPolygon().toText();
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromText( text ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromText( text );
String hql = format( "SELECT 1, cast(geomfromtext(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", String hql = format(
getGeometryTypeFromPackage( pckg ), pckg ); "SELECT 1, cast(geomfromtext(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "param", text ); Map<String, Object> params = createQueryParams( "param", text );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -396,8 +440,11 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
WKBWriter writer = new WKBWriter( 2, false ); WKBWriter writer = new WKBWriter( 2, false );
byte[] wkb = writer.write( expectationsFactory.getTestPolygon() ); byte[] wkb = writer.write( expectationsFactory.getTestPolygon() );
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromWKB( wkb ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromWKB( wkb );
String hql = format( "SELECT 1, cast(geomfromwkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", String hql = format(
getGeometryTypeFromPackage( pckg ), pckg ); "SELECT 1, cast(geomfromwkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "param", wkb ); Map<String, Object> params = createQueryParams( "param", wkb );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -416,8 +463,11 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
WKTWriter writer = new WKTWriter(); WKTWriter writer = new WKTWriter();
String wkt = writer.write( expectationsFactory.getTestPolygon() ); String wkt = writer.write( expectationsFactory.getTestPolygon() );
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromWKT( wkt ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeomFromWKT( wkt );
String hql = format( "SELECT 1, cast(geomfromwkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", String hql = format(
getGeometryTypeFromPackage( pckg ), pckg ); "SELECT 1, cast(geomfromwkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "param", wkt ); Map<String, Object> params = createQueryParams( "param", wkt );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -436,7 +486,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeometryN( 1 ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getGeometryN( 1 );
String hql = format( String hql = format(
"SELECT id, cast(geometryn(geom, :n) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_GeometryCollection'", "SELECT id, cast(geometryn(geom, :n) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_GeometryCollection'",
getGeometryTypeFromPackage( pckg ), pckg ); getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "n", 1 ); Map<String, Object> params = createQueryParams( "n", 1 );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -455,7 +507,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getInteriorRingN( 1 ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getInteriorRingN( 1 );
String hql = format( String hql = format(
"SELECT id, cast(interiorringn(geom, :n) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'", "SELECT id, cast(interiorringn(geom, :n) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'",
getGeometryTypeFromPackage( pckg ), pckg ); getGeometryTypeFromPackage( pckg ),
pckg
);
Map<String, Object> params = createQueryParams( "n", 1 ); Map<String, Object> params = createQueryParams( "n", 1 );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -472,7 +526,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void intersectionaggr(String pckg) throws SQLException { public void intersectionaggr(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getIntersectionAggr(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getIntersectionAggr();
String hql = format( "SELECT cast(count(g) as int), intersectionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", pckg ); String hql = format(
"SELECT cast(count(g) as int), intersectionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -487,11 +544,15 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
} }
public void intersectsrect(String pckg) throws SQLException { public void intersectsrect(String pckg) throws SQLException {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIntersectsRect( (Point) expectationsFactory.getTestPoint().reverse(), Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIntersectsRect(
expectationsFactory.getTestPoint() ); (Point) expectationsFactory.getTestPoint().reverse(),
expectationsFactory.getTestPoint()
);
String hql = format( String hql = format(
"SELECT id, intersectsrect(geom, :pmin, :pmax) FROM org.hibernate.spatial.integration.%s.GeomEntity where intersectsrect(geom, :pmin, :pmax) = true and srid(geom) = %d", "SELECT id, intersectsrect(geom, :pmin, :pmax) FROM org.hibernate.spatial.integration.%s.GeomEntity where intersectsrect(geom, :pmin, :pmax) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
Map<String, Object> params = createQueryParams( "pmin", expectationsFactory.getTestPoint().reverse() ); Map<String, Object> params = createQueryParams( "pmin", expectationsFactory.getTestPoint().reverse() );
params.put( "pmax", expectationsFactory.getTestPoint() ); params.put( "pmax", expectationsFactory.getTestPoint() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
@ -511,7 +572,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIs3D(); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIs3D();
String hql = format( String hql = format(
"SELECT id, is3d(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where is3d(geom) = true and srid(geom) = %d", "SELECT id, is3d(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where is3d(geom) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -529,7 +592,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsClosed(); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsClosed();
String hql = format( String hql = format(
"SELECT id, isclosed(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and isclosed(geom) = true and srid(geom) = %d", "SELECT id, isclosed(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and isclosed(geom) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -547,7 +612,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsMeasured(); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsMeasured();
String hql = format( String hql = format(
"SELECT id, ismeasured(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where ismeasured(geom) = true and srid(geom) = %d", "SELECT id, ismeasured(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where ismeasured(geom) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -565,7 +632,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsRing(); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsRing();
String hql = format( String hql = format(
"SELECT id, isring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d", "SELECT id, isring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -583,7 +652,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsValid(); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getIsValid();
String hql = format( String hql = format(
"SELECT id, isvalid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where isvalid(geom) = true and srid(geom) = %d", "SELECT id, isvalid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where isvalid(geom) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -601,7 +672,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getLength(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getLength();
String hql = format( String hql = format(
"SELECT id, length(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and srid(geom) = %d", "SELECT id, length(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -619,7 +692,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getM(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getM();
String hql = format( String hql = format(
"SELECT id, m(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d", "SELECT id, m(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -637,7 +712,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getMMax(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getMMax();
String hql = format( String hql = format(
"SELECT id, mmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, mmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -655,7 +731,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getMMin(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getMMin();
String hql = format( String hql = format(
"SELECT id, mmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, mmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -673,7 +750,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumGeometries(); Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumGeometries();
String hql = format( String hql = format(
"SELECT id, numgeometries(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_GeometryCollection') and srid(geom) = %d", "SELECT id, numgeometries(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_GeometryCollection') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -691,7 +770,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumInteriorRing(); Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumInteriorRing();
String hql = format( String hql = format(
"SELECT id, numinteriorring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d", "SELECT id, numinteriorring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -709,7 +790,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumInteriorRings(); Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumInteriorRings();
String hql = format( String hql = format(
"SELECT id, numinteriorrings(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d", "SELECT id, numinteriorrings(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -727,7 +810,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumPoints(); Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getNumPoints();
String hql = format( String hql = format(
"SELECT id, numpoints(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d", "SELECT id, numpoints(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -745,7 +830,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getOrderingEquals( expectationsFactory.getTestPolygon() ); Map<Integer, Boolean> dbexpected = hanaExpectationsFactory.getOrderingEquals( expectationsFactory.getTestPolygon() );
String hql = format( String hql = format(
"SELECT id, orderingequals(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where orderingequals(geom, :filter) = true and srid(geom) = %d", "SELECT id, orderingequals(geom, :filter) FROM org.hibernate.spatial.integration.%s.GeomEntity where orderingequals(geom, :filter) = true and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@ -764,7 +851,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getPerimeter(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getPerimeter();
String hql = format( String hql = format(
"SELECT id, perimeter(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d", "SELECT id, perimeter(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -782,7 +871,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getPointOnSurface(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getPointOnSurface();
String hql = format( String hql = format(
"SELECT id, pointonsurface(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d", "SELECT id, pointonsurface(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -800,17 +891,21 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getPointN( 1 ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getPointN( 1 );
String hql = format( String hql = format(
"SELECT id, pointn(geom, :n) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d", "SELECT id, pointn(geom, :n) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
Map<String, Object> params = createQueryParams( "n", 1 ); Map<String, Object> params = createQueryParams( "n", 1 );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }
@Test(expected = SQLException.class) // ST_GEOMETRY columns are not supported // ST_GEOMETRY columns are not supported
@Test(expected = SQLException.class)
public void test_snaptogrid_on_jts() throws SQLException { public void test_snaptogrid_on_jts() throws SQLException {
snaptogrid( JTS ); snaptogrid( JTS );
} }
@Test(expected = SQLException.class) // ST_GEOMETRY columns are not supported // ST_GEOMETRY columns are not supported
@Test(expected = SQLException.class)
public void test_snaptogrid_on_geolatte() throws SQLException { public void test_snaptogrid_on_geolatte() throws SQLException {
snaptogrid( GEOLATTE ); snaptogrid( GEOLATTE );
} }
@ -819,7 +914,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getSnapToGrid(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getSnapToGrid();
String hql = format( String hql = format(
"SELECT id, snaptogrid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, snaptogrid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -835,8 +931,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void startpoint(String pckg) throws SQLException { public void startpoint(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getStartPoint(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getStartPoint();
String hql = format( "SELECT id, startpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'", String hql = format(
pckg ); "SELECT id, startpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -852,7 +950,10 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void unionaggr(String pckg) throws SQLException { public void unionaggr(String pckg) throws SQLException {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getUnionAggr(); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getUnionAggr();
String hql = format( "SELECT cast(count(g) as int), unionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", pckg ); String hql = format(
"SELECT cast(count(g) as int), unionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g",
pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -870,7 +971,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getX(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getX();
String hql = format( String hql = format(
"SELECT id, x(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d", "SELECT id, x(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -888,7 +991,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getXMax(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getXMax();
String hql = format( String hql = format(
"SELECT id, xmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, xmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -906,7 +1010,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getXMin(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getXMin();
String hql = format( String hql = format(
"SELECT id, xmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, xmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -924,7 +1029,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getY(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getY();
String hql = format( String hql = format(
"SELECT id, y(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d", "SELECT id, y(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -942,7 +1049,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getYMax(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getYMax();
String hql = format( String hql = format(
"SELECT id, ymax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, ymax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -960,7 +1068,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getYMin(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getYMin();
String hql = format( String hql = format(
"SELECT id, ymin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, ymin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -978,7 +1087,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZ(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZ();
String hql = format( String hql = format(
"SELECT id, z(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d", "SELECT id, z(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg,
expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -996,7 +1107,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZMax(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZMax();
String hql = format( String hql = format(
"SELECT id, zmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, zmax(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1014,7 +1126,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZMin(); Map<Integer, Double> dbexpected = hanaExpectationsFactory.getZMin();
String hql = format( String hql = format(
"SELECT id, zmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d", "SELECT id, zmin(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() ); pckg, expectationsFactory.getTestSrid()
);
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1032,14 +1145,16 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getNestedFunctionInner( expectationsFactory.getTestPolygon() ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getNestedFunctionInner( expectationsFactory.getTestPolygon() );
String hql = format( String hql = format(
"SELECT id, geom FROM org.hibernate.spatial.integration.%s.GeomEntity g where dwithin(geom, srid(:filter, 0), 1) = true", "SELECT id, geom FROM org.hibernate.spatial.integration.%s.GeomEntity g where dwithin(geom, srid(:filter, 0), 1) = true",
pckg ); pckg
);
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
dbexpected = hanaExpectationsFactory.getNestedFunctionOuter( expectationsFactory.getTestPolygon() ); dbexpected = hanaExpectationsFactory.getNestedFunctionOuter( expectationsFactory.getTestPolygon() );
hql = format( hql = format(
"SELECT id, geom FROM org.hibernate.spatial.integration.%s.GeomEntity g where dwithin(:filter, srid(geom, 0), 1) = true", "SELECT id, geom FROM org.hibernate.spatial.integration.%s.GeomEntity g where dwithin(:filter, srid(geom, 0), 1) = true",
pckg ); pckg
);
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }

View File

@ -32,9 +32,9 @@ import static org.junit.Assert.assertEquals;
*/ */
public class PostgisUnmarshalTest { public class PostgisUnmarshalTest {
private CoordinateReferenceSystem<G2D> crs = CoordinateReferenceSystems.WGS84; private final CoordinateReferenceSystem<G2D> crs = CoordinateReferenceSystems.WGS84;
private Geometry<G2D> geom = linestring( crs, g( 6.123, 53.234 ), g( 6.133, 53.244 ) ); private final Geometry<G2D> geom = linestring( crs, g( 6.123, 53.234 ), g( 6.133, 53.244 ) );
private Geometry<C2D> geomNoSrid = linestring( private final Geometry<C2D> geomNoSrid = linestring(
CoordinateReferenceSystems.PROJECTED_2D_METER, CoordinateReferenceSystems.PROJECTED_2D_METER,
c( 6.123, 53.234 ), c( 6.123, 53.234 ),
c( 6.133, 53.244 ) c( 6.133, 53.244 )

View File

@ -1,3 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.integration; package org.hibernate.spatial.integration;
import java.util.HashMap; import java.util.HashMap;
@ -66,7 +73,7 @@ public abstract class AbstractTestStoreRetrieve<G, E extends GeomEntityLike<G>>
tx = session.beginTransaction(); tx = session.beginTransaction();
for ( E storedEntity : stored.values() ) { for ( E storedEntity : stored.values() ) {
id = storedEntity.getId(); id = storedEntity.getId();
E retrievedEntity = (E) session.get( getGeomEntityClass(), id ); E retrievedEntity = session.get( getGeomEntityClass(), id );
G retrievedGeometry = retrievedEntity.getGeom(); G retrievedGeometry = retrievedEntity.getGeom();
G storedGeometry = storedEntity.getGeom(); G storedGeometry = storedEntity.getGeom();
String msg = createFailureMessage( storedEntity.getId(), storedGeometry, retrievedGeometry ); String msg = createFailureMessage( storedEntity.getId(), storedGeometry, retrievedGeometry );
@ -110,7 +117,6 @@ public abstract class AbstractTestStoreRetrieve<G, E extends GeomEntityLike<G>>
for ( TestDataElement element : testData ) { for ( TestDataElement element : testData ) {
id = element.id; id = element.id;
tx = session.beginTransaction(); tx = session.beginTransaction();
;
E entity = createFrom( element, dialect ); E entity = createFrom( element, dialect );
stored.put( entity.getId(), entity ); stored.put( entity.getId(), entity );
session.save( entity ); session.save( entity );

View File

@ -1,3 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.integration; package org.hibernate.spatial.integration;
import org.hibernate.dialect.AbstractHANADialect; import org.hibernate.dialect.AbstractHANADialect;

View File

@ -1,3 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.integration; package org.hibernate.spatial.integration;
/** /**

View File

@ -41,7 +41,7 @@ import static org.junit.Assert.fail;
@SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426") @SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426")
public class TestGeolatteSpatialPredicates extends SpatialFunctionalTestCase { public class TestGeolatteSpatialPredicates extends SpatialFunctionalTestCase {
private static HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
TestGeolatteSpatialPredicates.class.getName() TestGeolatteSpatialPredicates.class.getName()
); );

View File

@ -41,7 +41,7 @@ import static org.junit.Assert.fail;
@SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426") @SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426")
public class TestJTSSpatialPredicates extends SpatialFunctionalTestCase { public class TestJTSSpatialPredicates extends SpatialFunctionalTestCase {
private static HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
TestJTSSpatialPredicates.class.getName() TestJTSSpatialPredicates.class.getName()
); );

View File

@ -473,7 +473,9 @@ public class TestSpatialFunctions extends SpatialFunctionalTestCase {
} }
Map<Integer, Double> dbexpected = expectationsFactory.getDistance( expectationsFactory.getTestPolygon() ); Map<Integer, Double> dbexpected = expectationsFactory.getDistance( expectationsFactory.getTestPolygon() );
String hql = format( String hql = format(
"SELECT id, distance(geom, :filter) from %s where srid(geom) = %d", entityName( pckg ), expectationsFactory.getTestSrid() "SELECT id, distance(geom, :filter) from %s where srid(geom) = %d",
entityName( pckg ),
expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );

View File

@ -9,6 +9,7 @@ package org.hibernate.spatial.integration;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import org.hibernate.Criteria; import org.hibernate.Criteria;
@ -36,7 +37,7 @@ import static org.junit.Assert.fail;
@SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426") @SkipForDialect(value = HANASpatialDialect.class, comment = "The HANA dialect is tested via org.hibernate.spatial.dialect.hana.TestHANASpatialFunctions", jiraKey = "HHH-12426")
public class TestSpatialRestrictions extends SpatialFunctionalTestCase { public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
private static HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
TestSpatialRestrictions.class.getName() TestSpatialRestrictions.class.getName()
); );
@ -208,7 +209,11 @@ public class TestSpatialRestrictions extends SpatialFunctionalTestCase {
if ( entry.getValue() ) { if ( entry.getValue() ) {
cnt++; cnt++;
if ( !findInList( entry.getKey(), (List<JtsGeomEntity>) list ) ) { if ( !findInList( entry.getKey(), (List<JtsGeomEntity>) list ) ) {
fail( String.format( "Expected object with id= %d, but not found in result", entry.getKey() ) ); fail( String.format(
Locale.ENGLISH,
"Expected object with id= %d, but not found in result",
entry.getKey()
) );
} }
} }
} }

View File

@ -88,11 +88,7 @@ public class GeomEntity implements GeomEntityLike<Geometry> {
GeomEntity geomEntity = (GeomEntity) o; GeomEntity geomEntity = (GeomEntity) o;
if ( !id.equals( geomEntity.id ) ) { return id.equals( geomEntity.id );
return false;
}
return true;
} }
@Override @Override

View File

@ -28,7 +28,7 @@ import org.geolatte.geom.codec.WktDecodeException;
@Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect") @Skip(condition = SpatialDialectMatcher.class, message = "No Spatial Dialect")
public class TestStoreRetrieveUsingGeolatte extends AbstractTestStoreRetrieve<Geometry, GeomEntity> { public class TestStoreRetrieveUsingGeolatte extends AbstractTestStoreRetrieve<Geometry, GeomEntity> {
private static HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
TestStoreRetrieveUsingGeolatte.class.getName() TestStoreRetrieveUsingGeolatte.class.getName()
); );

View File

@ -82,11 +82,7 @@ public class JtsGeomEntity implements GeomEntityLike<Geometry> {
JtsGeomEntity geomEntity = (JtsGeomEntity) o; JtsGeomEntity geomEntity = (JtsGeomEntity) o;
if ( !id.equals( geomEntity.id ) ) { return id.equals( geomEntity.id );
return false;
}
return true;
} }
@Override @Override

View File

@ -793,8 +793,7 @@ public abstract class AbstractExpectationsFactory {
case STRING: case STRING:
expected.put( id, (T) results.getString( 2 ) ); expected.put( id, (T) results.getString( 2 ) );
break; break;
case INTEGER: case INTEGER: {
{
Long value = Long.valueOf( results.getLong( 2 ) ); Long value = Long.valueOf( results.getLong( 2 ) );
if ( results.wasNull() ) { if ( results.wasNull() ) {
value = null; // This is required because the Hibernate BasicExtractor also checks ResultSet#wasNull which can lead to a mismatch between the expected and the actual results value = null; // This is required because the Hibernate BasicExtractor also checks ResultSet#wasNull which can lead to a mismatch between the expected and the actual results
@ -802,8 +801,7 @@ public abstract class AbstractExpectationsFactory {
expected.put( id, (T) value ); expected.put( id, (T) value );
} }
break; break;
case DOUBLE: case DOUBLE: {
{
Double value = Double.valueOf( results.getDouble( 2 ) ); Double value = Double.valueOf( results.getDouble( 2 ) );
if ( results.wasNull() ) { if ( results.wasNull() ) {
value = null; //this is required because SQL Server converts automatically null to 0.0 value = null; //this is required because SQL Server converts automatically null to 0.0

View File

@ -14,6 +14,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.StringWriter; import java.io.StringWriter;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
@ -42,7 +43,7 @@ import org.geolatte.geom.codec.WktDecoder;
public class DataSourceUtils { public class DataSourceUtils {
private static HSMessageLogger LOG = Logger.getMessageLogger( private static final HSMessageLogger LOG = Logger.getMessageLogger(
HSMessageLogger.class, HSMessageLogger.class,
DataSourceUtils.class.getName() DataSourceUtils.class.getName()
); );
@ -257,7 +258,7 @@ public class DataSourceUtils {
BufferedReader reader = null; BufferedReader reader = null;
try { try {
reader = new BufferedReader( reader = new BufferedReader(
new InputStreamReader( is, Charset.forName( "UTF-8" ) ) new InputStreamReader( is, StandardCharsets.UTF_8 )
); );
StringWriter sw = new StringWriter(); StringWriter sw = new StringWriter();

View File

@ -1,3 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.testing; package org.hibernate.spatial.testing;
import org.geolatte.geom.Geometry; import org.geolatte.geom.Geometry;

View File

@ -1,3 +1,10 @@
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.spatial.testing; package org.hibernate.spatial.testing;
/** /**

View File

@ -29,7 +29,7 @@ public interface NativeSQLStatement {
* *
* @throws SQLException * @throws SQLException
*/ */
public PreparedStatement prepare(Connection connection) throws SQLException; PreparedStatement prepare(Connection connection) throws SQLException;
public String toString(); String toString();
} }

View File

@ -22,6 +22,6 @@ public interface SQLExpressionTemplate {
* *
* @return an insert SQL for testDataElement * @return an insert SQL for testDataElement
*/ */
public String toInsertSql(TestDataElement testDataElement); String toInsertSql(TestDataElement testDataElement);
} }

View File

@ -75,7 +75,7 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
try { try {
session = openSession(); session = openSession();
tx = session.beginTransaction(); tx = session.beginTransaction();
String hql = String.format( "delete from %s", entityName(pckg) ); String hql = String.format( "delete from %s", entityName( pckg ) );
Query q = session.createQuery( hql ); Query q = session.createQuery( hql );
q.executeUpdate(); q.executeUpdate();
tx.commit(); tx.commit();
@ -238,7 +238,7 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
"Failure on testsuite-suite for case " + id, "Failure on testsuite-suite for case " + id,
geometryEquality.test( geometryEquality.test(
(Geometry) expected, (Geometry) expected,
(Geometry) org.geolatte.geom.jts.JTS.to( (org.geolatte.geom.Geometry) received ) org.geolatte.geom.jts.JTS.to( (org.geolatte.geom.Geometry) received )
) )
); );
} }
@ -255,9 +255,10 @@ public abstract class SpatialFunctionalTestCase extends BaseCoreFunctionalTestCa
} }
protected String entityName(String pckg) { protected String entityName(String pckg) {
if (JTS.equalsIgnoreCase( pckg )) { if ( JTS.equalsIgnoreCase( pckg ) ) {
return "org.hibernate.spatial.integration.jts.JtsGeomEntity"; return "org.hibernate.spatial.integration.jts.JtsGeomEntity";
} else { }
else {
return "org.hibernate.spatial.integration.geolatte.GeomEntity"; return "org.hibernate.spatial.integration.geolatte.GeomEntity";
} }
} }

View File

@ -26,8 +26,6 @@ public class TestData implements List<TestDataElement> {
protected TestData() { protected TestData() {
} }
;
public static TestData fromFile(String fileName) { public static TestData fromFile(String fileName) {
TestDataReader reader = new TestDataReader(); TestDataReader reader = new TestDataReader();
return fromFile( fileName, reader ); return fromFile( fileName, reader );

View File

@ -27,7 +27,7 @@ import org.hibernate.spatial.testing.dialects.sqlserver.SQLServerTestSupport;
*/ */
public class TestSupportFactories { public class TestSupportFactories {
private static TestSupportFactories instance = new TestSupportFactories(); private static final TestSupportFactories instance = new TestSupportFactories();
private TestSupportFactories() { private TestSupportFactories() {
} }

View File

@ -16,8 +16,8 @@ import org.geolatte.geom.Geometry;
/** /**
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Converter( autoApply = true ) @Converter(autoApply = true)
public class GeometryConverter implements AttributeConverter<Geometry,byte[]> { public class GeometryConverter implements AttributeConverter<Geometry, byte[]> {
@Override @Override
public byte[] convertToDatabaseColumn(Geometry attribute) { public byte[] convertToDatabaseColumn(Geometry attribute) {
if ( attribute == null ) { if ( attribute == null ) {

View File

@ -36,17 +36,17 @@ public class GeometryConverterTest extends BaseUnitTestCase {
@Test @Test
public void testConverterUsage() { public void testConverterUsage() {
try ( final StandardServiceRegistry ssr = new StandardServiceRegistryBuilder() try (final StandardServiceRegistry ssr = new StandardServiceRegistryBuilder()
.applySetting( AvailableSettings.DIALECT, GeoDBDialect.class ) .applySetting( AvailableSettings.DIALECT, GeoDBDialect.class )
.applySetting( AvailableSettings.HBM2DDL_AUTO, Action.CREATE_DROP ) .applySetting( AvailableSettings.HBM2DDL_AUTO, Action.CREATE_DROP )
.build() ) { .build()) {
final MetadataSources metadataSources = new MetadataSources( ssr ) final MetadataSources metadataSources = new MetadataSources( ssr )
.addAnnotatedClass( GeometryConverter.class ) .addAnnotatedClass( GeometryConverter.class )
.addAnnotatedClass( MyEntity.class ); .addAnnotatedClass( MyEntity.class );
final MetadataBuilderImplementor metadataBuilder = (MetadataBuilderImplementor) metadataSources.getMetadataBuilder(); final MetadataBuilderImplementor metadataBuilder = (MetadataBuilderImplementor) metadataSources.getMetadataBuilder();
try ( final SessionFactoryImplementor sessionFactory = try (final SessionFactoryImplementor sessionFactory = (SessionFactoryImplementor) metadataBuilder.build()
(SessionFactoryImplementor) metadataBuilder.build().buildSessionFactory() ) { .buildSessionFactory()) {
final TypeConfiguration typeConfiguration = sessionFactory.getMetamodel().getTypeConfiguration(); final TypeConfiguration typeConfiguration = sessionFactory.getMetamodel().getTypeConfiguration();

View File

@ -17,7 +17,7 @@ import org.geolatte.geom.Geometry;
* @author Steve Ebersole * @author Steve Ebersole
*/ */
@Entity @Entity
@Table( name = "SP_CUST_TYPE_CONV_ENTITY") @Table(name = "SP_CUST_TYPE_CONV_ENTITY")
public class MyEntity { public class MyEntity {
private Integer id; private Integer id;
private Geometry geometry; private Geometry geometry;

View File

@ -1,24 +1,9 @@
/* /*
* This file is part of Hibernate Spatial, an extension to the * Hibernate, Relational Persistence for Idiomatic Java
* hibernate ORM solution for spatial (geographic) data.
* *
* Copyright © 2014 Adtech Geospatial * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* 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.testing.dialects.db2; package org.hibernate.spatial.testing.dialects.db2;
import java.sql.SQLException; import java.sql.SQLException;

View File

@ -1,24 +1,9 @@
/* /*
* This file is part of Hibernate Spatial, an extension to the * Hibernate, Relational Persistence for Idiomatic Java
* hibernate ORM solution for spatial (geographic) data.
* *
* Copyright © 2014 Adtech Geospatial * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* 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.testing.dialects.db2; package org.hibernate.spatial.testing.dialects.db2;
import java.sql.SQLException; import java.sql.SQLException;

View File

@ -1,24 +1,9 @@
/* /*
* This file is part of Hibernate Spatial, an extension to the * Hibernate, Relational Persistence for Idiomatic Java
* hibernate ORM solution for spatial (geographic) data.
* *
* Copyright © 2014 Adtech Geospatial * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* 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.testing.dialects.db2; package org.hibernate.spatial.testing.dialects.db2;
import org.hibernate.spatial.testing.SQLExpressionTemplate; import org.hibernate.spatial.testing.SQLExpressionTemplate;

View File

@ -1,22 +1,8 @@
/* /*
* This file is part of Hibernate Spatial, an extension to the * Hibernate, Relational Persistence for Idiomatic Java
* hibernate ORM solution for spatial (geographic) data.
* *
* Copyright © 2014 Adtech Geospatial * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* * See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
* 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.testing.dialects.db2; package org.hibernate.spatial.testing.dialects.db2;
@ -35,8 +21,8 @@ import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
public class DB2TestSupport extends TestSupport { public class DB2TestSupport extends TestSupport {
public TestData createTestData(BaseCoreFunctionalTestCase testcase) { public TestData createTestData(BaseCoreFunctionalTestCase testcase) {
if ( "org.hibernate.spatial.integration.TestSpatialFunctions".equals( testcase.getClass() if ( "org.hibernate.spatial.integration.TestSpatialFunctions".equals(
.getCanonicalName() ) ) { testcase.getClass().getCanonicalName() ) ) {
return TestData.fromFile( "db2/test-db2nozm-only-polygon.xml" ); return TestData.fromFile( "db2/test-db2nozm-only-polygon.xml" );
} }
return TestData.fromFile( "db2/test-db2nozm-data-set.xml" ); return TestData.fromFile( "db2/test-db2nozm-data-set.xml" );

View File

@ -44,7 +44,7 @@ public class GeoDBDataSourceUtils extends DataSourceUtils {
String errorMsg = "Problem initializing GeoDB."; String errorMsg = "Problem initializing GeoDB.";
try { try {
Class<?> geoDB = Thread.currentThread().getContextClassLoader().loadClass( "geodb.GeoDB" ); Class<?> geoDB = Thread.currentThread().getContextClassLoader().loadClass( "geodb.GeoDB" );
Method m = geoDB.getDeclaredMethod( "InitGeoDB", new Class[] { Connection.class } ); Method m = geoDB.getDeclaredMethod( "InitGeoDB", Connection.class );
m.invoke( null, conn ); m.invoke( null, conn );
} }
catch (ClassNotFoundException e) { catch (ClassNotFoundException e) {

View File

@ -38,7 +38,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
protected NativeSQLStatement createNativeBufferStatement(Double distance) { protected NativeSQLStatement createNativeBufferStatement(Double distance) {
return createNativeSQLStatement( return createNativeSQLStatement(
"select t.id, t.geom.ST_Buffer(?) from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(), "select t.id, t.geom.ST_Buffer(?) from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(),
new Object[]{ distance } ); new Object[] { distance }
);
} }
@Override @Override
@ -46,7 +47,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Union(ST_GeomFromText(?, " + getTestSrid() + ")).ST_ConvexHull().ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " "select t.id, t.geom.ST_Union(ST_GeomFromText(?, " + getTestSrid() + ")).ST_ConvexHull().ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -54,7 +56,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Intersection(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " "select t.id, t.geom.ST_Intersection(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -62,7 +65,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Difference(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " "select t.id, t.geom.ST_Difference(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -70,14 +74,16 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_SymDifference(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " "select t.id, t.geom.ST_SymDifference(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
protected NativeSQLStatement createNativeGeomUnionStatement(Geometry geom) { protected NativeSQLStatement createNativeGeomUnionStatement(Geometry geom) {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Union(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(), "select t.id, t.geom.ST_Union(ST_GeomFromText(?, " + getTestSrid() + ")).ST_AsEWKB() from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -138,7 +144,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Within(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Within(ST_GeomFromText(?, " "select t.id, t.geom.ST_Within(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Within(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -146,7 +153,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Equals(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Equals(ST_GeomFromText(?, " "select t.id, t.geom.ST_Equals(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Equals(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -154,7 +162,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Crosses(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Crosses(ST_GeomFromText(?, " "select t.id, t.geom.ST_Crosses(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Crosses(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -162,7 +171,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Contains(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Contains(ST_GeomFromText(?, " "select t.id, t.geom.ST_Contains(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Contains(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -170,7 +180,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Disjoint(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Disjoint(ST_GeomFromText(?, " "select t.id, t.geom.ST_Disjoint(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Disjoint(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -189,7 +200,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Intersects(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Intersects(ST_GeomFromText(?, " "select t.id, t.geom.ST_Intersects(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Intersects(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -198,7 +210,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
"select t.id, t.geom.ST_IntersectsFilter(ST_GeomFromText(?, " + getTestSrid() "select t.id, t.geom.ST_IntersectsFilter(ST_GeomFromText(?, " + getTestSrid()
+ ")) from GeomTest t where t.geom.ST_IntersectsFilter(ST_GeomFromText(?, " + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + ")) from GeomTest t where t.geom.ST_IntersectsFilter(ST_GeomFromText(?, " + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -206,7 +219,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Touches(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Touches(ST_GeomFromText(?, " "select t.id, t.geom.ST_Touches(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Touches(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -214,7 +228,8 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Overlaps(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Overlaps(ST_GeomFromText(?, " "select t.id, t.geom.ST_Overlaps(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Overlaps(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -231,14 +246,16 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
"select t.id, t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid() + "), " "select t.id, t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid() + "), "
+ distance + ") from GeomTest t where t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid() + "), " + distance + distance + ") from GeomTest t where t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid() + "), " + distance
+ ") = 1 and t.geom.ST_SRID() = " + getTestSrid(), + ") = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
protected NativeSQLStatement createNativeDistanceStatement(Geometry geom) { protected NativeSQLStatement createNativeDistanceStatement(Geometry geom) {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Distance(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(), "select t.id, t.geom.ST_Distance(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
@Override @Override
@ -263,6 +280,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected alpha shapes of all testsuite-suite geometries. * Returns the expected alpha shapes of all testsuite-suite geometries.
* *
* @return map of identifier, alpha shape * @return map of identifier, alpha shape
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getAlphaShape(double radius) throws SQLException { public Map<Integer, Geometry> getAlphaShape(double radius) throws SQLException {
@ -272,13 +290,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
private NativeSQLStatement createNativeAlphaShapeStatement(double radius) { private NativeSQLStatement createNativeAlphaShapeStatement(double radius) {
return createNativeSQLStatement( return createNativeSQLStatement(
"select t.id, t.geom.ST_AlphaShape(?).ST_AsEWKB() from GeomTest t where t.geom.ST_GeometryType() in ('ST_Point', 'ST_MultiPoint')", "select t.id, t.geom.ST_AlphaShape(?).ST_AsEWKB() from GeomTest t where t.geom.ST_GeometryType() in ('ST_Point', 'ST_MultiPoint')",
new Object[]{ radius } ); new Object[] { radius }
);
} }
/** /**
* Returns the expected area of all testsuite-suite geometries. * Returns the expected area of all testsuite-suite geometries.
* *
* @return map of identifier, area * @return map of identifier, area
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getArea() throws SQLException { public Map<Integer, Double> getArea() throws SQLException {
@ -286,13 +306,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeAreaStatement() { private NativeSQLStatement createNativeAreaStatement() {
return createNativeSQLStatement( "select t.id, t.geom.ST_Area() from GeomTest t where t.geom.ST_GeometryType() in ('ST_Polygon', 'ST_MultiPolygon')" ); return createNativeSQLStatement(
"select t.id, t.geom.ST_Area() from GeomTest t where t.geom.ST_GeometryType() in ('ST_Polygon', 'ST_MultiPolygon')" );
} }
/** /**
* Returns the expected EWKB representation of all testsuite-suite geometries. * Returns the expected EWKB representation of all testsuite-suite geometries.
* *
* @return map of identifier, EWKB * @return map of identifier, EWKB
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, byte[]> getAsEWKB() throws SQLException { public Map<Integer, byte[]> getAsEWKB() throws SQLException {
@ -307,6 +329,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected EWKT representation of all testsuite-suite geometries. * Returns the expected EWKT representation of all testsuite-suite geometries.
* *
* @return map of identifier, EWKT * @return map of identifier, EWKT
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, String> getAsEWKT() throws SQLException { public Map<Integer, String> getAsEWKT() throws SQLException {
@ -321,6 +344,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected GeoJSON representation of all testsuite-suite geometries. * Returns the expected GeoJSON representation of all testsuite-suite geometries.
* *
* @return map of identifier, GeoJSON * @return map of identifier, GeoJSON
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, String> getAsGeoJSON() throws SQLException { public Map<Integer, String> getAsGeoJSON() throws SQLException {
@ -335,6 +359,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected SVG representation of all testsuite-suite geometries. * Returns the expected SVG representation of all testsuite-suite geometries.
* *
* @return map of identifier, SVG * @return map of identifier, SVG
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, String> getAsSVG() throws SQLException { public Map<Integer, String> getAsSVG() throws SQLException {
@ -349,6 +374,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected aggregated SVG representation of all testsuite-suite geometries. * Returns the expected aggregated SVG representation of all testsuite-suite geometries.
* *
* @return map of count, SVG * @return map of count, SVG
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, String> getAsSVGAggr() throws SQLException { public Map<Integer, String> getAsSVGAggr() throws SQLException {
@ -363,6 +389,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected WKB representation of all testsuite-suite geometries. * Returns the expected WKB representation of all testsuite-suite geometries.
* *
* @return map of identifier, WKB * @return map of identifier, WKB
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, byte[]> getAsWKB() throws SQLException { public Map<Integer, byte[]> getAsWKB() throws SQLException {
@ -377,6 +404,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected WKT representation of all testsuite-suite geometries. * Returns the expected WKT representation of all testsuite-suite geometries.
* *
* @return map of identifier, WKT * @return map of identifier, WKT
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, String> getAsWKT() throws SQLException { public Map<Integer, String> getAsWKT() throws SQLException {
@ -391,6 +419,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected centroid of all testsuite-suite geometries. * Returns the expected centroid of all testsuite-suite geometries.
* *
* @return map of id, centroid * @return map of id, centroid
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getCentroid() throws SQLException { public Map<Integer, Geometry> getCentroid() throws SQLException {
@ -398,13 +427,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeCentroidStatement() { private NativeSQLStatement createNativeCentroidStatement() {
return createNativeSQLStatement( "select id, t.geom.ST_Centroid() from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'" ); return createNativeSQLStatement(
"select id, t.geom.ST_Centroid() from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'" );
} }
/** /**
* Returns the expected aggregated convex hull representation of all testsuite-suite geometries. * Returns the expected aggregated convex hull representation of all testsuite-suite geometries.
* *
* @return map of count, convex hull * @return map of count, convex hull
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getConvexHullAggr() throws SQLException { public Map<Integer, Geometry> getConvexHullAggr() throws SQLException {
@ -419,6 +450,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected number of coordinate dimensions of all testsuite-suite geometries. * Returns the expected number of coordinate dimensions of all testsuite-suite geometries.
* *
* @return map of identifier, coordinate dimension * @return map of identifier, coordinate dimension
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Integer> getCoordDim() throws SQLException { public Map<Integer, Integer> getCoordDim() throws SQLException {
@ -433,6 +465,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are covered by the given geometry. * Returns the testsuite-suite geometries that are covered by the given geometry.
* *
* @return map of identifier, whether the geometry is covered * @return map of identifier, whether the geometry is covered
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getCoveredBy(Geometry geom) throws SQLException { public Map<Integer, Boolean> getCoveredBy(Geometry geom) throws SQLException {
@ -443,13 +476,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_CoveredBy(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_CoveredBy(ST_GeomFromText(?, " "select t.id, t.geom.ST_CoveredBy(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_CoveredBy(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
/** /**
* Returns the testsuite-suite geometries that are cover the given geometry. * Returns the testsuite-suite geometries that are cover the given geometry.
* *
* @return map of identifier, whether the geometry covers the given geometry * @return map of identifier, whether the geometry covers the given geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getCovers(Geometry geom) throws SQLException { public Map<Integer, Boolean> getCovers(Geometry geom) throws SQLException {
@ -460,13 +495,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_Covers(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Covers(ST_GeomFromText(?, " "select t.id, t.geom.ST_Covers(ST_GeomFromText(?, " + getTestSrid() + ")) from GeomTest t where t.geom.ST_Covers(ST_GeomFromText(?, "
+ getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
/** /**
* Returns the expected endpoint of all testsuite-suite geometries. * Returns the expected endpoint of all testsuite-suite geometries.
* *
* @return map of id, endpoint * @return map of id, endpoint
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getEndPoint() throws SQLException { public Map<Integer, Geometry> getEndPoint() throws SQLException {
@ -474,13 +511,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeEndPointStatement() { private NativeSQLStatement createNativeEndPointStatement() {
return createNativeSQLStatement( "select id, t.geom.ST_EndPoint() from GeomTest t where t.geom.ST_GeometryType() = 'ST_LineString'" ); return createNativeSQLStatement(
"select id, t.geom.ST_EndPoint() from GeomTest t where t.geom.ST_GeometryType() = 'ST_LineString'" );
} }
/** /**
* Returns the expected aggregated bounding rectangle of all testsuite-suite geometries. * Returns the expected aggregated bounding rectangle of all testsuite-suite geometries.
* *
* @return map of count, bounding rectangle * @return map of count, bounding rectangle
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getEnvelopeAggr() throws SQLException { public Map<Integer, Geometry> getEnvelopeAggr() throws SQLException {
@ -495,6 +534,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected exterior ring of all testsuite-suite geometries. * Returns the expected exterior ring of all testsuite-suite geometries.
* *
* @return map of id, exterior ring * @return map of id, exterior ring
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getExteriorRing() throws SQLException { public Map<Integer, Geometry> getExteriorRing() throws SQLException {
@ -502,13 +542,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeExteriorRingStatement() { private NativeSQLStatement createNativeExteriorRingStatement() {
return createNativeSQLStatement( "select id, t.geom.ST_ExteriorRing() from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'" ); return createNativeSQLStatement(
"select id, t.geom.ST_ExteriorRing() from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'" );
} }
/** /**
* Returns the geometry from an EWKB representation. * Returns the geometry from an EWKB representation.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeomFromEWKB(byte[] ewkb) throws SQLException { public Map<Integer, Geometry> getGeomFromEWKB(byte[] ewkb) throws SQLException {
@ -516,13 +558,14 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeomFromEWKBStatement(byte[] ewkb) { private NativeSQLStatement createNativeGeomFromEWKBStatement(byte[] ewkb) {
return createNativeSQLStatement( "select 1, ST_GeomFromEWKB(?) from GeomTest t", new Object[]{ ewkb } ); return createNativeSQLStatement( "select 1, ST_GeomFromEWKB(?) from GeomTest t", new Object[] { ewkb } );
} }
/** /**
* Returns the geometry from an EWKT representation. * Returns the geometry from an EWKT representation.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeomFromEWKT(String ewkt) throws SQLException { public Map<Integer, Geometry> getGeomFromEWKT(String ewkt) throws SQLException {
@ -530,13 +573,14 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeomFromEWKTStatement(String ewkt) { private NativeSQLStatement createNativeGeomFromEWKTStatement(String ewkt) {
return createNativeSQLStatement( "select 1, ST_GeomFromEWKT(?) from GeomTest t", new Object[]{ ewkt } ); return createNativeSQLStatement( "select 1, ST_GeomFromEWKT(?) from GeomTest t", new Object[] { ewkt } );
} }
/** /**
* Returns the geometry from a text representation. * Returns the geometry from a text representation.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeomFromText(String text) throws SQLException { public Map<Integer, Geometry> getGeomFromText(String text) throws SQLException {
@ -544,13 +588,14 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeomFromTextStatement(String text) { private NativeSQLStatement createNativeGeomFromTextStatement(String text) {
return createNativeSQLStatement( "select 1, ST_GeomFromText(?) from GeomTest t", new Object[]{ text } ); return createNativeSQLStatement( "select 1, ST_GeomFromText(?) from GeomTest t", new Object[] { text } );
} }
/** /**
* Returns the geometry from a WKB representation. * Returns the geometry from a WKB representation.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeomFromWKB(byte[] wkb) throws SQLException { public Map<Integer, Geometry> getGeomFromWKB(byte[] wkb) throws SQLException {
@ -558,13 +603,14 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeomFromWKBStatement(byte[] wkb) { private NativeSQLStatement createNativeGeomFromWKBStatement(byte[] wkb) {
return createNativeSQLStatement( "select 1, ST_GeomFromWKB(?) from GeomTest t", new Object[]{ wkb } ); return createNativeSQLStatement( "select 1, ST_GeomFromWKB(?) from GeomTest t", new Object[] { wkb } );
} }
/** /**
* Returns the geometry from a WKT representation. * Returns the geometry from a WKT representation.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeomFromWKT(String wkt) throws SQLException { public Map<Integer, Geometry> getGeomFromWKT(String wkt) throws SQLException {
@ -572,13 +618,14 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeomFromWKTStatement(String wkt) { private NativeSQLStatement createNativeGeomFromWKTStatement(String wkt) {
return createNativeSQLStatement( "select 1, ST_GeomFromWKT(?) from GeomTest t", new Object[]{ wkt } ); return createNativeSQLStatement( "select 1, ST_GeomFromWKT(?) from GeomTest t", new Object[] { wkt } );
} }
/** /**
* Returns the expected nth geometry of all testsuite-suite geometries. * Returns the expected nth geometry of all testsuite-suite geometries.
* *
* @return map of id, geometry * @return map of id, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getGeometryN(int n) throws SQLException { public Map<Integer, Geometry> getGeometryN(int n) throws SQLException {
@ -586,14 +633,17 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeGeometryNStatement(int n) { private NativeSQLStatement createNativeGeometryNStatement(int n) {
return createNativeSQLStatement( "select id, t.geom.ST_GeometryN(?) from GeomTest t where t.geom.ST_GeometryType() = 'ST_GeometryCollection'", return createNativeSQLStatement(
new Object[]{ n } ); "select id, t.geom.ST_GeometryN(?) from GeomTest t where t.geom.ST_GeometryType() = 'ST_GeometryCollection'",
new Object[] { n }
);
} }
/** /**
* Returns the expected nth interior ring of all testsuite-suite geometries. * Returns the expected nth interior ring of all testsuite-suite geometries.
* *
* @return map of id, interior ring * @return map of id, interior ring
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getInteriorRingN(int n) throws SQLException { public Map<Integer, Geometry> getInteriorRingN(int n) throws SQLException {
@ -601,14 +651,17 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeInteriorRingNStatement(int n) { private NativeSQLStatement createNativeInteriorRingNStatement(int n) {
return createNativeSQLStatement( "select id, t.geom.ST_InteriorRingN(?) from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'", return createNativeSQLStatement(
new Object[]{ n } ); "select id, t.geom.ST_InteriorRingN(?) from GeomTest t where t.geom.ST_GeometryType() = 'ST_Polygon'",
new Object[] { n }
);
} }
/** /**
* Returns the expected aggregated intersection of all testsuite-suite geometries. * Returns the expected aggregated intersection of all testsuite-suite geometries.
* *
* @return map of count, intersection * @return map of count, intersection
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getIntersectionAggr() throws SQLException { public Map<Integer, Geometry> getIntersectionAggr() throws SQLException {
@ -623,6 +676,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that intersect the given rectangle. * Returns the testsuite-suite geometries that intersect the given rectangle.
* *
* @return map of identifier, whether the geometry intersects the given rectangle * @return map of identifier, whether the geometry intersects the given rectangle
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIntersectsRect(Point pmin, Point pmax) throws SQLException { public Map<Integer, Boolean> getIntersectsRect(Point pmin, Point pmax) throws SQLException {
@ -634,13 +688,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
"select t.id, t.geom.ST_IntersectsRect(ST_GeomFromText(?, " + getTestSrid() + "), ST_GeomFromText(?, " + getTestSrid() "select t.id, t.geom.ST_IntersectsRect(ST_GeomFromText(?, " + getTestSrid() + "), ST_GeomFromText(?, " + getTestSrid()
+ ")) from GeomTest t where t.geom.ST_IntersectsRect(ST_GeomFromText(?, " + ")) from GeomTest t where t.geom.ST_IntersectsRect(ST_GeomFromText(?, "
+ getTestSrid() + "), ST_GeomFromText(?, " + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(), + getTestSrid() + "), ST_GeomFromText(?, " + getTestSrid() + ")) = 1 and t.geom.ST_SRID() = " + getTestSrid(),
new Object[]{ pmin.toText(), pmax.toText(), pmin.toText(), pmax.toText() } ); new Object[] { pmin.toText(), pmax.toText(), pmin.toText(), pmax.toText() }
);
} }
/** /**
* Returns the testsuite-suite geometries that are 3D geometries. * Returns the testsuite-suite geometries that are 3D geometries.
* *
* @return map of identifier, whether the geometry is 3D * @return map of identifier, whether the geometry is 3D
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIs3D() throws SQLException { public Map<Integer, Boolean> getIs3D() throws SQLException {
@ -656,6 +712,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are closed. * Returns the testsuite-suite geometries that are closed.
* *
* @return map of identifier, whether the geometry is closed * @return map of identifier, whether the geometry is closed
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIsClosed() throws SQLException { public Map<Integer, Boolean> getIsClosed() throws SQLException {
@ -672,6 +729,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are measured. * Returns the testsuite-suite geometries that are measured.
* *
* @return map of identifier, whether the geometry is measured * @return map of identifier, whether the geometry is measured
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIsMeasured() throws SQLException { public Map<Integer, Boolean> getIsMeasured() throws SQLException {
@ -688,6 +746,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are rings. * Returns the testsuite-suite geometries that are rings.
* *
* @return map of identifier, whether the geometry is a ring * @return map of identifier, whether the geometry is a ring
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIsRing() throws SQLException { public Map<Integer, Boolean> getIsRing() throws SQLException {
@ -704,6 +763,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are valid. * Returns the testsuite-suite geometries that are valid.
* *
* @return map of identifier, whether the geometry is valid * @return map of identifier, whether the geometry is valid
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getIsValid() throws SQLException { public Map<Integer, Boolean> getIsValid() throws SQLException {
@ -720,6 +780,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the length of all testsuite-suite geometries. * Returns the length of all testsuite-suite geometries.
* *
* @return map of identifier, length * @return map of identifier, length
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getLength() throws SQLException { public Map<Integer, Double> getLength() throws SQLException {
@ -736,6 +797,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the measure value of all testsuite-suite geometries. * Returns the measure value of all testsuite-suite geometries.
* *
* @return map of identifier, measure value * @return map of identifier, measure value
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getM() throws SQLException { public Map<Integer, Double> getM() throws SQLException {
@ -752,6 +814,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the maximum measure value of all testsuite-suite geometries. * Returns the maximum measure value of all testsuite-suite geometries.
* *
* @return map of identifier, maximum measure value * @return map of identifier, maximum measure value
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getMMax() throws SQLException { public Map<Integer, Double> getMMax() throws SQLException {
@ -768,6 +831,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the minimum measure value of all testsuite-suite geometries. * Returns the minimum measure value of all testsuite-suite geometries.
* *
* @return map of identifier, minimum measure value * @return map of identifier, minimum measure value
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getMMin() throws SQLException { public Map<Integer, Double> getMMin() throws SQLException {
@ -784,6 +848,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the number of geometries of all testsuite-suite geometries. * Returns the number of geometries of all testsuite-suite geometries.
* *
* @return map of identifier, number of geometries * @return map of identifier, number of geometries
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Integer> getNumGeometries() throws SQLException { public Map<Integer, Integer> getNumGeometries() throws SQLException {
@ -800,6 +865,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the number of interior rings of all testsuite-suite geometries. * Returns the number of interior rings of all testsuite-suite geometries.
* *
* @return map of identifier, number of interior rings * @return map of identifier, number of interior rings
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Integer> getNumInteriorRing() throws SQLException { public Map<Integer, Integer> getNumInteriorRing() throws SQLException {
@ -816,6 +882,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the number of interior rings of all testsuite-suite geometries. * Returns the number of interior rings of all testsuite-suite geometries.
* *
* @return map of identifier, number of interior rings * @return map of identifier, number of interior rings
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Integer> getNumInteriorRings() throws SQLException { public Map<Integer, Integer> getNumInteriorRings() throws SQLException {
@ -832,6 +899,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the number of points of all testsuite-suite geometries. * Returns the number of points of all testsuite-suite geometries.
* *
* @return map of identifier, number of points * @return map of identifier, number of points
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Integer> getNumPoints() throws SQLException { public Map<Integer, Integer> getNumPoints() throws SQLException {
@ -848,6 +916,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the testsuite-suite geometries that are equal. * Returns the testsuite-suite geometries that are equal.
* *
* @return map of identifier, whether the geometry is equal * @return map of identifier, whether the geometry is equal
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Boolean> getOrderingEquals(Geometry geom) throws SQLException { public Map<Integer, Boolean> getOrderingEquals(Geometry geom) throws SQLException {
@ -858,13 +927,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom.ST_OrderingEquals(ST_GeomFromText(?)) from GeomTest t where t.geom.ST_OrderingEquals(ST_GeomFromText(?)) = 1 and t.geom.ST_SRID() = " "select t.id, t.geom.ST_OrderingEquals(ST_GeomFromText(?)) from GeomTest t where t.geom.ST_OrderingEquals(ST_GeomFromText(?)) = 1 and t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
geom.toText() ); geom.toText()
);
} }
/** /**
* Returns the perimeter of all testsuite-suite geometries. * Returns the perimeter of all testsuite-suite geometries.
* *
* @return map of identifier, perimeter * @return map of identifier, perimeter
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getPerimeter() throws SQLException { public Map<Integer, Double> getPerimeter() throws SQLException {
@ -881,6 +952,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns a point on the surface of all testsuite-suite geometries. * Returns a point on the surface of all testsuite-suite geometries.
* *
* @return map of identifier, point on surface * @return map of identifier, point on surface
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getPointOnSurface() throws SQLException { public Map<Integer, Geometry> getPointOnSurface() throws SQLException {
@ -897,6 +969,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the nth point of all testsuite-suite geometries. * Returns the nth point of all testsuite-suite geometries.
* *
* @return map of identifier, point * @return map of identifier, point
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getPointN(int n) throws SQLException { public Map<Integer, Geometry> getPointN(int n) throws SQLException {
@ -907,13 +980,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatement( return createNativeSQLStatement(
"select t.id, t.geom.ST_PointN(?) from GeomTest t where t.geom.ST_GeometryType() in ('ST_LineString') and t.geom.ST_SRID() = " "select t.id, t.geom.ST_PointN(?) from GeomTest t where t.geom.ST_GeometryType() in ('ST_LineString') and t.geom.ST_SRID() = "
+ getTestSrid(), + getTestSrid(),
new Object[]{ n } ); new Object[] { n }
);
} }
/** /**
* Returns a copy of all testsuite-suite geometries with all points snapped to the grid. * Returns a copy of all testsuite-suite geometries with all points snapped to the grid.
* *
* @return map of identifier, geometry * @return map of identifier, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getSnapToGrid() throws SQLException { public Map<Integer, Geometry> getSnapToGrid() throws SQLException {
@ -930,6 +1005,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the expected startpoint of all testsuite-suite geometries. * Returns the expected startpoint of all testsuite-suite geometries.
* *
* @return map of id, startpoint * @return map of id, startpoint
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getStartPoint() throws SQLException { public Map<Integer, Geometry> getStartPoint() throws SQLException {
@ -937,13 +1013,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
} }
private NativeSQLStatement createNativeStartPointStatement() { private NativeSQLStatement createNativeStartPointStatement() {
return createNativeSQLStatement( "select id, t.geom.ST_StartPoint() from GeomTest t where t.geom.ST_GeometryType() = 'ST_LineString'" ); return createNativeSQLStatement(
"select id, t.geom.ST_StartPoint() from GeomTest t where t.geom.ST_GeometryType() = 'ST_LineString'" );
} }
/** /**
* Returns the expected aggregated union of all testsuite-suite geometries. * Returns the expected aggregated union of all testsuite-suite geometries.
* *
* @return map of count, union * @return map of count, union
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getUnionAggr() throws SQLException { public Map<Integer, Geometry> getUnionAggr() throws SQLException {
@ -958,6 +1036,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the x coordinate of all testsuite-suite geometries. * Returns the x coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, x coordinate * @return map of identifier, x coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getX() throws SQLException { public Map<Integer, Double> getX() throws SQLException {
@ -974,6 +1053,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the maximum x coordinate of all testsuite-suite geometries. * Returns the maximum x coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, maximum x coordinate * @return map of identifier, maximum x coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getXMax() throws SQLException { public Map<Integer, Double> getXMax() throws SQLException {
@ -990,6 +1070,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the minimum x coordinate of all testsuite-suite geometries. * Returns the minimum x coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, minumum x coordinate * @return map of identifier, minumum x coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getXMin() throws SQLException { public Map<Integer, Double> getXMin() throws SQLException {
@ -1006,6 +1087,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the y coordinate of all testsuite-suite geometries. * Returns the y coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, y coordinate * @return map of identifier, y coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getY() throws SQLException { public Map<Integer, Double> getY() throws SQLException {
@ -1022,6 +1104,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the maximum y coordinate of all testsuite-suite geometries. * Returns the maximum y coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, maximum y coordinate * @return map of identifier, maximum y coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getYMax() throws SQLException { public Map<Integer, Double> getYMax() throws SQLException {
@ -1038,6 +1121,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the minimum y coordinate of all testsuite-suite geometries. * Returns the minimum y coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, minumum y coordinate * @return map of identifier, minumum y coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getYMin() throws SQLException { public Map<Integer, Double> getYMin() throws SQLException {
@ -1054,6 +1138,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the z coordinate of all testsuite-suite geometries. * Returns the z coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, z coordinate * @return map of identifier, z coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getZ() throws SQLException { public Map<Integer, Double> getZ() throws SQLException {
@ -1070,6 +1155,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the maximum z coordinate of all testsuite-suite geometries. * Returns the maximum z coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, maximum z coordinate * @return map of identifier, maximum z coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getZMax() throws SQLException { public Map<Integer, Double> getZMax() throws SQLException {
@ -1086,6 +1172,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the minimum z coordinate of all testsuite-suite geometries. * Returns the minimum z coordinate of all testsuite-suite geometries.
* *
* @return map of identifier, minumum z coordinate * @return map of identifier, minumum z coordinate
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Double> getZMin() throws SQLException { public Map<Integer, Double> getZMin() throws SQLException {
@ -1102,6 +1189,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
* Returns the result of a nested function call with a parameter inside the inner function * Returns the result of a nested function call with a parameter inside the inner function
* *
* @return map of identifier, geometry * @return map of identifier, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getNestedFunctionInner(Geometry geom) throws SQLException { public Map<Integer, Geometry> getNestedFunctionInner(Geometry geom) throws SQLException {
@ -1112,13 +1200,15 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom from GeomTest t where t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid() "select t.id, t.geom from GeomTest t where t.geom.ST_WithinDistance(ST_GeomFromText(?, " + getTestSrid()
+ ").ST_SRID(0), 1) = 1", + ").ST_SRID(0), 1) = 1",
geom.toText() ); geom.toText()
);
} }
/** /**
* Returns the result of a nested function call with a parameter inside the outer function * Returns the result of a nested function call with a parameter inside the outer function
* *
* @return map of identifier, geometry * @return map of identifier, geometry
*
* @throws SQLException * @throws SQLException
*/ */
public Map<Integer, Geometry> getNestedFunctionOuter(Geometry geom) throws SQLException { public Map<Integer, Geometry> getNestedFunctionOuter(Geometry geom) throws SQLException {
@ -1128,6 +1218,7 @@ public class HANAExpectationsFactory extends AbstractExpectationsFactory {
private NativeSQLStatement createNativeNestedFunctionOuterStatement(Geometry geom) { private NativeSQLStatement createNativeNestedFunctionOuterStatement(Geometry geom) {
return createNativeSQLStatementAllWKTParams( return createNativeSQLStatementAllWKTParams(
"select t.id, t.geom from GeomTest t where ST_GeomFromText(?, " + getTestSrid() + ").ST_WithinDistance(geom.ST_SRID(0), 1) = 1", "select t.id, t.geom from GeomTest t where ST_GeomFromText(?, " + getTestSrid() + ").ST_WithinDistance(geom.ST_SRID(0), 1) = 1",
geom.toText() ); geom.toText()
);
} }
} }

View File

@ -93,7 +93,6 @@ public class MySQL8ExpectationsFactory extends AbstractExpectationsFactory {
} }
@Override @Override
protected NativeSQLStatement createNativeRelateStatement(Geometry geom, String matrix) { protected NativeSQLStatement createNativeRelateStatement(Geometry geom, String matrix) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();

View File

@ -26,27 +26,27 @@ connect to sample;
-- Create SQL function to return EWKT format from a geometry -- Create SQL function to return EWKT format from a geometry
create or replace function db2gse.asewkt(geometry db2gse.st_geometry) create or replace function db2gse.asewkt(geometry db2gse.st_geometry)
returns clob(2G) returns clob(2G)
specific db2gse.asewkt1 specific db2gse.asewkt1
language sql language sql
deterministice deterministice
no external action no external action
reads sql data reads sql data
return 'srid=' || varchar(db2gse.st_srsid(geometry)) || ';' || db2gse.st_astext(geometry) return 'srid=' || varchar (db2gse.st_srsid(geometry)) || ';' || db2gse.st_astext(geometry)
; ;
-- Create SQL function to create a geometry from EWKT format -- Create SQL function to create a geometry from EWKT format
create or replace function db2gse.geomfromewkt(instring varchar(32000)) create or replace function db2gse.geomfromewkt(instring varchar(32000))
returns db2gse.st_geometry returns db2gse.st_geometry
specific db2gse.fromewkt1 specific db2gse.fromewkt1
language sql language sql
deterministic deterministic
no external action no external action
reads sql data reads sql data
return db2gse.st_geometry( return db2gse.st_geometry(
substr(instring,posstr(instring,';')+1, length(instring) - posstr(instring,';')), substr(instring,posstr(instring,';')+1, length (instring) - posstr(instring,';')),
integer(substr(instring,posstr(instring,'=')+1,posstr(instring,';')-(posstr(instring,'=')+1))) integer (substr(instring,posstr(instring,'=')+1,posstr(instring,';')-(posstr(instring,'=')+1)))
) )
; ;
-- Create a DB2 transform group to return and accept EWKT -- Create a DB2 transform group to return and accept EWKT

View File

@ -32,7 +32,8 @@
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
</Element> </Element>
@ -63,7 +64,8 @@
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON(((0 0, 50 0, 50 50, 0 50, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10)), ((105 100, 130 134, 120 140, 105 100))) <wkt>SRID=4326;MULTIPOLYGON(((0 0, 50 0, 50 50, 0 50, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10)), ((105 100, 130
134, 120 140, 105 100)))
</wkt> </wkt>
</Element> </Element>

View File

@ -27,7 +27,8 @@
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;MULTIPOLYGON(((0 0, 50 0, 50 50, 0 50, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10)), ((105 100, 130 134, 120 140, 105 100))) <wkt>SRID=4326;MULTIPOLYGON(((0 0, 50 0, 50 50, 0 50, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10)), ((105 100, 130
134, 120 140, 105 100)))
</wkt> </wkt>
</Element> </Element>

View File

@ -86,7 +86,8 @@
<Element> <Element>
<id>13</id> <id>13</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>MULTILINESTRING M((10.0 5.0 1.0, 20.0 15.0 2.0, 30.25 22.375 1.0, 10 30.0 1.0),(40.0 20.0 0.0, 42.0 18.0 1.0, <wkt>MULTILINESTRING M((10.0 5.0 1.0, 20.0 15.0 2.0, 30.25 22.375 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)) 43.0 16.0 2.0, 40 14.0 3.0))
</wkt> </wkt>
</Element> </Element>
@ -94,7 +95,8 @@
<Element> <Element>
<id>14</id> <id>14</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>MULTILINESTRING ZM((10.0 5.0 1.0 0.0, 20.0 15.0 2.0 0.0, 30.25 22.375 1.0 1.0, 10 30.0 1.0 2.0),(40.0 20.0 0.0 <wkt>MULTILINESTRING ZM((10.0 5.0 1.0 0.0, 20.0 15.0 2.0 0.0, 30.25 22.375 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)) 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))
</wkt> </wkt>
</Element> </Element>

View File

@ -4,26 +4,19 @@
# License: GNU Lesser General Public License (LGPL), version 2.1 or later. # License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. # See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
# #
# Default unit/integration test config. # Default unit/integration test config.
hibernate.show_sql=true
hibernate.show_sql true hibernate.max_fetch_depth=5
hibernate.dialect=@db.dialect@
hibernate.max_fetch_depth 5 hibernate.connection.driver_class=@jdbc.driver@
hibernate.connection.url=@jdbc.url@
hibernate.dialect @db.dialect@ hibernate.connection.username=@jdbc.user@
hibernate.connection.driver_class @jdbc.driver@ hibernate.connection.password=@jdbc.pass@
hibernate.connection.url @jdbc.url@
hibernate.connection.username @jdbc.user@
hibernate.connection.password @jdbc.pass@
#hibernate.cache.region_prefix hibernate.test #hibernate.cache.region_prefix hibernate.test
#hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory #hibernate.cache.region.factory_class org.hibernate.testing.cache.CachingRegionFactory
# #
## NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle ## NOTE: hibernate.jdbc.batch_versioned_data should be set to false when testing with Oracle
#hibernate.jdbc.batch_versioned_data true #hibernate.jdbc.batch_versioned_data true
## Configs for spatial databases (used during testing on local dev environment). ## Configs for spatial databases (used during testing on local dev environment).
# #
#hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect #hibernate.dialect org.hibernate.spatial.dialect.postgis.PostgisPG95Dialect
@ -31,7 +24,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:postgresql://localhost:9432/ #hibernate.connection.url jdbc:postgresql://localhost:9432/
#hibernate.connection.username hibern8 #hibernate.connection.username hibern8
#hibernate.connection.password hibern8 #hibernate.connection.password hibern8
## ##
## GeoDb (H2 spatial extension) ## GeoDb (H2 spatial extension)
## ##
@ -40,8 +32,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:h2:mem:testhbs;DB_CLOSE_DELAY=-1;MVCC=true #hibernate.connection.url jdbc:h2:mem:testhbs;DB_CLOSE_DELAY=-1;MVCC=true
#hibernate.connection.username sa #hibernate.connection.username sa
#hibernate.connection.password sa #hibernate.connection.password sa
## ##
## Oracle 11g ## Oracle 11g
## ##
@ -51,15 +41,12 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:oracle:thin:@localhost:1521/orcl12c #hibernate.connection.url jdbc:oracle:thin:@localhost:1521/orcl12c
#hibernate.connection.username C##hibernate #hibernate.connection.username C##hibernate
#hibernate.connection.password hibernate #hibernate.connection.password hibernate
#hibernate.dialect org.hibernate.spatial.dialect.oracle.OracleSpatialSDO10gDialect #hibernate.dialect org.hibernate.spatial.dialect.oracle.OracleSpatialSDO10gDialect
#hibernate.connection.driver_class oracle.jdbc.OracleDriver #hibernate.connection.driver_class oracle.jdbc.OracleDriver
#hibernate.connection.url jdbc:oracle:thin:@localhost:1521/orcl12c #hibernate.connection.url jdbc:oracle:thin:@localhost:1521/orcl12c
#hibernate.connection.username C##hibernate #hibernate.connection.username C##hibernate
#hibernate.connection.password hibernate #hibernate.connection.password hibernate
# #
## ##
## MS SQL Server dialect ## MS SQL Server dialect
## ##
@ -68,9 +55,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:sqlserver://localhost:1433;databaseName=TestDb #hibernate.connection.url jdbc:sqlserver://localhost:1433;databaseName=TestDb
#hibernate.connection.username hibern8 #hibernate.connection.username hibern8
#hibernate.connection.password hibern8Pass #hibernate.connection.password hibern8Pass
## ##
## MySQL 5 dialects ## MySQL 5 dialects
## ##
@ -79,7 +63,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:mysql://hibernate-spatial-integration.cctaez8ywvn2.eu-west-1.rds.amazonaws.com/test #hibernate.connection.url jdbc:mysql://hibernate-spatial-integration.cctaez8ywvn2.eu-west-1.rds.amazonaws.com/test
#hibernate.connection.username hbs #hibernate.connection.username hbs
#hibernate.connection.password #hibernate.connection.password
## ##
## MySQL 5 InnoDDB dialect ## MySQL 5 InnoDDB dialect
## ##
@ -88,7 +71,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:mysql://localhost/testhbs #hibernate.connection.url jdbc:mysql://localhost/testhbs
#hibernate.connection.username hibernate #hibernate.connection.username hibernate
#hibernate.connection.password hibernate #hibernate.connection.password hibernate
## ##
## MySQL 5.6.1 dialect ## MySQL 5.6.1 dialect
## ##
@ -97,7 +79,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:mysql://hibernate-spatial-integration.cctaez8ywvn2.eu-west-1.rds.amazonaws.com:3306/test #hibernate.connection.url jdbc:mysql://hibernate-spatial-integration.cctaez8ywvn2.eu-west-1.rds.amazonaws.com:3306/test
#hibernate.connection.username hbs #hibernate.connection.username hbs
#hibernate.connection.password #hibernate.connection.password
## ##
## HANA dialect ## HANA dialect
## ##
@ -106,7 +87,6 @@ hibernate.connection.password @jdbc.pass@
#hibernate.connection.url jdbc:sap://localhost:30015 #hibernate.connection.url jdbc:sap://localhost:30015
#hibernate.connection.username HIBERNATE_TEST #hibernate.connection.username HIBERNATE_TEST
#hibernate.connection.password H1bernate_test #hibernate.connection.password H1bernate_test
## ##
## DB2 dialect ## DB2 dialect
## ##

View File

@ -8,9 +8,6 @@ log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=info, stdout log4j.rootLogger=info, stdout
log4j.logger.org.hibernate.SQL=DEBUG log4j.logger.org.hibernate.SQL=DEBUG
log4j.logger.org.hibernate.spatial=debug log4j.logger.org.hibernate.spatial=debug

View File

@ -57,7 +57,8 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
</Element> </Element>
@ -86,7 +87,8 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;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 <wkt>SRID=4326;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)) ) 134, 105 100)) )
</wkt> </wkt>
</Element> </Element>
@ -116,14 +118,16 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>32</id> <id>32</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;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, <wkt>SRID=4326;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))) 1 1)))
</wkt> </wkt>
</Element> </Element>
<Element> <Element>
<id>33</id> <id>33</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, <wkt>SRID=4326;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))) 120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)))
</wkt> </wkt>
</Element> </Element>

View File

@ -57,7 +57,8 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=31370;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)) <wkt>SRID=31370;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))
</wkt> </wkt>
</Element> </Element>
@ -86,7 +87,8 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=31370;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((15 10, 12 14, 13 <wkt>SRID=31370;MULTIPOLYGON(( (0 0, 0 50, 50 50, 50 0, 0 0), (10 10, 10 20, 20 20, 20 10, 10 10) ),((15 10, 12
14, 13
14, 15 10)) ) 14, 15 10)) )
</wkt> </wkt>
</Element> </Element>
@ -116,14 +118,16 @@ In MySQL these are stored as null objects.
<Element> <Element>
<id>32</id> <id>32</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=31370;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, <wkt>SRID=31370;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))) 1 1)))
</wkt> </wkt>
</Element> </Element>
<Element> <Element>
<id>33</id> <id>33</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=31370;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((15 10, <wkt>SRID=31370;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)),
((15 10,
12 14, 13 14, 15 10)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0))) 12 14, 13 14, 15 10)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)))
</wkt> </wkt>
</Element> </Element>

View File

@ -4,6 +4,5 @@
# License: GNU Lesser General Public License (LGPL), version 2.1 or later. # License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. # See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
# #
OGC_STRICT=true OGC_STRICT=true
CONNECTION-FINDER=org.hibernate.spatial.dialect.oracle.DefaultConnectionFinder CONNECTION-FINDER=org.hibernate.spatial.dialect.oracle.DefaultConnectionFinder

View File

@ -57,7 +57,8 @@
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
<sdo>SDO_GEOMETRY(2006, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,9,2,1), <sdo>SDO_GEOMETRY(2006, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,9,2,1),
SDO_ORDINATE_ARRAY(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)) SDO_ORDINATE_ARRAY(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))

View File

@ -100,7 +100,8 @@
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
<sdo>SDO_GEOMETRY(2006, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,9,2,1), <sdo>SDO_GEOMETRY(2006, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,9,2,1),
SDO_ORDINATE_ARRAY(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)) SDO_ORDINATE_ARRAY(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))
@ -121,7 +122,8 @@
<Element> <Element>
<id>14</id> <id>14</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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 <wkt>SRID=4326;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)) 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))
</wkt> </wkt>
<sdo>SDO_GEOMETRY(4406, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,17,2,1), <sdo>SDO_GEOMETRY(4406, 4326, NULL, SDO_ELEM_INFO_ARRAY(1,2,1,17,2,1),
@ -185,7 +187,8 @@
<Element> <Element>
<id>21</id> <id>21</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;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)) ) <wkt>SRID=4326;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)) )
</wkt> </wkt>
<sdo>SDO_GEOMETRY(3007, 4326, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 13, 1003, 1), <sdo>SDO_GEOMETRY(3007, 4326, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 13, 1003, 1),
SDO_ORDINATE_ARRAY(10,20,1,30,40,2,44,50,2,10,20,1,105,100,0,120,140,10,130,134,20,105,100,0)) SDO_ORDINATE_ARRAY(10,20,1,30,40,2,44,50,2,10,20,1,105,100,0,120,140,10,130,134,20,105,100,0))
@ -194,7 +197,8 @@
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;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 <wkt>SRID=4326;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))) 134, 105 100)))
</wkt> </wkt>
<sdo>SDO_GEOMETRY(2007, 4326, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 11, 2003, 1, 21, 1003, 1), <sdo>SDO_GEOMETRY(2007, 4326, NULL, SDO_ELEM_INFO_ARRAY(1, 1003, 1, 11, 2003, 1, 21, 1003, 1),

View File

@ -53,7 +53,8 @@
<Element> <Element>
<id>9</id> <id>9</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
</Element> </Element>

View File

@ -1,9 +1,8 @@
CREATE TABLE "HBS"."dbo"."geomtest" CREATE TABLE "HBS"."dbo"."geomtest"
( (
id int PRIMARY KEY NOT NULL, id int PRIMARY KEY NOT NULL,
type varchar(50), type varchar(50),
geom geometry geom geometry
) )

View File

@ -4,14 +4,12 @@
# License: GNU Lesser General Public License (LGPL), version 2.1 or later. # License: GNU Lesser General Public License (LGPL), version 2.1 or later.
# See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. # See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
# #
# #
# $Id: hibernate-spatial-sqlserver-test.properties 182 2010-03-20 17:30:12Z maesenka $ # $Id: hibernate-spatial-sqlserver-test.properties 182 2010-03-20 17:30:12Z maesenka $
# #
jdbcUrl=jdbc:sqlserver://sqlserver.geovise.com:1433;databaseName=HBS
jdbcUrl = jdbc:sqlserver://sqlserver.geovise.com:1433;databaseName=HBS jdbcDriver=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbcDriver = com.microsoft.sqlserver.jdbc.SQLServerDriver jdbcUser=hbs
jdbcUser = hbs jdbcPass=hbs
jdbcPass = hbs dataset=test-data-set.xml
dataset = test-data-set.xml

View File

@ -72,14 +72,16 @@
<Element> <Element>
<id>12</id> <id>12</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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)) <wkt>SRID=4326;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))
</wkt> </wkt>
</Element> </Element>
<Element> <Element>
<id>13</id> <id>13</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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, <wkt>SRID=4326;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)) 43.0 16.0 2.0, 40 14.0 3.0))
</wkt> </wkt>
</Element> </Element>
@ -87,7 +89,8 @@
<Element> <Element>
<id>14</id> <id>14</id>
<type>MULTILINESTRING</type> <type>MULTILINESTRING</type>
<wkt>SRID=4326;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 <wkt>SRID=4326;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)) 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))
</wkt> </wkt>
</Element> </Element>
@ -127,13 +130,15 @@
<Element> <Element>
<id>21</id> <id>21</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;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)) ) <wkt>SRID=4326;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)) )
</wkt> </wkt>
</Element> </Element>
<Element> <Element>
<id>22</id> <id>22</id>
<type>MULTIPOLYGON</type> <type>MULTIPOLYGON</type>
<wkt>SRID=4326;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 <wkt>SRID=4326;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)) ) 134, 105 100)) )
</wkt> </wkt>
</Element> </Element>
@ -173,14 +178,16 @@
<Element> <Element>
<id>32</id> <id>32</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;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, <wkt>SRID=4326;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))) 1 1)))
</wkt> </wkt>
</Element> </Element>
<Element> <Element>
<id>33</id> <id>33</id>
<type>GEOMETRYCOLLECTION</type> <type>GEOMETRYCOLLECTION</type>
<wkt>SRID=4326;GEOMETRYCOLLECTION( MULTIPOINT(21 2, 25 5, 30 3), MULTIPOLYGON( ((10 20, 30 40, 44 50, 10 20)), ((105 100, <wkt>SRID=4326;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))) 120 140, 130 134, 105 100)) ), MULTILINESTRING((10.0 5.0, 20.0 15.0),( 25.0 30.0, 30.0 20.0)))
</wkt> </wkt>
</Element> </Element>