Class DBTableManager

java.lang.Object
org.exoplatform.services.database.DBTableManager
Direct Known Subclasses:
StandardSQLTableManager

public abstract class DBTableManager extends Object
Created by The eXo Platform SAS Author : Tuan Nguyen tuan08@users.sourceforge.net Apr 4, 2006 The DBTableManager is an interface to help the developer to check if a table is existed or not and create/drop a table. We can implement more one more DBTableManager according to the database type and version.
  • Constructor Details

    • DBTableManager

      public DBTableManager()
  • Method Details

    • createTable

      public abstract <T extends DBObject> void createTable(Class<T> type, boolean dropIfExist) throws Exception
      This method should: 1. Extract the table information such table name and table fields from the class T, the information are annotated in the class T 2. Generate the SQL statement and create the table
      Type Parameters:
      T -
      Parameters:
      type -
      dropIfExist -
      Throws:
      Exception
    • dropTable

      public abstract <T extends DBObject> void dropTable(Class<T> type) throws Exception
      This method should: 1. Extract the table information from the class T, the information are annotated in the class T 2. Generate the SQL statement and drop the table
      Type Parameters:
      T -
      Parameters:
      type -
      Throws:
      Exception
    • hasTable

      public abstract <T extends DBObject> boolean hasTable(Class<T> type) throws Exception
      This method should: 1. Extract the table information from the class T, the information are annotated in the class T 2. Check to see if the table is existed in the database system
      Type Parameters:
      T -
      Parameters:
      type -
      Returns:
      Throws:
      Exception
    • createDBTableManager

      public static final DBTableManager createDBTableManager(ExoDatasource datasource)
      This method should check the database type and version and create a corresponded DBTableManager
      Parameters:
      datasource -
      Returns: