1 package liquibase.ext.spatial.sqlgenerator;
2
3 import liquibase.database.Database;
4 import liquibase.database.core.OracleDatabase;
5 import liquibase.statement.core.InsertStatement;
6
7
8
9
10
11 public class SpatialInsertGeneratorOracle extends AbstractSpatialInsertGenerator {
12
13
14
15 @Override
16 public boolean supports(final InsertStatement statement, final Database database) {
17 return database instanceof OracleDatabase;
18 }
19
20
21
22
23
24
25
26 @Override
27 public String getGeomFromWktFunction() {
28 return "SDO_GEOMETRY";
29 }
30
31
32
33
34 @Override
35 public String convertToFunction(final String wkt, final String srid, final Database database) {
36 final String oracleWkt = OracleSpatialUtils.getOracleWkt(wkt);
37 final String oracleSrid = OracleSpatialUtils.getOracleSrid(srid, database);
38 return super.convertToFunction(oracleWkt, oracleSrid, database);
39 }
40 }