Exemplo n.º 1
0
 public void createTableIfNotExist(Class<?> entityType) throws DbException {
   if (!tableIsExist(entityType)) {
     SqlInfo sqlInfo = SqlInfoBuilder.buildCreateTableSqlInfo(this, entityType);
     execNonQuery(sqlInfo);
     String execAfterTableCreated = TableUtils.getExecAfterTableCreated(entityType);
     if (!TextUtils.isEmpty(execAfterTableCreated)) {
       execNonQuery(execAfterTableCreated);
     }
   }
 }
Exemplo n.º 2
0
 public void dropTable(Class<?> entityType) throws DbException {
   if (!tableIsExist(entityType)) return;
   String tableName = TableUtils.getTableName(entityType);
   execNonQuery("DROP TABLE " + tableName);
   Table.remove(this, entityType);
 }