Class DBTableManager
java.lang.Object
org.exoplatform.services.database.DBTableManager
- Direct Known Subclasses:
StandardSQLTableManager
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final DBTableManagercreateDBTableManager(ExoDatasource datasource) This method should check the database type and version and create a corresponded DBTableManagerabstract <T extends DBObject>
voidcreateTable(Class<T> type, boolean dropIfExist) This method should: 1.abstract <T extends DBObject>
voidThis method should: 1.abstract <T extends DBObject>
booleanThis method should: 1.
-
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
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
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
This method should check the database type and version and create a corresponded DBTableManager- Parameters:
datasource-- Returns:
-