Class FileEngine<Driver extends org.h2gis.api.FileDriver>

  • Type Parameters:
    Driver - file driver
    All Implemented Interfaces:
    org.h2.api.TableEngine
    Direct Known Subclasses:
    DBFEngine, FGBEngine, SHPEngine

    public abstract class FileEngine<Driver extends org.h2gis.api.FileDriver>
    extends Object
    implements org.h2.api.TableEngine
    Implement theses abstract methods in order to define a file engine.
    Author:
    Nicolas Fortin
    • Constructor Detail

      • FileEngine

        public FileEngine()
    • Method Detail

      • createTable

        public org.h2.table.TableBase createTable​(org.h2.command.ddl.CreateTableData data)
        Specified by:
        createTable in interface org.h2.api.TableEngine
      • getUniqueColumnName

        public static String getUniqueColumnName​(String base,
                                                 List<org.h2.table.Column> columns)
        Compute unique column name among the other columns
        Parameters:
        base - Returned name if there is no duplicate
        columns - Other existing columns
        Returns:
        Unique column name
      • createDriver

        protected abstract Driver createDriver​(File filePath,
                                               List<String> args)
                                        throws IOException
        Create the driver instance using the file name and additional arguments provided in SQL create table request.
        Parameters:
        filePath - First argument, file name
        args - Additional argument, contains the file name as first argument
        Returns:
        Instance of FileDriver
        Throws:
        IOException
      • feedCreateTableData

        protected abstract void feedCreateTableData​(Driver driver,
                                                    org.h2.command.ddl.CreateTableData data)
                                             throws IOException
        Add columns definition of the file into the CreateTableData instance.
        Parameters:
        driver - driver object
        data - Data to initialise
        Throws:
        IOException