Class Rdbms


  • public class Rdbms
    extends java.lang.Object
    • Field Detail

      • rdbms

        public final java.lang.String rdbms
      • derivedRdbms

        public final java.lang.String derivedRdbms
      • important

        public static java.util.List<java.lang.String> important
      • root

        public final com.wisecoders.dbs.config.model.RootProperty root
      • list

        public final com.wisecoders.dbs.config.model.FolderProperty list
      • listProcedure

        public final com.wisecoders.dbs.config.model.TextProperty listProcedure
      • listFunction

        public final com.wisecoders.dbs.config.model.TextProperty listFunction
      • listTrigger

        public final com.wisecoders.dbs.config.model.TextProperty listTrigger
      • listSequence

        public final com.wisecoders.dbs.config.model.TextProperty listSequence
      • load

        public final com.wisecoders.dbs.config.model.FolderProperty load
      • loadConstraint

        public final com.wisecoders.dbs.config.model.TextProperty loadConstraint
      • loadViews

        public final com.wisecoders.dbs.config.model.TextProperty loadViews
      • loadMaterializedViews

        public final com.wisecoders.dbs.config.model.TextProperty loadMaterializedViews
      • loadProcedure

        public final com.wisecoders.dbs.config.model.TextProperty loadProcedure
      • loadFunction

        public final com.wisecoders.dbs.config.model.TextProperty loadFunction
      • loadTrigger

        public final com.wisecoders.dbs.config.model.TextProperty loadTrigger
      • statistics

        public final com.wisecoders.dbs.config.model.FolderProperty statistics
      • tableRowCount

        public final com.wisecoders.dbs.config.model.TextProperty tableRowCount
      • statementsHistoryQuery

        public final com.wisecoders.dbs.config.model.TextProperty statementsHistoryQuery
      • statementsHistoryAdvice

        public final com.wisecoders.dbs.config.model.TextProperty statementsHistoryAdvice
      • other

        public final com.wisecoders.dbs.config.model.FolderProperty other
      • groovyCustomCode

        public final com.wisecoders.dbs.config.model.TextProperty groovyCustomCode
      • explainPlanView

        public final com.wisecoders.dbs.config.model.TextProperty explainPlanView
      • importRemarksProperty

        public final com.wisecoders.dbs.config.model.TextProperty importRemarksProperty
      • sample

        public final com.wisecoders.dbs.config.model.FolderProperty sample
      • sampleProcedure

        public final com.wisecoders.dbs.config.model.TextProperty sampleProcedure
      • sampleFunction

        public final com.wisecoders.dbs.config.model.TextProperty sampleFunction
      • sampleTrigger

        public final com.wisecoders.dbs.config.model.TextProperty sampleTrigger
    • Constructor Detail

      • Rdbms

        public Rdbms​(java.lang.String rdbms)
      • Rdbms

        public Rdbms​(java.lang.String rdbms,
                     java.lang.String derivedRdbms)
        Public constructor.
        Parameters:
        rdbms - name
        derivedRdbms - if specified all settings, data types will be used from this database
    • Method Detail

      • getKnownRdbms

        public static java.util.List<java.lang.String> getKnownRdbms()
      • get

        public static Rdbms get​(java.lang.String rdbms)
      • reloadImporters

        public static void reloadImporters()
      • setImportedColumnType

        public void setImportedColumnType​(Column column,
                                          int javaType,
                                          java.lang.String typeName,
                                          int length,
                                          int decimal,
                                          java.lang.String defaultValue)
      • formatImportedDefaultValue

        public java.lang.String formatImportedDefaultValue​(DataType dataType,
                                                           java.lang.String defaultValue)
      • createSchema

        public Schema createSchema​(Project project,
                                   java.lang.String schemaName)
      • loadSchemasAndCatalogsNames

        public void loadSchemasAndCatalogsNames​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy,
                                                Project project)
                                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDbVersion

        public java.lang.String getDbVersion​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listSchemas

        public java.lang.String[] listSchemas​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listCatalogs

        public java.lang.String[] listCatalogs​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • learnDataTypes

        public void learnDataTypes​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listTableAndViewsNames

        public void listTableAndViewsNames​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer,
                                           Schema schema)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listProcedureNames

        public void listProcedureNames​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer,
                                       Schema schema)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importProcedureParameters

        public void importProcedureParameters​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                              Schema schema)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listFunctionNames

        public void listFunctionNames​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer,
                                      Schema schema)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importFunctionParameters

        public void importFunctionParameters​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                             Schema schema)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listTriggerNames

        public void listTriggerNames​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer,
                                     Schema schema)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listSequences

        public void listSequences​(com.wisecoders.dbs.rdbms.reverseEngineer.model.StructureImporter importer,
                                  Schema schema)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importColumns

        public void importColumns​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                  Schema schema)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importColumnAdditions

        public void importColumnAdditions​(Column column,
                                          java.sql.ResultSet rs)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importSchemaAdditions

        public void importSchemaAdditions​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                          Schema schema)
                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importFks

        public void importFks​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                              Schema schema)
                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importIndexes

        public void importIndexes​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                  Schema schema)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importConstraints

        public void importConstraints​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                      Schema schema)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importViews

        public void importViews​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                Schema schema)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importViewColumns

        public void importViewColumns​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                      Schema schema)
                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importMaterializedViews

        public void importMaterializedViews​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                            Schema schema)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importProcedures

        public void importProcedures​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                     Schema schema)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importFunctions

        public void importFunctions​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                    Schema schema)
                             throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importUserDefinedTypes

        public void importUserDefinedTypes​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                           Schema schema)
                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importTriggers

        public void importTriggers​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                   Schema schema)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importNumberOfRows

        public void importNumberOfRows​(com.wisecoders.dbs.rdbms.reverseEngineer.model.Importer importer,
                                       Schema schema)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • importDone

        public void importDone​(Schema schema)
      • getMessageFromException

        public java.lang.String getMessageFromException​(java.lang.Throwable cause,
                                                        Connector connector)
      • getErrorPosition

        public int getErrorPosition​(java.sql.SQLException exception,
                                    java.lang.String sql,
                                    java.sql.Statement statement,
                                    com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy)
                             throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • getErrorPositionUsingPatterns

        protected int getErrorPositionUsingPatterns​(java.lang.String sql,
                                                    java.lang.String text,
                                                    java.util.regex.Pattern patternLinePosition,
                                                    java.util.regex.Pattern patternColumnPosition,
                                                    java.util.regex.Pattern patternIndexPosition,
                                                    java.util.regex.Pattern patternNearText)
      • getFirstGroupOfMatching

        public int getFirstGroupOfMatching​(java.lang.String text,
                                           java.util.regex.Pattern pattern)
      • canExplainPlan

        public boolean canExplainPlan()
      • explainPlan

        public com.wisecoders.dbs.data.model.explain.ExecutionPlan explainPlan​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy,
                                                                               java.lang.String query)
                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • canListDatabases

        public boolean canListDatabases()
      • listDatabases

        public java.util.List<java.lang.String> listDatabases​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy)
                                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • canCreateDatabase

        public com.wisecoders.dbs.rdbms.CreateDatabaseSupport canCreateDatabase()
      • createDatabase

        public void createDatabase​(Connector connector,
                                   java.lang.String location)
                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • listDatabasesUsingCustomQuery

        protected java.util.List<java.lang.String> listDatabasesUsingCustomQuery​(com.wisecoders.dbs.rdbms.connect.model.envoy.Envoy envoy,
                                                                                 com.wisecoders.dbs.rdbms.connect.model.envoy.DirectQuery query)
                                                                          throws java.lang.Exception
        Throws:
        java.lang.Exception
      • isPlSqlBlock

        public boolean isPlSqlBlock​(java.lang.String text)
      • extractDelimiterFromCommand

        public java.lang.String extractDelimiterFromCommand​(java.lang.String text)
      • formatQueryForExecution

        public java.lang.String formatQueryForExecution​(java.lang.String query)
      • getSynchronizationFilter

        public com.wisecoders.dbs.rdbms.sync.model.SyncFilter getSynchronizationFilter()
      • getScriptGenerator

        public com.wisecoders.dbs.sql.generator.ScriptGenerator getScriptGenerator​(java.util.List<Unit> units)
      • getScriptGenerator

        public com.wisecoders.dbs.sql.generator.ScriptGenerator getScriptGenerator​(Unit unit)
      • getLastUsedRdbms

        public static java.lang.String getLastUsedRdbms()
      • getDerivedRdbms

        public static java.lang.String getDerivedRdbms​(java.lang.String rdbms)
      • setColumnTypeFromString

        public static void setColumnTypeFromString​(Column column,
                                                   java.lang.String typeString)