Class ExportDb


  • public class ExportDb
    extends java.lang.Object
    Exports a database schema to an in-memory Schema object.
    Author:
    Matt Ward
    • Constructor Summary

      Constructors 
      Constructor Description
      ExportDb​(javax.sql.DataSource dataSource, Dialect dialect, DescriptorService descriptorService, DatabaseMetaDataHelper databaseMetaDataHelper)
      Create a new instance of the tool within the context of an existing database connection
      ExportDb​(org.springframework.context.ApplicationContext context)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void execute()  
      protected java.lang.String generateType​(java.lang.String dbTypeRaw, int size, int digits, int sqlType)  
      java.lang.String getNamePrefix()  
      Schema getSchema()  
      void setDbSchemaName​(java.lang.String dbSchemaName)
      Set the default schema name
      void setNamePrefix​(java.lang.String namePrefix)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExportDb

        public ExportDb​(org.springframework.context.ApplicationContext context)
      • ExportDb

        public ExportDb​(javax.sql.DataSource dataSource,
                        Dialect dialect,
                        DescriptorService descriptorService,
                        DatabaseMetaDataHelper databaseMetaDataHelper)
        Create a new instance of the tool within the context of an existing database connection
        Parameters:
        dataSource - the database connection to use for metadata queries
        dialect - the Hibernate dialect
        descriptorService - descriptorService
        databaseMetaDataHelper - databaseMetaDataHelper
    • Method Detail

      • execute

        public void execute()
      • generateType

        protected java.lang.String generateType​(java.lang.String dbTypeRaw,
                                                int size,
                                                int digits,
                                                int sqlType)
                                         throws java.lang.IllegalArgumentException,
                                                java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalArgumentException
        java.lang.IllegalAccessException
      • getSchema

        public Schema getSchema()
        Returns:
        the schema
      • getNamePrefix

        public java.lang.String getNamePrefix()
        Returns:
        the namePrefix
      • setNamePrefix

        public void setNamePrefix​(java.lang.String namePrefix)
        Parameters:
        namePrefix - the namePrefix to set
      • setDbSchemaName

        public void setDbSchemaName​(java.lang.String dbSchemaName)
        Set the default schema name
        Parameters:
        dbSchemaName - the default schema name