View Javadoc

1   package liquibase.ext.spatial.sqlgenerator;
2   
3   import liquibase.database.Database;
4   import liquibase.database.core.MySQLDatabase;
5   import liquibase.statement.core.InsertStatement;
6   
7   /**
8    * The <code>SpatialInsertGeneratorH2</code> generates the SQL for <code>INSERT</code>ing geometries
9    * into MySQL.
10   */
11  public class SpatialInsertGeneratorMySQL extends AbstractSpatialInsertGenerator {
12     @Override
13     public boolean supports(final InsertStatement statement, final Database database) {
14        return database instanceof MySQLDatabase;
15     }
16  
17     /**
18      * Returns the name of the function that converts Well-Known Text to a database-specific
19      * geometry.
20      * 
21      * @return the name of the function that converts WKT to a geometry.
22      */
23     @Override
24     public String getGeomFromWktFunction() {
25        return "GeomFromText";
26     }
27  }