Class HSQLDictionary

    • Field Detail

      • cacheTables

        public boolean cacheTables
        Sets whether HSQL should use "CREATED CACHED TABLE" rather than "CREATE TABLE", which allows disk-based database operations.
    • Constructor Detail

      • HSQLDictionary

        public HSQLDictionary()
    • Method Detail

      • connectedConfiguration

        public void connectedConfiguration​(java.sql.Connection conn)
                                    throws java.sql.SQLException
        Determine HSQLDB version and configure itself accordingly.
        Overrides:
        connectedConfiguration in class DBDictionary
        Throws:
        java.sql.SQLException
      • determineHSQLDBVersion

        protected void determineHSQLDBVersion​(java.sql.Connection con)
                                       throws java.sql.SQLException
        Determine HSQLDB version either by using JDBC 3 method or, if it is not available, by parsing the value returned by DatabaseMetaData.getDatabaseProductVersion().
        Throws:
        java.sql.SQLException
      • getPreferredType

        public int getPreferredType​(int type)
        Description copied from class: DBDictionary
        Return the preferred Types type for the given one. Returns the given type by default.
        Overrides:
        getPreferredType in class DBDictionary
      • getAddPrimaryKeySQL

        public java.lang.String[] getAddPrimaryKeySQL​(PrimaryKey pk)
        Description copied from class: DBDictionary
        Return a series of SQL statements to add the given primary key to its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> ADD <pk cons sql > by default.
        Overrides:
        getAddPrimaryKeySQL in class DBDictionary
      • getDropPrimaryKeySQL

        public java.lang.String[] getDropPrimaryKeySQL​(PrimaryKey pk)
        Description copied from class: DBDictionary
        Return a series of SQL statements to drop the given primary key from its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> DROP CONSTRAINT <pk name> by default.
        Overrides:
        getDropPrimaryKeySQL in class DBDictionary
      • getAddColumnSQL

        public java.lang.String[] getAddColumnSQL​(Column column)
        Description copied from class: DBDictionary
        Return a series of SQL statements to add the given column to its table. Return an empty array if operation not supported. Returns ALTER TABLE <table name> ADD (<col dec>) by default.
        Overrides:
        getAddColumnSQL in class DBDictionary
      • getCreateTableSQL

        public java.lang.String[] getCreateTableSQL​(Table table)
        Description copied from class: DBDictionary
        Return a series of SQL statements to create the given table, complete with columns. Indexes and constraints will be created separately.
        Overrides:
        getCreateTableSQL in class DBDictionary
      • isSystemIndex

        public boolean isSystemIndex​(java.lang.String name,
                                     Table table)
        Description copied from class: DBDictionary
        This method is used to filter system indexes from database metadata. Return true if the given index name represents a system index that should not appear in the schema definition. Returns false by default.
        Overrides:
        isSystemIndex in class DBDictionary
        Parameters:
        name - the index name
        table - the index table
      • isSystemIndex

        public boolean isSystemIndex​(DBIdentifier name,
                                     Table table)
        Description copied from class: DBDictionary
        This method is used to filter system indexes from database metadata. Return true if the given index name represents a system index that should not appear in the schema definition. Returns false by default.
        Overrides:
        isSystemIndex in class DBDictionary
        Parameters:
        name - the index name
        table - the index table
      • getSequencesSQL

        protected java.lang.String getSequencesSQL​(java.lang.String schemaName,
                                                   java.lang.String sequenceName)
        Description copied from class: DBDictionary
        Return the SQL needed to select the list of sequences.
        Overrides:
        getSequencesSQL in class DBDictionary
      • getColumns

        public Column[] getColumns​(java.sql.DatabaseMetaData meta,
                                   java.lang.String catalog,
                                   java.lang.String schemaName,
                                   java.lang.String tableName,
                                   java.lang.String columnName,
                                   java.sql.Connection conn)
                            throws java.sql.SQLException
        Description copied from class: DBDictionary
        Reflect on the schema to find columns matching the given table and column patterns.
        Overrides:
        getColumns in class DBDictionary
        Throws:
        java.sql.SQLException
      • setDouble

        public void setDouble​(java.sql.PreparedStatement stmnt,
                              int idx,
                              double val,
                              Column col)
                       throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given value as a parameter to the statement.
        Overrides:
        setDouble in class DBDictionary
        Throws:
        java.sql.SQLException
      • setBigDecimal

        public void setBigDecimal​(java.sql.PreparedStatement stmnt,
                                  int idx,
                                  java.math.BigDecimal val,
                                  Column col)
                           throws java.sql.SQLException
        Description copied from class: DBDictionary
        Set the given value as a parameter to the statement.
        Overrides:
        setBigDecimal in class DBDictionary
        Throws:
        java.sql.SQLException
      • appendSelectRange

        protected void appendSelectRange​(SQLBuffer buf,
                                         long start,
                                         long end,
                                         boolean subselect)
        Description copied from class: DBDictionary
        If this dictionary can select ranges, use this method to append the range SQL.
        Overrides:
        appendSelectRange in class DBDictionary
      • indexOf

        public void indexOf​(SQLBuffer buf,
                            FilterValue str,
                            FilterValue find,
                            FilterValue start)
        Description copied from class: DBDictionary
        Invoke this database's indexOf function.
        Overrides:
        indexOf in class DBDictionary
        Parameters:
        buf - the SQL buffer to write the indexOf invocation to
        str - a query value representing the target string
        find - a query value representing the search string
        start - a query value representing the start index, or null to start at the beginning
      • newStoreException

        public OpenJPAException newStoreException​(java.lang.String msg,
                                                  java.sql.SQLException[] causes,
                                                  java.lang.Object failed)
        Description copied from class: DBDictionary
        Return a new exception that wraps causes. However, the details of exactly what type of exception is returned can be determined by the implementation. This may take into account DB-specific exception information in causes.
        Overrides:
        newStoreException in class DBDictionary