HHH-14453 Fix Hana integration test

This commit is contained in:
Karel Maesen 2021-02-11 21:33:55 +01:00
parent 8a01b4dab4
commit 27fbacf7d2
1 changed files with 107 additions and 107 deletions

View File

@ -65,8 +65,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getAlphaShape( 1 ); Map<Integer, Geometry> dbexpected = hanaExpectationsFactory.getAlphaShape( 1 );
String hql = format( String hql = format(
Locale.ENGLISH, 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 %s where geometrytype(geom) in ('ST_Point', 'ST_MultiPoint')",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -84,8 +84,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void area(String pckg) throws SQLException { public void area(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon')",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -102,7 +102,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void asewkb(String pckg) throws SQLException { public void asewkb(String pckg) throws SQLException {
Map<Integer, byte[]> dbexpected = hanaExpectationsFactory.getAsEWKB(); Map<Integer, byte[]> dbexpected = hanaExpectationsFactory.getAsEWKB();
String hql = format( "SELECT id, asewkb(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, asewkb(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -118,7 +118,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void asewkt(String pckg) throws SQLException { public void asewkt(String pckg) throws SQLException {
Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsEWKT(); Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsEWKT();
String hql = format( "SELECT id, asewkt(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, asewkt(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -134,7 +134,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void asgeojson(String pckg) throws SQLException { public void asgeojson(String pckg) throws SQLException {
Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsGeoJSON(); Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsGeoJSON();
String hql = format( "SELECT id, asgeojson(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, asgeojson(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -150,7 +150,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void assvg(String pckg) throws SQLException { public void assvg(String pckg) throws SQLException {
Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsSVG(); Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsSVG();
String hql = format( "SELECT id, assvg(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, assvg(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -167,8 +167,8 @@ 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( String hql = format(
"SELECT cast(count(g) as int), assvgaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT cast(count(g) as int), assvgaggr(geom) FROM %s g",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -185,7 +185,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void aswkb(String pckg) throws SQLException { public void aswkb(String pckg) throws SQLException {
Map<Integer, byte[]> dbexpected = hanaExpectationsFactory.getAsWKB(); Map<Integer, byte[]> dbexpected = hanaExpectationsFactory.getAsWKB();
String hql = format( "SELECT id, aswkb(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, aswkb(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -201,7 +201,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void aswkt(String pckg) throws SQLException { public void aswkt(String pckg) throws SQLException {
Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsWKT(); Map<Integer, String> dbexpected = hanaExpectationsFactory.getAsWKT();
String hql = format( "SELECT id, aswkt(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, aswkt(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -218,8 +218,8 @@ 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( String hql = format(
"SELECT cast(count(g) as int), convexhullaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT cast(count(g) as int), convexhullaggr(geom) FROM %s g",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -237,8 +237,8 @@ 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( String hql = format(
"SELECT id, centroid(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'", "SELECT id, centroid(geom) FROM %s g where geometrytype(geom) = 'ST_Polygon'",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -255,7 +255,7 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void coorddim(String pckg) throws SQLException { public void coorddim(String pckg) throws SQLException {
Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getCoordDim(); Map<Integer, Integer> dbexpected = hanaExpectationsFactory.getCoordDim();
String hql = format( "SELECT id, coorddim(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity", pckg ); String hql = format( "SELECT id, coorddim(geom) FROM %s", entityName( pckg ) );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -272,8 +272,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void coveredby(String pckg) throws SQLException { public void coveredby(String pckg) throws SQLException {
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 %s where coveredby(geom, :filter) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
@ -293,8 +293,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void covers(String pckg) throws SQLException { public void covers(String pckg) throws SQLException {
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 %s where covers(geom, :filter) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
@ -314,8 +314,8 @@ 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( String hql = format(
"SELECT id, endpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'", "SELECT id, endpoint(geom) FROM %s g where geometrytype(geom) = 'ST_LineString'",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -333,8 +333,8 @@ 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( String hql = format(
"SELECT cast(count(g) as int), envelopeaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT cast(count(g) as int), envelopeaggr(geom) FROM %s g",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -352,8 +352,8 @@ 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( String hql = format(
"SELECT id, exteriorring(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_Polygon'", "SELECT id, exteriorring(geom) FROM %s g where geometrytype(geom) = 'ST_Polygon'",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -373,9 +373,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
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( String hql = format(
"SELECT 1, cast(geomfromewkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT 1, cast(geomfromewkb(:param) as %s) FROM %s g",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -396,9 +396,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
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( String hql = format(
"SELECT 1, cast(geomfromewkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT 1, cast(geomfromewkt(:param) as %s) FROM %s g",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -418,9 +418,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
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( String hql = format(
"SELECT 1, cast(geomfromtext(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT 1, cast(geomfromtext(:param) as %s) FROM %s g",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -441,9 +441,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
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( String hql = format(
"SELECT 1, cast(geomfromwkb(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT 1, cast(geomfromwkb(:param) as %s) FROM %s g",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -464,9 +464,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
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( String hql = format(
"SELECT 1, cast(geomfromwkt(:param) as %s) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT 1, cast(geomfromwkt(:param) as %s) FROM %s g",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -485,9 +485,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void geometryn(String pckg) throws SQLException { public void geometryn(String pckg) throws SQLException {
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 %s g where geometrytype(geom) = 'ST_GeometryCollection'",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -506,9 +506,9 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void interiorringn(String pckg) throws SQLException { public void interiorringn(String pckg) throws SQLException {
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 %s g where geometrytype(geom) = 'ST_Polygon'",
getGeometryTypeFromPackage( pckg ), getGeometryTypeFromPackage( pckg ),
pckg entityName( 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 );
@ -527,8 +527,8 @@ 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( String hql = format(
"SELECT cast(count(g) as int), intersectionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT cast(count(g) as int), intersectionaggr(geom) FROM %s g",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -549,8 +549,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
expectationsFactory.getTestPoint() 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 %s where intersectsrect(geom, :pmin, :pmax) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "pmin", expectationsFactory.getTestPoint().reverse() ); Map<String, Object> params = createQueryParams( "pmin", expectationsFactory.getTestPoint().reverse() );
@ -571,8 +571,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void is3d(String pckg) throws SQLException { public void is3d(String pckg) throws SQLException {
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 %s where is3d(geom) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -591,8 +591,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void isclosed(String pckg) throws SQLException { public void isclosed(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and isclosed(geom) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -611,8 +611,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void ismeasured(String pckg) throws SQLException { public void ismeasured(String pckg) throws SQLException {
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 %s where ismeasured(geom) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -631,8 +631,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void isring(String pckg) throws SQLException { public void isring(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -651,8 +651,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void isvalid(String pckg) throws SQLException { public void isvalid(String pckg) throws SQLException {
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 %s where isvalid(geom) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -671,8 +671,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void length(String pckg) throws SQLException { public void length(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_LineString', 'ST_MultiLineString') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -691,8 +691,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void m(String pckg) throws SQLException { public void m(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -711,8 +711,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void mmax(String pckg) throws SQLException { public void mmax(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -730,8 +730,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void mmin(String pckg) throws SQLException { public void mmin(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -749,8 +749,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void numgeometries(String pckg) throws SQLException { public void numgeometries(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_GeometryCollection') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -769,8 +769,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void numinteriorring(String pckg) throws SQLException { public void numinteriorring(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -789,8 +789,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void numinteriorrings(String pckg) throws SQLException { public void numinteriorrings(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Polygon') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -809,8 +809,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void numpoints(String pckg) throws SQLException { public void numpoints(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -829,8 +829,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void orderingequals(String pckg) throws SQLException { public void orderingequals(String pckg) throws SQLException {
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 %s where orderingequals(geom, :filter) = true and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() ); Map<String, Object> params = createQueryParams( "filter", expectationsFactory.getTestPolygon() );
@ -850,8 +850,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void perimeter(String pckg) throws SQLException { public void perimeter(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -870,8 +870,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void pointonsurface(String pckg) throws SQLException { public void pointonsurface(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Polygon', 'ST_MultiPolygon') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -890,8 +890,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void pointn(String pckg) throws SQLException { public void pointn(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_LineString') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
Map<String, Object> params = createQueryParams( "n", 1 ); Map<String, Object> params = createQueryParams( "n", 1 );
@ -913,8 +913,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void snaptogrid(String pckg) throws SQLException { public void snaptogrid(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -932,8 +932,8 @@ 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( String hql = format(
"SELECT id, startpoint(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g where geometrytype(geom) = 'ST_LineString'", "SELECT id, startpoint(geom) FROM %s g where geometrytype(geom) = 'ST_LineString'",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -951,8 +951,8 @@ 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( String hql = format(
"SELECT cast(count(g) as int), unionaggr(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity g", "SELECT cast(count(g) as int), unionaggr(geom) FROM %s g",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -970,8 +970,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void x(String pckg) throws SQLException { public void x(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -990,8 +990,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void xmax(String pckg) throws SQLException { public void xmax(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1009,8 +1009,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void xmin(String pckg) throws SQLException { public void xmin(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1028,8 +1028,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void y(String pckg) throws SQLException { public void y(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -1048,8 +1048,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void ymax(String pckg) throws SQLException { public void ymax(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1067,8 +1067,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void ymin(String pckg) throws SQLException { public void ymin(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1086,8 +1086,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void z(String pckg) throws SQLException { public void z(String pckg) throws SQLException {
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 %s where geometrytype(geom) in ('ST_Point') and srid(geom) = %d",
pckg, entityName( pckg ),
expectationsFactory.getTestSrid() expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
@ -1106,8 +1106,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void zmax(String pckg) throws SQLException { public void zmax(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1125,8 +1125,8 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void zmin(String pckg) throws SQLException { public void zmin(String pckg) throws SQLException {
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 %s where srid(geom) = %d",
pckg, expectationsFactory.getTestSrid() entityName( pckg ), expectationsFactory.getTestSrid()
); );
retrieveHQLResultsAndCompare( dbexpected, hql, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, pckg );
} }
@ -1144,16 +1144,16 @@ public class TestHANASpatialFunctions extends TestSpatialFunctions {
public void nestedfunction(String pckg) throws SQLException { public void nestedfunction(String pckg) throws SQLException {
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 %s g where dwithin(geom, srid(:filter, 0), 1) = true",
pckg entityName( 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 %s g where dwithin(:filter, srid(geom, 0), 1) = true",
pckg entityName( pckg )
); );
retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg ); retrieveHQLResultsAndCompare( dbexpected, hql, params, pckg );
} }