Class DerbyAdapter

    • Constructor Detail

      • DerbyAdapter

        public DerbyAdapter​(IDatabaseTarget tgt)
        Public constructor
        Parameters:
        tgt - the target database we want to manage
      • DerbyAdapter

        public DerbyAdapter()
    • Method Detail

      • warnOnce

        public void warnOnce​(org.linuxforhealth.fhir.database.utils.derby.DerbyAdapter.MessageKey messageKey,
                             java.lang.String msg)
        Once write each warning message once
        Parameters:
        msg -
      • createRowType

        public void createRowType​(java.lang.String schemaName,
                                  java.lang.String typeName,
                                  java.util.List<ColumnBase> columns)
        Description copied from interface: IDatabaseAdapter
        Create ROW type used for passing values to stored procedures e.g.:
         CREATE OR REPLACE TYPE .t_str_values AS ROW (parameter_name_id INTEGER,
         str_value VARCHAR(511 OCTETS), str_value_lcase VARCHAR(511 OCTETS))
         
      • createArrType

        public void createArrType​(java.lang.String schemaName,
                                  java.lang.String typeName,
                                  java.lang.String valueType,
                                  int arraySize)
        Description copied from interface: IDatabaseAdapter
        Create ARRAY type used for passing values to stored procedures e.g.: CREATE OR REPLACE TYPE .t_str_values_arr AS .t_str_values ARRAY[256]
      • dropType

        public void dropType​(java.lang.String schemaName,
                             java.lang.String typeName)
        Description copied from interface: IDatabaseAdapter
        Drop the type object from the schema
      • createTablespace

        public void createTablespace​(java.lang.String tablespaceName)
        Description copied from interface: IDatabaseAdapter
        Create a new tablespace with the given name
      • createTablespace

        public void createTablespace​(java.lang.String tablespaceName,
                                     int extentSizeKB)
        Description copied from interface: IDatabaseAdapter
        Create a new tablespace using the given extent size
      • dropTablespace

        public void dropTablespace​(java.lang.String tablespaceName)
        Description copied from interface: IDatabaseAdapter
        Drop an existing tablespace, including all of its contents
      • doesTableExist

        public boolean doesTableExist​(java.lang.String schemaName,
                                      java.lang.String tableName)
        Description copied from interface: IDatabaseAdapter
        Check if the table currently exists
        Returns:
      • createSequence

        public void createSequence​(java.lang.String schemaName,
                                   java.lang.String sequenceName,
                                   long startWith,
                                   int cache,
                                   int incrementBy)
        Specified by:
        createSequence in interface IDatabaseAdapter
        Overrides:
        createSequence in class CommonDatabaseAdapter
        startWith - the START WITH value for the sequence
        cache - the sequence CACHE value
      • varbinaryClause

        public java.lang.String varbinaryClause​(int size)
        Description copied from interface: IDatabaseTypeAdapter
        Generate a clause for binary data type
        Returns:
      • blobClause

        public java.lang.String blobClause​(long size,
                                           int inlineSize)
        Description copied from interface: IDatabaseTypeAdapter
        Generate a clause for BLOB (with an inline size if supported)
        Returns:
      • varcharClause

        public java.lang.String varcharClause​(int size)
        Description copied from interface: IDatabaseTypeAdapter
        Generate a clause for VARCHAR
        Returns:
      • timestampClause

        public java.lang.String timestampClause​(java.lang.Integer precision)
        Description copied from interface: IDatabaseTypeAdapter
        Generate a clause for TIMESTAMP
        Returns:
      • createForeignKeyConstraint

        public void createForeignKeyConstraint​(java.lang.String constraintName,
                                               java.lang.String schemaName,
                                               java.lang.String name,
                                               java.lang.String targetSchema,
                                               java.lang.String targetTable,
                                               java.lang.String targetColumnName,
                                               java.util.List<java.lang.String> columns,
                                               boolean enforced)
        Specified by:
        createForeignKeyConstraint in interface IDatabaseAdapter
        Overrides:
        createForeignKeyConstraint in class CommonDatabaseAdapter
      • doesForeignKeyConstraintExist

        public boolean doesForeignKeyConstraintExist​(java.lang.String schemaName,
                                                     java.lang.String tableName,
                                                     java.lang.String constraintName)
        Description copied from interface: IDatabaseAdapter
        Does the named foreign key constraint exist
        Returns:
      • checkCompatibility

        public boolean checkCompatibility​(java.lang.String adminSchema)
        Description copied from interface: IDatabaseAdapter
        checks connectivity to the database and that it is compatible
        Returns:
      • createSchema

        public void createSchema​(java.lang.String schemaName)
        Description copied from interface: IDatabaseAdapter
        Create a database schema
      • disableForeignKey

        public void disableForeignKey​(java.lang.String schemaName,
                                      java.lang.String tableName,
                                      java.lang.String constraintName)
        Description copied from interface: IDatabaseAdapter
        Disable the FK with the given constraint name
      • enableForeignKey

        public void enableForeignKey​(java.lang.String schemaName,
                                     java.lang.String tableName,
                                     java.lang.String constraintName)
        Description copied from interface: IDatabaseAdapter
        Enable the FK with the given constraint name
      • setIntegrityOff

        public void setIntegrityOff​(java.lang.String schemaName,
                                    java.lang.String tableName)
      • setIntegrityUnchecked

        public void setIntegrityUnchecked​(java.lang.String schemaName,
                                          java.lang.String tableName)
      • listSchemaObjects

        public java.util.List<SchemaInfoObject> listSchemaObjects​(java.lang.String schemaName)
        Description copied from interface: IDatabaseAdapter
        List the objects present in the given schema
        Returns: