View Javadoc

1   package liquibase.ext.spatial.statement;
2   
3   import liquibase.statement.AbstractSqlStatement;
4   
5   /**
6    * <code>CreateSpatialIndexStatement</code> represents a <code>CREATE SPATIAL INDEX</code>
7    * statement.
8    */
9   public class CreateSpatialIndexStatement extends AbstractSqlStatement {
10  
11     private final String tableCatalogName;
12     private final String tableSchemaName;
13     private final String indexName;
14     private final String tableName;
15     private final String[] columns;
16     private String tablespace;
17  
18     /** The WKT geometry type (e.g. Geometry, Point, etc). */
19     private String geometryType;
20  
21     /** The Spatial Reference ID (e.g. 4326). */
22     private Integer srid;
23  
24     /**
25      * @param indexName
26      * @param tableCatalogName
27      * @param tableSchemaName
28      * @param tableName
29      *           the table name.
30      * @param columns
31      *           the array of column names.
32      * @param tablespace
33      *           the optional table space name.
34      * @param geometryType
35      *           the optional geometry type.
36      * @param srid
37      *           the optional Spatial Reference ID.
38      */
39     public CreateSpatialIndexStatement(final String indexName, final String tableCatalogName,
40           final String tableSchemaName, final String tableName, final String[] columns,
41           final String tablespace, final String geometryType, final Integer srid) {
42        this.indexName = indexName;
43        this.tableCatalogName = tableCatalogName;
44        this.tableSchemaName = tableSchemaName;
45        this.tableName = tableName;
46        this.columns = columns.clone();
47        this.tablespace = tablespace;
48        this.geometryType = geometryType;
49        this.srid = srid;
50     }
51  
52     public String getTableCatalogName() {
53        return this.tableCatalogName;
54     }
55  
56     public String getTableSchemaName() {
57        return this.tableSchemaName;
58     }
59  
60     public String getIndexName() {
61        return this.indexName;
62     }
63  
64     public String getTableName() {
65        return this.tableName;
66     }
67  
68     public String[] getColumns() {
69        return this.columns;
70     }
71  
72     public String getTablespace() {
73        return this.tablespace;
74     }
75  
76     public CreateSpatialIndexStatement setTablespace(final String tablespace) {
77        this.tablespace = tablespace;
78        return this;
79     }
80  
81     /**
82      * Sets the WKT geometry type (e.g. Geometry, Point, etc).
83      * 
84      * @param geometryType
85      *           the geometry type.
86      */
87     public void setGeometryType(final String geometryType) {
88        this.geometryType = geometryType;
89     }
90  
91     /**
92      * Returns the WKT geometry type (e.g. Geometry, Point, etc).
93      * 
94      * @return the geometry type.
95      */
96     public String getGeometryType() {
97        return this.geometryType;
98     }
99  
100    /**
101     * Sets the Spatial Reference ID (e.g. 4326).
102     * 
103     * @param srid
104     *           the SRID.
105     */
106    public void setSrid(final Integer srid) {
107       this.srid = srid;
108    }
109 
110    /**
111     * Returns the Spatial Reference ID (e.g. 4326).
112     * 
113     * @return the SRID.
114     */
115    public Integer getSrid() {
116       return this.srid;
117    }
118 }