import java.sql.SQLException;
import java.util.Vector;
-import com.quantum.Messages;
-import com.quantum.adapters.AdapterFactory;
-import com.quantum.adapters.DatabaseAdapter;
-import com.quantum.model.Bookmark;
-import com.quantum.model.Entity;
-import com.quantum.model.NotConnectedException;
-import com.quantum.sql.FilterSort;
-import com.quantum.sql.SQLHelper;
-import com.quantum.sql.SQLResults;
-
import org.eclipse.jface.viewers.CellEditor;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;
+import com.quantum.Messages;
+import com.quantum.adapters.DatabaseAdapter;
+import com.quantum.model.Bookmark;
+import com.quantum.model.Entity;
+import com.quantum.model.NotConnectedException;
+import com.quantum.sql.FilterSort;
+import com.quantum.sql.SQLHelper;
+import com.quantum.sql.SQLResults;
+
public class TableAdapter {
- private Table table = null;
-
public static final String DEFAULT = ""; //$NON-NLS-1$
public static final String UTF_8 = "UTF-8"; //$NON-NLS-1$
public static final String UTF_16 = "UTF-16"; //$NON-NLS-1$
try {
if (entity != null) {
totalSize = SQLHelper.getSize(
- bookmark.getConnection(), entity.getCondQualifiedName(),
- AdapterFactory.getInstance().getAdapter(bookmark.getType()));
+ bookmark.getConnection(), entity.getQualifiedName(),
+ bookmark.getAdapter());
}
} catch (SQLException e) {
e.printStackTrace();
public String getQuery() {
if (entity != null) {
- DatabaseAdapter adapter = AdapterFactory.getInstance().getAdapter(bookmark.getType());
+ DatabaseAdapter adapter = bookmark.getAdapter();
if (adapter == null) throw new RuntimeException();
- else return adapter.getTableQuery((entity).getCondQualifiedName()) + extra.toString();
+ else return adapter.getTableQuery((entity).getQualifiedName()) + extra.toString();
}
return query;
}
}
}
public void loadTable(Table table) {
- this.table = table;
table.setHeaderVisible(true);
for (int i = 0; i < columnNames.size(); i++) {
TableColumn column = new TableColumn(table, SWT.NONE);
this.extra = extra;
}
public String getTable() {
- return (entity != null) ? entity.getCondQualifiedName() : null;
+ return (entity != null) ? entity.getQualifiedName() : null;
}
public void setQuery(String query) {