PostgreSQL Adapter-nexj/research notes SQLSchemaManager

From CDOT Wiki
Jump to: navigation, search
Important.png
This page may be obsolete.
It contains historical information.
1/19/2011 (Peter Liu)

Summary of reading the javadoc documentation of the SQLSchemaManager class

A. The Structure of SQLSchemaManager

   - 4 inner classes, 1 inner interface

   - 3 protected instance variables (relevant to our project):
     SQLAdatper (m_adapter), SQLAppender (m_appender), SQLConnection (m_connection)

     * Note: What does SQLAppender do? It might help us to understand what the append methods do
             in the SQLAdapter class.
 
   - the constructor that takes a reference to an SQLAdapter:

         protected  SQLSchemaManager(SQLAdapter adapter)
     
   - 18 abstract methods


B. A List of 18 Abstract Methods

   * Note: Some of the abstract methods are implemented in the MySQLSchemaManager class
           to return null.

1. abstract  void analyzeTable(Table table)

          Appends the SQL statements to gather statistics for a given table to the SQL appender.
         

2. protected abstract  void   appendColumnType(java.lang.StringBuffer buf,
                                               Column column)

          Appends a table column type declaration to a string buffer.
         
         
3. protected abstract  java.lang.StringBuffer   appendConcatenate(
                                                      java.lang.StringBuffer buf,
                                                      java.lang.CharSequence[] argArray)
                                                                 
          Concatenate all values in the list with valid SQL syntax.
         
4. protected abstract  void     appendPrint(java.lang.StringBuffer buf,
                                            java.lang.String sMsg)
                                           
          Appends the SQL for printing a message to a string buffer.
         
5. protected abstract  java.lang.StringBuffer     appendTSExtract(
                                                      java.lang.StringBuffer buf,
                                                      java.lang.CharSequence sTS, byte nField)
                                                               
          Extract nField from sTS with valid SQL syntax.
         
6.  protected abstract  java.lang.StringBuffer     appendTSIncrement(
                                                      java.lang.StringBuffer buf,
                                                      java.lang.CharSequence sTS,
                                                      java.lang.CharSequence sDelta,
                                                      byte nField)
                                                     
          Increment sTS by sDelta with valid SQL syntax.     
         
7. protected abstract  void     appendUpgradeStepEnd(
                                      java.lang.StringBuffer buf,
                                      RelationalSchema schema,
                                      SchemaVersion version,
                                      SchemaVersion prev,
                                      java.lang.String sFailMsg)
                                                    
          Appends the SQL for ending an upgrade step to a string buffer.
         
8. protected abstract  void     appendUpgradeStepStart(
                                      java.lang.StringBuffer buf,
                                      RelationalSchema schema,
                                      SchemaVersion version)
                                                      
          Appends the SQL for starting an upgrade step to a string buffer.
         
  
9. protected abstract  java.lang.String   getCreateEtcScriptName()
          
  
10. protected abstract  java.lang.String   getDefaultIndexspace()
          
11. protected abstract  java.lang.String   getDefaultLongspace()


12. protected abstract  java.lang.String     getDefaultTablespace()


13. protected abstract  java.lang.String     getDropEtcScriptName()


14. protected abstract  SQLSchemaManager.SQLAppender  getDynamicSQLAppender(
                                                         java.lang.StringBuffer buf)

          Wraps a string buffer with an appender for generating dynamic SQL.
         
         
15. protected abstract  java.lang.String     getGUIDExpr()
         
         
16. protected abstract  java.lang.String     getNowExpr()

17. abstract  java.lang.String     getSeparator()

18. protected abstract  java.lang.String     getSetupEtcScriptName()