@@ -62,7 +62,7 @@ public void dimension(String pckg) throws SQLException {
62
62
return ;
63
63
}
64
64
Map <Integer , Integer > dbexpected = expectationsFactory .getDimension ();
65
- String hql = format ( "SELECT id, dimension(geom) FROM org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
65
+ String hql = format ( "SELECT id, dimension(geom) FROM %s " , entityName ( pckg ) );
66
66
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
67
67
}
68
68
@@ -81,7 +81,7 @@ public void astext(String pckg) throws SQLException {
81
81
return ;
82
82
}
83
83
Map <Integer , String > dbexpected = expectationsFactory .getAsText ();
84
- String hql = format ( "SELECT id, astext(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
84
+ String hql = format ( "SELECT id, astext(geom) from %s " , entityName ( pckg ) );
85
85
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
86
86
}
87
87
@@ -101,7 +101,7 @@ public void asbinary(String pckg) throws SQLException {
101
101
return ;
102
102
}
103
103
Map <Integer , byte []> dbexpected = expectationsFactory .getAsBinary ();
104
- String hql = format ( "SELECT id, asbinary(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
104
+ String hql = format ( "SELECT id, asbinary(geom) from %s " , entityName ( pckg ) );
105
105
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
106
106
}
107
107
@@ -121,10 +121,10 @@ public void geometrytype(String pckg) throws SQLException {
121
121
}
122
122
Map <Integer , String > dbexpected = expectationsFactory .getGeometryType ();
123
123
String hql = format (
124
- "SELECT id, geometrytype(geom) from org.hibernate.spatial.integration.%s.GeomEntity " ,
125
- pckg
124
+ "SELECT id, geometrytype(geom) from %s " ,
125
+ entityName ( pckg )
126
126
);
127
- retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
127
+ retrieveHQLResultsAndCompare ( dbexpected , hql , entityName ( pckg ) );
128
128
}
129
129
130
130
@ Test
@@ -142,7 +142,7 @@ public void srid(String pckg) throws SQLException {
142
142
return ;
143
143
}
144
144
Map <Integer , Integer > dbexpected = expectationsFactory .getSrid ();
145
- String hql = format ( "SELECT id, srid(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
145
+ String hql = format ( "SELECT id, srid(geom) from %s " , entityName ( pckg ) );
146
146
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
147
147
}
148
148
@@ -161,7 +161,7 @@ public void issimple(String pckg) throws SQLException {
161
161
return ;
162
162
}
163
163
Map <Integer , Boolean > dbexpected = expectationsFactory .getIsSimple ();
164
- String hql = format ( "SELECT id, issimple(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
164
+ String hql = format ( "SELECT id, issimple(geom) from %s " , entityName ( pckg ) );
165
165
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
166
166
}
167
167
@@ -180,7 +180,7 @@ public void isempty(String pckg) throws SQLException {
180
180
return ;
181
181
}
182
182
Map <Integer , Boolean > dbexpected = expectationsFactory .getIsEmpty ();
183
- String hql = format ( "SELECT id, isEmpty(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
183
+ String hql = format ( "SELECT id, isEmpty(geom) from %s " , entityName ( pckg ) );
184
184
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
185
185
}
186
186
@@ -199,7 +199,7 @@ public void boundary(String pckg) throws SQLException {
199
199
return ;
200
200
}
201
201
Map <Integer , Geometry > dbexpected = expectationsFactory .getBoundary ();
202
- String hql = format ( "SELECT id, boundary(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
202
+ String hql = format ( "SELECT id, boundary(geom) from %s " , entityName ( pckg ) );
203
203
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
204
204
}
205
205
@@ -218,7 +218,7 @@ public void envelope(String pckg) throws SQLException {
218
218
return ;
219
219
}
220
220
Map <Integer , Geometry > dbexpected = expectationsFactory .getEnvelope ();
221
- String hql = format ( "SELECT id, envelope(geom) from org.hibernate.spatial.integration.%s.GeomEntity " , pckg );
221
+ String hql = format ( "SELECT id, envelope(geom) from %s " , entityName ( pckg ) );
222
222
retrieveHQLResultsAndCompare ( dbexpected , hql , pckg );
223
223
}
224
224
@@ -238,9 +238,9 @@ public void within(String pckg) throws SQLException {
238
238
}
239
239
Map <Integer , Boolean > dbexpected = expectationsFactory .getWithin ( expectationsFactory .getTestPolygon () );
240
240
String hql = format (
241
- "SELECT id, within(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
241
+ "SELECT id, within(geom, :filter) from %s " +
242
242
"where within(geom, :filter) = true and srid(geom) = %d" ,
243
- pckg ,
243
+ entityName ( pckg ) ,
244
244
expectationsFactory .getTestSrid ()
245
245
);
246
246
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -263,9 +263,9 @@ public void equals(String pckg) throws SQLException {
263
263
}
264
264
Map <Integer , Boolean > dbexpected = expectationsFactory .getEquals ( expectationsFactory .getTestPolygon () );
265
265
String hql = format (
266
- "SELECT id, equals(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
266
+ "SELECT id, equals(geom, :filter) from %s " +
267
267
"where equals(geom, :filter) = true and srid(geom) = %d" ,
268
- pckg ,
268
+ entityName ( pckg ) ,
269
269
expectationsFactory .getTestSrid ()
270
270
);
271
271
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -288,9 +288,9 @@ public void crosses(String pckg) throws SQLException {
288
288
}
289
289
Map <Integer , Boolean > dbexpected = expectationsFactory .getCrosses ( expectationsFactory .getTestPolygon () );
290
290
String hql = format (
291
- "SELECT id, crosses(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
291
+ "SELECT id, crosses(geom, :filter) from %s " +
292
292
"where crosses(geom, :filter) = true and srid(geom) = %d" ,
293
- pckg ,
293
+ entityName ( pckg ) ,
294
294
expectationsFactory .getTestSrid ()
295
295
);
296
296
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -314,9 +314,9 @@ public void contains(String pckg) throws SQLException {
314
314
}
315
315
Map <Integer , Boolean > dbexpected = expectationsFactory .getContains ( expectationsFactory .getTestPolygon () );
316
316
String hql = format (
317
- "SELECT id, contains(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
317
+ "SELECT id, contains(geom, :filter) from %s " +
318
318
"where contains(geom, :filter) = true and srid(geom) = %d" ,
319
- pckg ,
319
+ entityName ( pckg ) ,
320
320
expectationsFactory .getTestSrid ()
321
321
);
322
322
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -339,9 +339,9 @@ public void disjoint(String pckg) throws SQLException {
339
339
}
340
340
Map <Integer , Boolean > dbexpected = expectationsFactory .getDisjoint ( expectationsFactory .getTestPolygon () );
341
341
String hql = format (
342
- "SELECT id, disjoint(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
342
+ "SELECT id, disjoint(geom, :filter) from %s " +
343
343
"where disjoint(geom, :filter) = true and srid(geom) = %d" ,
344
- pckg ,
344
+ entityName ( pckg ) ,
345
345
expectationsFactory .getTestSrid ()
346
346
);
347
347
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -364,9 +364,9 @@ public void intersects(String pckg) throws SQLException {
364
364
}
365
365
Map <Integer , Boolean > dbexpected = expectationsFactory .getIntersects ( expectationsFactory .getTestPolygon () );
366
366
String hql = format (
367
- "SELECT id, intersects(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
367
+ "SELECT id, intersects(geom, :filter) from %s " +
368
368
"where intersects(geom, :filter) = true and srid(geom) = %d" ,
369
- pckg ,
369
+ entityName ( pckg ) ,
370
370
expectationsFactory .getTestSrid ()
371
371
);
372
372
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -389,9 +389,8 @@ public void overlaps(String pckg) throws SQLException {
389
389
}
390
390
Map <Integer , Boolean > dbexpected = expectationsFactory .getOverlaps ( expectationsFactory .getTestPolygon () );
391
391
String hql = format (
392
- "SELECT id, overlaps(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
393
- "where overlaps(geom, :filter) = true and srid(geom) = %d" ,
394
- pckg ,
392
+ "SELECT id, overlaps(geom, :filter) from %s where overlaps(geom, :filter) = true and srid(geom) = %d" ,
393
+ entityName ( pckg ),
395
394
expectationsFactory .getTestSrid ()
396
395
);
397
396
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -413,9 +412,8 @@ public void touches(String pckg) throws SQLException {
413
412
return ;
414
413
}
415
414
String hql = format (
416
- "SELECT id, touches(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
417
- "where touches(geom, :filter) = true and srid(geom) = %d" ,
418
- pckg ,
415
+ "SELECT id, touches(geom, :filter) from %s where touches(geom, :filter) = true and srid(geom) = %d" ,
416
+ entityName ( pckg ),
419
417
expectationsFactory .getTestSrid ()
420
418
);
421
419
Map <Integer , Boolean > dbexpected = expectationsFactory .getTouches ( expectationsFactory .getTestPolygon () );
@@ -443,9 +441,9 @@ public void relate(String pckg) throws SQLException {
443
441
matrix
444
442
);
445
443
String hql = format (
446
- "SELECT id, relate(geom, :filter, :matrix) from org.hibernate.spatial.integration.%s.GeomEntity " +
444
+ "SELECT id, relate(geom, :filter, :matrix) from %s " +
447
445
"where relate(geom, :filter, :matrix) = true and srid(geom) = %d" ,
448
- pckg ,
446
+ entityName ( pckg ) ,
449
447
expectationsFactory .getTestSrid ()
450
448
);
451
449
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
@@ -475,8 +473,7 @@ public void distance(String pckg) throws SQLException {
475
473
}
476
474
Map <Integer , Double > dbexpected = expectationsFactory .getDistance ( expectationsFactory .getTestPolygon () );
477
475
String hql = format (
478
- "SELECT id, distance(geom, :filter) from org.hibernate.spatial.integration.%s.GeomEntity " +
479
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
476
+ "SELECT id, distance(geom, :filter) from %s where srid(geom) = %d" , entityName ( pckg ), expectationsFactory .getTestSrid ()
480
477
);
481
478
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPolygon () );
482
479
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -498,8 +495,8 @@ public void buffer(String pckg) throws SQLException {
498
495
}
499
496
Map <Integer , Geometry > dbexpected = expectationsFactory .getBuffer ( Double .valueOf ( 1.0 ) );
500
497
String hql = format (
501
- "SELECT id, buffer(geom, :distance) from org.hibernate.spatial.integration.%s.GeomEntity " +
502
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
498
+ "SELECT id, buffer(geom, :distance) from %s where srid(geom) = %d" ,
499
+ entityName ( pckg ) , expectationsFactory .getTestSrid ()
503
500
);
504
501
Map <String , Object > params = createQueryParams ( "distance" , Double .valueOf ( 1.0 ) );
505
502
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -528,8 +525,8 @@ public void convexhull(String pckg) throws SQLException {
528
525
}
529
526
Map <Integer , Geometry > dbexpected = expectationsFactory .getConvexHull ( expectationsFactory .getTestPolygon () );
530
527
String hql = format (
531
- "SELECT id, convexhull(geomunion(geom, :polygon)) from org.hibernate.spatial.integration" +
532
- ".%s.GeomEntity where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
528
+ "SELECT id, convexhull(geomunion(geom, :polygon)) from %s where srid(geom) = %d" ,
529
+ entityName ( pckg ) , expectationsFactory .getTestSrid ()
533
530
);
534
531
Map <String , Object > params = createQueryParams ( "polygon" , expectationsFactory .getTestPolygon () );
535
532
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -556,8 +553,8 @@ public void intersection(String pckg) throws SQLException {
556
553
}
557
554
Map <Integer , Geometry > dbexpected = expectationsFactory .getIntersection ( expectationsFactory .getTestPolygon () );
558
555
String hql = format (
559
- "SELECT id, intersection(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
560
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
556
+ "SELECT id, intersection(geom, :polygon) from %s where srid(geom) = %d" ,
557
+ entityName ( pckg ) , expectationsFactory .getTestSrid ()
561
558
);
562
559
Map <String , Object > params = createQueryParams ( "polygon" , expectationsFactory .getTestPolygon () );
563
560
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -579,8 +576,8 @@ public void difference(String pckg) throws SQLException {
579
576
}
580
577
Map <Integer , Geometry > dbexpected = expectationsFactory .getDifference ( expectationsFactory .getTestPolygon () );
581
578
String hql = format (
582
- "SELECT id, difference(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
583
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
579
+ "SELECT id, difference(geom, :polygon) from %s where srid(geom) = %d" ,
580
+ entityName ( pckg ) , expectationsFactory .getTestSrid ()
584
581
);
585
582
Map <String , Object > params = createQueryParams ( "polygon" , expectationsFactory .getTestPolygon () );
586
583
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -602,9 +599,8 @@ public void symdifference(String pckg) throws SQLException {
602
599
}
603
600
Map <Integer , Geometry > dbexpected = expectationsFactory .getSymDifference ( expectationsFactory .getTestPolygon () );
604
601
String hql = format (
605
- "SELECT id, symdifference(geom, :polygon) from " +
606
- "org.hibernate.spatial.integration.%s.GeomEntity where srid(geom) = %d" ,
607
- pckg ,
602
+ "SELECT id, symdifference(geom, :polygon) from %s where srid(geom) = %d" ,
603
+ entityName ( pckg ),
608
604
expectationsFactory .getTestSrid ()
609
605
);
610
606
Map <String , Object > params = createQueryParams ( "polygon" , expectationsFactory .getTestPolygon () );
@@ -627,8 +623,8 @@ public void geomunion(String pckg) throws SQLException {
627
623
}
628
624
Map <Integer , Geometry > dbexpected = expectationsFactory .getGeomUnion ( expectationsFactory .getTestPolygon () );
629
625
String hql = format (
630
- "SELECT id, geomunion(geom, :polygon) from org.hibernate.spatial.integration.%s.GeomEntity " +
631
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
626
+ "SELECT id, geomunion(geom, :polygon) from %s " +
627
+ "where srid(geom) = %d" , entityName ( pckg ) , expectationsFactory .getTestSrid ()
632
628
);
633
629
Map <String , Object > params = createQueryParams ( "polygon" , expectationsFactory .getTestPolygon () );
634
630
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -655,8 +651,8 @@ public void dwithin(String pckg) throws SQLException {
655
651
);
656
652
String hql = format (
657
653
"SELECT id, dwithin(geom, :filter, :distance) from " +
658
- "org.hibernate.spatial.integration.%s.GeomEntity where dwithin(geom, :filter, :distance) = true " +
659
- "and srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
654
+ "%s where dwithin(geom, :filter, :distance) = true " +
655
+ "and srid(geom) = %d" , entityName ( pckg ) , expectationsFactory .getTestSrid ()
660
656
);
661
657
Map <String , Object > params = createQueryParams ( "filter" , expectationsFactory .getTestPoint () );
662
658
if ( getDialect () instanceof OracleSpatial10gDialect ) {
@@ -693,8 +689,8 @@ public void transform(String pckg) throws SQLException {
693
689
int epsg = 4324 ;
694
690
Map <Integer , Geometry > dbexpected = expectationsFactory .getTransform ( epsg );
695
691
String hql = format (
696
- "SELECT id, transform(geom, :epsg) from org.hibernate.spatial.integration.%s.GeomEntity " +
697
- "where srid(geom) = %d" , pckg , expectationsFactory .getTestSrid ()
692
+ "SELECT id, transform(geom, :epsg) from %s " +
693
+ "where srid(geom) = %d" , entityName ( pckg ) , expectationsFactory .getTestSrid ()
698
694
);
699
695
Map <String , Object > params = createQueryParams ( "epsg" , Integer .valueOf ( epsg ) );
700
696
retrieveHQLResultsAndCompare ( dbexpected , hql , params , pckg );
@@ -717,7 +713,7 @@ public void extent(String pckg) throws SQLException {
717
713
}
718
714
// here we just check if we get a result, and can read it
719
715
String hql = format (
720
- "SELECT id, extent(geom) from org.hibernate.spatial.integration.%s.GeomEntity group by id" , pckg
716
+ "SELECT id, extent(geom) from %s group by id" , entityName ( pckg )
721
717
);
722
718
Map <Integer , Object > hsreceived = new HashMap <Integer , Object >();
723
719
doInSession ( hql , hsreceived , new HashMap <String , Object >() );
0 commit comments