/** * Get the full name of this table, creating that name the first time we are called */ public String getFullTableName() { if (fullTableName == null) { try { final String name = ti.getQualifiedName(); fullTableName = getUnambiguousTableName(_session, name); } catch (Exception e) { s_log.error( "getFullTableName: Unexpected exception - "+e.getMessage(), e); } } return fullTableName; }
/** * Get the full name of this table, creating that name the first time we are called */ public String getFullTableName() { if (fullTableName == null) { try { final String name = ti.getQualifiedName(); fullTableName = getUnambiguousTableName(_session, name); } catch (Exception e) { s_log.error( "getFullTableName: Unexpected exception - "+e.getMessage(), e); } } return fullTableName; }
private void getPrimaryKey(ITableInfo ti) { try { primaryKeyInfos = _session.getMetaData().getPrimaryKey(ti); } catch (SQLException e) { s_log.error( "Unexpected exception while attempting to get primary key info" + " for table "+ti.getQualifiedName()+": "+e.getMessage(), e); } }
private void getPrimaryKey(ITableInfo ti) { try { primaryKeyInfos = _session.getMetaData().getPrimaryKey(ti); } catch (SQLException e) { s_log.error( "Unexpected exception while attempting to get primary key info" + " for table "+ti.getQualifiedName()+": "+e.getMessage(), e); } }
private void onViewTableInObjectTree() { new ObjectTreeSearch().viewObjectInObjectTree(getTableInfo().getQualifiedName(), _session); }
_tableName = ti.getQualifiedName(); _unambiguousTableName = unambiguousTableName;
_tableName = ti.getQualifiedName(); _unambiguousTableName = unambiguousTableName;
String countSql = "select count(*) from " + ti.getQualifiedName() + whereClause; pstmt = conn.prepareStatement(countSql); whereClausePartUtil.setParameters(pstmt, whereClauseParts, 1);
String countSql = "select count(*) from " + ti.getQualifiedName() + whereClause; pstmt = conn.prepareStatement(countSql); whereClausePartUtil.setParameters(pstmt, whereClauseParts, 1);
private void createGUI(ISession session, MysqlPlugin plugin, ITableInfo ti) throws SQLException { setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setTitle(s_stringMgr.getString("AlterTableDialog.title", ti.getQualifiedName())); setContentPane(buildContentPane(session, plugin, ti)); } @SuppressWarnings("unused")
buf.append("DELETE FROM ").append(ti.getQualifiedName()); if (cascadeClause != null && !cascadeClause.equals(""))
buf.append("DELETE FROM ").append(ti.getQualifiedName()); if (cascadeClause != null && !cascadeClause.equals(""))
public void execute() { String cmd = "rename table " + _ti.getQualifiedName() + " to " + _newTableName; SQLExecuterTask executer = new SQLExecuterTask(_session, cmd, new DefaultSQLExecuterHandler(_session)); executer.run(); _session.getSchemaInfo().reloadAllTables(); } }
+ getTableInfo().getQualifiedName()); try
+ getTableInfo().getQualifiedName()); try
final String msg = s_stringMgr.getString("RenameTableAction.newnameprompt", ti.getQualifiedName()); final String title = s_stringMgr.getString("RenameTableAction.rename"); final String newTableName = JOptionPane.showInputDialog(null, msg, title, JOptionPane.QUESTION_MESSAGE);
ti.getQualifiedName(), colDefs[col].getColumnName(), whereClause);
listDialog.setTableName(ti.getQualifiedName()); listDialog.setSingleSelection(); listDialog.addColumnSelectionListener(new ColumnListSelectionActionListener());
private void showCustomDialog() throws SQLException { ITableInfo ti = (ITableInfo) _info[0]; TableColumnInfo[] columns = _session.getMetaData().getColumnInfo(ti); // Show the user a dialog with a list of columns and ask them to select customDialog = new ColumnListDialog(columns, ColumnListDialog.DROP_COLUMN_MODE); customDialog.setMultiSelection(); customDialog.setTableName(ti.getQualifiedName()); customDialog.addColumnSelectionListener(new ExecuteListener()); customDialog.addEditSQLListener(new EditSQLListener(customDialog)); customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog)); customDialog.setLocationRelativeTo(SessionUtils.getOwningFrame(_session)); customDialog.setVisible(true); }
/** * @throws SQLException */ public void showCustomDialog() throws SQLException { ITableInfo ti = (ITableInfo) _info[0]; TableColumnInfo[] columns = _session.getMetaData().getColumnInfo(ti); if (columns == null || columns.length == 0) { _session.showErrorMessage(s_stringMgr.getString("AddPrimaryKeyCommand.noColumns", ti.getSimpleName())); return; } // Show the user a dialog with a list of columns and ask them to select one or more columns to drop customDialog = new ColumnListDialog(columns, ColumnListDialog.ADD_PRIMARY_KEY_MODE); customDialog.setTableName(ti.getQualifiedName()); // Set a default primary key name based on the name of the table customDialog.setPrimaryKeyName("PK_" + columns[0].getTableName().toUpperCase()); customDialog.addColumnSelectionListener(new ExecuteListener()); customDialog.addEditSQLListener(new EditSQLListener(customDialog)); customDialog.addShowSQLListener(new ShowSQLListener(i18n.SHOWSQL_DIALOG_TITLE, customDialog)); customDialog.setLocationRelativeTo(SessionUtils.getOwningFrame(_session)); customDialog.setMultiSelection(); customDialog.setVisible(true); }