提交 49d24aa6 编写于 作者: S serge-rider

MySQL catalog class name revert

上级 5b8cd2e2
......@@ -73,12 +73,12 @@ editor.package.body.description=Package body source
editor.parameters.name=Parameters
editor.parameters.tip=Parameters
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.name.name=Schema Name
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCharset.name=Default Charset
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCollation.name=Default Collation
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.sqlPath.name=SQL Path
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.name=Database size
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.description=Database size (data length + index length in bytes)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.name.name=Schema Name
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCharset.name=Default Charset
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCollation.name=Default Collation
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.sqlPath.name=SQL Path
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.name=Database size
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.description=Database size (data length + index length in bytes)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.name.name=Charset
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.defaultCollation.name=Default Collation
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.maxLength.name=Max length
......
......@@ -61,12 +61,12 @@ editor.source.name=Source
editor.package.body.name=Source du Corps (body)
editor.package.body.description=Source du paquet body
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.name.name=Nom du sch\u00E9ma
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCharset.name=Encodage par d\u00E9faut
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCollation.name=Collation par d\u00E9faut
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.sqlPath.name=Chemin SQL
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.name=Taille de la base de donn\u00E9es
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.description=Taille de la base de donn\u00E9es (longueur des donn\u00E9es + index en bytes)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.name.name=Nom du sch\u00E9ma
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCharset.name=Encodage par d\u00E9faut
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCollation.name=Collation par d\u00E9faut
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.sqlPath.name=Chemin SQL
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.name=Taille de la base de donn\u00E9es
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.description=Taille de la base de donn\u00E9es (longueur des donn\u00E9es + index en bytes)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.name.name=Encodage
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.defaultCollation.name=Collation par d\u00E9faut
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.maxLength.name=Longueur Max
......
......@@ -61,12 +61,12 @@ editor.source.name=\u30BD\u30FC\u30B9
editor.package.body.name=\u30DC\u30C7\u30A3\u30BD\u30FC\u30B9
editor.package.body.description=\u30D1\u30C3\u30B1\u30FC\u30B8\u672C\u4F53\u30BD\u30FC\u30B9
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.name.name=\u30B9\u30AD\u30FC\u30DE\u540D
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCharset.name=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u6587\u5B57\u30BB\u30C3\u30C8
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCollation.name=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u7167\u5408\u9806\u5E8F
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.sqlPath.name=SQL\u30D1\u30B9
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.name=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30B5\u30A4\u30BA
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.description=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30B5\u30A4\u30BA\uFF08\u30C7\u30FC\u30BF\u9577+\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u9577\uFF08\u30D0\u30A4\u30C8\uFF09\uFF09
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.name.name=\u30B9\u30AD\u30FC\u30DE\u540D
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCharset.name=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u6587\u5B57\u30BB\u30C3\u30C8
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCollation.name=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u7167\u5408\u9806\u5E8F
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.sqlPath.name=SQL\u30D1\u30B9
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.name=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30B5\u30A4\u30BA
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.description=\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30B5\u30A4\u30BA\uFF08\u30C7\u30FC\u30BF\u9577+\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u9577\uFF08\u30D0\u30A4\u30C8\uFF09\uFF09
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.name.name=Charset
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.defaultCollation.name=\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u7167\u5408\u9806\u5E8F
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.maxLength.name=\u6700\u5927\u9577
......
......@@ -66,12 +66,12 @@ tree.packages.node.name=\u041F\u0430\u043A\u0435\u0442\u044B
editor.parameters.name=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
editor.parameters.tip=\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B
tree.packages.node.description=\u041F\u0430\u043A\u0435\u0442\u044B MariaDB (\u0440\u0435\u0436\u0438\u043C Oracle)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.name.name=\u0418\u043C\u044F \u0441\u0445\u0435\u043C\u044B
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCharset.name=\u041A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCollation.name=\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.sqlPath.name=SQL \u043F\u0443\u0442\u044C
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.name=\u0420\u0430\u0437\u043C\u0435\u0440
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.description=\u0420\u0430\u0437\u043C\u0435\u0440 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445 (\u0434\u043B\u0438\u043D\u0430 \u0434\u0430\u043D\u043D\u044B\u0445 + \u0434\u043B\u0438\u043D\u0430 \u0438\u043D\u0434\u0435\u043A\u0441\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.name.name=\u0418\u043C\u044F \u0441\u0445\u0435\u043C\u044B
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCharset.name=\u041A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCollation.name=\u041F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u0435 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.sqlPath.name=SQL \u043F\u0443\u0442\u044C
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.name=\u0420\u0430\u0437\u043C\u0435\u0440
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.description=\u0420\u0430\u0437\u043C\u0435\u0440 \u0431\u0430\u0437\u044B \u0434\u0430\u043D\u043D\u044B\u0445 (\u0434\u043B\u0438\u043D\u0430 \u0434\u0430\u043D\u043D\u044B\u0445 + \u0434\u043B\u0438\u043D\u0430 \u0438\u043D\u0434\u0435\u043A\u0441\u0430 \u0432 \u0431\u0430\u0439\u0442\u0430\u0445)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.name.name=\u041A\u043E\u0434\u0438\u0440\u043E\u0432\u043A\u0430
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.maxLength.name=\u041C\u0430\u043A\u0441.\u0434\u043B\u0438\u043D\u0430
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.description.name=\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435
......
......@@ -12,12 +12,12 @@ editor.source.name = \u6E90
manager.catalog.name = \u5206\u7C7B\u7BA1\u7406
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCharset.name = \u9ED8\u8BA4\u5B57\u7B26\u96C6
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.defaultCollation.name = \u9ED8\u8BA4\u6392\u5E8F\u89C4\u5219
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase$AdditionalInfo.sqlPath.name = SQL \u8DEF\u5F84
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.description = \u6570\u636E\u5E93\u5927\u5C0F (\u6570\u636E\u957F\u5EA6 + \u7D22\u5F15\u957F\u5EA6\uFF0C \u6309\u5B57\u8282\u8BA1)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.databaseSize.name = \u6570\u636E\u5E93\u5927\u5C0F
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase.name.name = \u6A21\u5F0F\u540D\u79F0
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCharset.name = \u9ED8\u8BA4\u5B57\u7B26\u96C6
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.defaultCollation.name = \u9ED8\u8BA4\u6392\u5E8F\u89C4\u5219
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog$AdditionalInfo.sqlPath.name = SQL \u8DEF\u5F84
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.description = \u6570\u636E\u5E93\u5927\u5C0F (\u6570\u636E\u957F\u5EA6 + \u7D22\u5F15\u957F\u5EA6\uFF0C \u6309\u5B57\u8282\u8BA1)
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.databaseSize.name = \u6570\u636E\u5E93\u5927\u5C0F
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog.name.name = \u6A21\u5F0F\u540D\u79F0
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.defaultCollation.name = \u9ED8\u8BA4\u6392\u5E8F\u89C4\u5219
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.description.name = \u63CF\u8FF0
meta.org.jkiss.dbeaver.ext.mysql.model.MySQLCharset.maxLength.name = \u6700\u5927\u957F\u5EA6
......
......@@ -30,7 +30,7 @@
icon="icons/mysql_icon.png"
label="MySQL data source"
path="mysql">
<folder type="org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase" label="%tree.databases.node.name" icon="#folder_schema" description="%tree.databases.node.tip">
<folder type="org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog" label="%tree.databases.node.name" icon="#folder_schema" description="%tree.databases.node.tip">
<items label="%tree.database.node.name" path="database" property="catalogs" icon="#database">
<folder type="org.jkiss.dbeaver.ext.mysql.model.MySQLTable" label="%tree.tables.node.name" icon="#folder_table" description="%tree.tables.node.tip">
<items label="%tree.table.node.name" path="table" property="tables" icon="#table">
......@@ -246,7 +246,7 @@
<extension point="org.jkiss.dbeaver.objectManager">
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLUserManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLUser"/>
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLDatabaseManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase" label="%manager.catalog.name"/>
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLDatabaseManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog" label="%manager.catalog.name"/>
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLTableManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLTable"/>
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLTableColumnManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLTableColumn"/>
<manager class="org.jkiss.dbeaver.ext.mysql.edit.MySQLConstraintManager" objectType="org.jkiss.dbeaver.ext.mysql.model.MySQLTableConstraint"/>
......@@ -351,7 +351,7 @@
icon="#export"
singleton="false">
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLDataSource"/>
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase"/>
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog"/>
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLTableBase"/>
</tool>
<tool
......@@ -361,7 +361,7 @@
label="Restore database"
icon="#import"
singleton="true">
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase"/>
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog"/>
</tool>
<tool
class="org.jkiss.dbeaver.ext.mysql.tools.MySQLToolScript"
......@@ -369,7 +369,7 @@
id="org.jkiss.dbeaver.ext.mysql.tools.MySQLToolScript"
label="Execute script"
singleton="true">
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase"/>
<objectType name="org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog"/>
</tool>
<tool
class="org.jkiss.dbeaver.ext.mysql.tools.maintenance.MySQLToolAnalyse"
......
......@@ -17,7 +17,7 @@
*/
package org.jkiss.dbeaver.ext.mysql.edit;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.model.edit.DBEPersistAction;
import org.jkiss.dbeaver.ext.mysql.MySQLMessages;
import org.jkiss.dbeaver.ext.mysql.model.MySQLPrivilege;
......@@ -37,11 +37,11 @@ import java.util.Map;
public class MySQLCommandGrantPrivilege extends DBECommandAbstract<MySQLUser> {
private boolean grant;
private MySQLDatabase schema;
private MySQLCatalog schema;
private MySQLTableBase table;
private MySQLPrivilege privilege;
public MySQLCommandGrantPrivilege(MySQLUser user, boolean grant, MySQLDatabase schema, MySQLTableBase table, MySQLPrivilege privilege)
public MySQLCommandGrantPrivilege(MySQLUser user, boolean grant, MySQLCatalog schema, MySQLTableBase table, MySQLPrivilege privilege)
{
super(user, grant ? MySQLMessages.edit_command_grant_privilege_action_grant_privilege : MySQLMessages.edit_command_grant_privilege_name_revoke_privilege);
this.grant = grant;
......
......@@ -36,7 +36,7 @@ public class MySQLConstraintManager extends SQLConstraintManager<MySQLTableConst
@Nullable
@Override
public DBSObjectCache<MySQLDatabase, MySQLTableConstraint> getObjectsCache(MySQLTableConstraint object)
public DBSObjectCache<MySQLCatalog, MySQLTableConstraint> getObjectsCache(MySQLTableConstraint object)
{
return object.getTable().getContainer().getConstraintCache();
}
......
......@@ -20,7 +20,7 @@ package org.jkiss.dbeaver.ext.mysql.edit;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDataSource;
import org.jkiss.dbeaver.ext.mysql.views.MySQLCreateDatabaseDialog;
import org.jkiss.dbeaver.model.DBPDataSource;
......@@ -40,7 +40,7 @@ import java.util.Map;
/**
* MySQLDatabaseManager
*/
public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDataSource> implements DBEObjectRenamer<MySQLDatabase> {
public class MySQLDatabaseManager extends SQLObjectEditor<MySQLCatalog, MySQLDataSource> implements DBEObjectRenamer<MySQLCatalog> {
@Override
public long getMakerOptions(DBPDataSource dataSource)
......@@ -50,23 +50,23 @@ public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDa
@Nullable
@Override
public DBSObjectCache<MySQLDataSource, MySQLDatabase> getObjectsCache(MySQLDatabase object)
public DBSObjectCache<MySQLDataSource, MySQLCatalog> getObjectsCache(MySQLCatalog object)
{
return object.getDataSource().getCatalogCache();
}
@Override
protected MySQLDatabase createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, final MySQLDataSource parent, Object copyFrom)
protected MySQLCatalog createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, final MySQLDataSource parent, Object copyFrom)
{
return new UITask<MySQLDatabase>() {
return new UITask<MySQLCatalog>() {
@Override
protected MySQLDatabase runTask() {
protected MySQLCatalog runTask() {
MySQLCreateDatabaseDialog dialog = new MySQLCreateDatabaseDialog(UIUtils.getActiveWorkbenchShell(), parent);
if (dialog.open() != IDialogConstants.OK_ID) {
return null;
}
String schemaName = dialog.getName();
MySQLDatabase newCatalog = new MySQLDatabase(parent, null);
MySQLCatalog newCatalog = new MySQLCatalog(parent, null);
newCatalog.setName(schemaName);
newCatalog.getAdditionalInfo().setDefaultCharset(dialog.getCharset());
newCatalog.getAdditionalInfo().setDefaultCollation(dialog.getCollation());
......@@ -78,7 +78,7 @@ public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDa
@Override
protected void addObjectCreateActions(DBRProgressMonitor monitor, List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options)
{
final MySQLDatabase catalog = command.getObject();
final MySQLCatalog catalog = command.getObject();
final StringBuilder script = new StringBuilder("CREATE SCHEMA `" + catalog.getName() + "`");
appendDatabaseModifiers(catalog, script);
actions.add(
......@@ -87,7 +87,7 @@ public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDa
}
protected void addObjectModifyActions(DBRProgressMonitor monitor, List<DBEPersistAction> actionList, ObjectChangeCommand command, Map<String, Object> options) {
final MySQLDatabase catalog = command.getObject();
final MySQLCatalog catalog = command.getObject();
final StringBuilder script = new StringBuilder("ALTER DATABASE `" + catalog.getName() + "`");
appendDatabaseModifiers(catalog, script);
actionList.add(
......@@ -95,7 +95,7 @@ public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDa
);
}
private void appendDatabaseModifiers(MySQLDatabase catalog, StringBuilder script) {
private void appendDatabaseModifiers(MySQLCatalog catalog, StringBuilder script) {
if (catalog.getAdditionalInfo().getDefaultCharset() != null) {
script.append("\nDEFAULT CHARACTER SET ").append(catalog.getAdditionalInfo().getDefaultCharset().getName());
}
......@@ -111,7 +111,7 @@ public class MySQLDatabaseManager extends SQLObjectEditor<MySQLDatabase, MySQLDa
}
@Override
public void renameObject(DBECommandContext commandContext, MySQLDatabase catalog, String newName) throws DBException
public void renameObject(DBECommandContext commandContext, MySQLCatalog catalog, String newName) throws DBException
{
throw new DBException("Direct database rename is not yet implemented in MySQL. You should use export/import functions for that.");
}
......
......@@ -5,7 +5,7 @@ import java.util.Map;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLEvent;
import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.DBUtils;
......@@ -19,9 +19,9 @@ import org.jkiss.dbeaver.model.struct.DBSEntityType;
import org.jkiss.dbeaver.ui.UITask;
import org.jkiss.dbeaver.ui.editors.object.struct.EntityEditPage;
public class MySQLEventManager extends SQLObjectEditor<MySQLEvent, MySQLDatabase> {
public class MySQLEventManager extends SQLObjectEditor<MySQLEvent, MySQLCatalog> {
public DBSObjectCache<MySQLDatabase, MySQLEvent> getObjectsCache(MySQLEvent object) {
public DBSObjectCache<MySQLCatalog, MySQLEvent> getObjectsCache(MySQLEvent object) {
return object.getCatalog().getEventCache();
}
......@@ -32,7 +32,7 @@ public class MySQLEventManager extends SQLObjectEditor<MySQLEvent, MySQLDatabase
@Nullable
@Override
protected MySQLEvent createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLDatabase parent, Object copyFrom) {
protected MySQLEvent createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLCatalog parent, Object copyFrom) {
return new UITask<MySQLEvent>() {
@Override
protected MySQLEvent runTask() {
......@@ -48,7 +48,7 @@ public class MySQLEventManager extends SQLObjectEditor<MySQLEvent, MySQLDatabase
}
@Override
protected void addObjectCreateActions(DBRProgressMonitor monitor, List<DBEPersistAction> actions, SQLObjectEditor<MySQLEvent, MySQLDatabase>.ObjectCreateCommand command, Map<String, Object> options) {
protected void addObjectCreateActions(DBRProgressMonitor monitor, List<DBEPersistAction> actions, SQLObjectEditor<MySQLEvent, MySQLCatalog>.ObjectCreateCommand command, Map<String, Object> options) {
final MySQLEvent event = command.getObject();
final StringBuilder script = new StringBuilder();
try {
......@@ -66,7 +66,7 @@ public class MySQLEventManager extends SQLObjectEditor<MySQLEvent, MySQLDatabase
}
@Override
protected void addObjectDeleteActions(List<DBEPersistAction> actions, SQLObjectEditor<MySQLEvent, MySQLDatabase>.ObjectDeleteCommand command, Map<String, Object> options) {
protected void addObjectDeleteActions(List<DBEPersistAction> actions, SQLObjectEditor<MySQLEvent, MySQLCatalog>.ObjectDeleteCommand command, Map<String, Object> options) {
actions.add(new SQLDatabasePersistAction("Drop event", "DROP EVENT " + DBUtils.getQuotedIdentifier(command.getObject())));
}
......
......@@ -46,7 +46,7 @@ public class MySQLIndexManager extends SQLIndexManager<MySQLTableIndex, MySQLTab
@Nullable
@Override
public DBSObjectCache<MySQLDatabase, MySQLTableIndex> getObjectsCache(MySQLTableIndex object)
public DBSObjectCache<MySQLCatalog, MySQLTableIndex> getObjectsCache(MySQLTableIndex object)
{
return object.getTable().getContainer().getIndexCache();
}
......
......@@ -19,7 +19,7 @@ package org.jkiss.dbeaver.ext.mysql.edit;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLProcedure;
import org.jkiss.dbeaver.model.DBPDataSource;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
......@@ -39,11 +39,11 @@ import java.util.Map;
/**
* MySQLProcedureManager
*/
public class MySQLProcedureManager extends SQLObjectEditor<MySQLProcedure, MySQLDatabase> {
public class MySQLProcedureManager extends SQLObjectEditor<MySQLProcedure, MySQLCatalog> {
@Nullable
@Override
public DBSObjectCache<MySQLDatabase, MySQLProcedure> getObjectsCache(MySQLProcedure object)
public DBSObjectCache<MySQLCatalog, MySQLProcedure> getObjectsCache(MySQLProcedure object)
{
return object.getContainer().getProceduresCache();
}
......@@ -67,7 +67,7 @@ public class MySQLProcedureManager extends SQLObjectEditor<MySQLProcedure, MySQL
}
@Override
protected MySQLProcedure createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, final MySQLDatabase parent, Object copyFrom)
protected MySQLProcedure createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, final MySQLCatalog parent, Object copyFrom)
{
return new UITask<MySQLProcedure>() {
@Override
......
......@@ -46,7 +46,7 @@ import java.util.Map;
/**
* MySQL table manager
*/
public class MySQLTableManager extends SQLTableManager<MySQLTableBase, MySQLDatabase> implements DBEObjectRenamer<MySQLTableBase> {
public class MySQLTableManager extends SQLTableManager<MySQLTableBase, MySQLCatalog> implements DBEObjectRenamer<MySQLTableBase> {
private static final Class<?>[] CHILD_TYPES = {
MySQLTableColumn.class,
......@@ -57,13 +57,13 @@ public class MySQLTableManager extends SQLTableManager<MySQLTableBase, MySQLData
@Nullable
@Override
public DBSObjectCache<MySQLDatabase, MySQLTableBase> getObjectsCache(MySQLTableBase object)
public DBSObjectCache<MySQLCatalog, MySQLTableBase> getObjectsCache(MySQLTableBase object)
{
return object.getContainer().getTableCache();
}
@Override
protected MySQLTableBase createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLDatabase parent, Object copyFrom) throws DBException
protected MySQLTableBase createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLCatalog parent, Object copyFrom) throws DBException
{
final MySQLTable table;
if (copyFrom instanceof DBSEntity) {
......
......@@ -19,7 +19,7 @@
package org.jkiss.dbeaver.ext.mysql.edit;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLTable;
import org.jkiss.dbeaver.ext.mysql.model.MySQLTrigger;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
......@@ -76,7 +76,7 @@ public class MySQLTriggerManager extends SQLTriggerManager<MySQLTrigger, MySQLTa
"DROP TRIGGER IF EXISTS " + trigger.getFullyQualifiedName(DBPEvaluationContext.DDL))
);
}
MySQLDatabase curCatalog = trigger.getCatalog().getDataSource().getDefaultObject();
MySQLCatalog curCatalog = trigger.getCatalog().getDataSource().getDefaultObject();
if (curCatalog != trigger.getCatalog()) {
actions.add(new SQLDatabasePersistAction("Set current schema ", "USE " + DBUtils.getQuotedIdentifier(trigger.getCatalog()), false)); //$NON-NLS-2$
}
......
......@@ -19,7 +19,7 @@ package org.jkiss.dbeaver.ext.mysql.edit;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLTableBase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLView;
import org.jkiss.dbeaver.model.DBPEvaluationContext;
......@@ -44,7 +44,7 @@ public class MySQLViewManager extends MySQLTableManager {
@Nullable
@Override
public DBSObjectCache<MySQLDatabase, MySQLTableBase> getObjectsCache(MySQLTableBase object)
public DBSObjectCache<MySQLCatalog, MySQLTableBase> getObjectsCache(MySQLTableBase object)
{
return object.getContainer().getTableCache();
}
......@@ -63,7 +63,7 @@ public class MySQLViewManager extends MySQLTableManager {
}
@Override
protected MySQLView createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLDatabase parent, Object copyFrom)
protected MySQLView createDatabaseObject(DBRProgressMonitor monitor, DBECommandContext context, MySQLCatalog parent, Object copyFrom)
{
MySQLView newView = new MySQLView(parent);
try {
......
......@@ -57,7 +57,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
private Table tablesTable;
private boolean isLoaded = false;
private MySQLDatabase selectedCatalog;
private MySQLCatalog selectedCatalog;
private MySQLTableBase selectedTable;
private PrivilegeTableControl tablePrivilegesTable;
private PrivilegeTableControl otherPrivilegesTable;
......@@ -93,7 +93,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
if (selIndex <= 0) {
selectedCatalog = null;
} else {
selectedCatalog = (MySQLDatabase) catalogsTable.getItem(selIndex).getData();
selectedCatalog = (MySQLCatalog) catalogsTable.getItem(selIndex).getData();
}
showCatalogTables();
showGrants();
......@@ -105,7 +105,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
item.setText("% (All)"); //$NON-NLS-1$
item.setImage(DBeaverIcons.getImage(DBIcon.TREE_DATABASE));
}
for (MySQLDatabase catalog : getDatabaseObject().getDataSource().getCatalogs()) {
for (MySQLCatalog catalog : getDatabaseObject().getDataSource().getCatalogs()) {
TableItem item = new TableItem(catalogsTable, SWT.NONE);
item.setText(catalog.getName());
item.setImage(DBeaverIcons.getImage(DBIcon.TREE_DATABASE));
......@@ -172,7 +172,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
{
final MySQLPrivilege privilege = (MySQLPrivilege) event.data;
final boolean isGrant = event.detail == 1;
final MySQLDatabase curCatalog = selectedCatalog;
final MySQLCatalog curCatalog = selectedCatalog;
final MySQLTableBase curTable = selectedTable;
updateLocalData(privilege, isGrant, curCatalog, curTable);
......@@ -206,7 +206,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
});
}
private void updateLocalData(MySQLPrivilege privilege, boolean isGrant, MySQLDatabase curCatalog, MySQLTableBase curTable)
private void updateLocalData(MySQLPrivilege privilege, boolean isGrant, MySQLCatalog curCatalog, MySQLTableBase curTable)
{
// Modify local grants (and clear grants cache in user objects)
getDatabaseObject().clearGrantsCache();
......@@ -330,7 +330,7 @@ public class MySQLUserEditorPrivileges extends MySQLUserEditorAbstract
// Highlight granted catalogs
if (catalogsTable != null && !catalogsTable.isDisposed()) {
for (TableItem item : catalogsTable.getItems()) {
MySQLDatabase catalog = (MySQLDatabase)item.getData();
MySQLCatalog catalog = (MySQLCatalog)item.getData();
item.setFont(null);
if (grants != null) {
for (MySQLGrant grant : grants) {
......
......@@ -51,9 +51,9 @@ import java.util.Collection;
import java.util.List;
/**
* MySQLDatabase
* MySQLCatalog
*/
public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshableObject, DBPSystemObject, DBSProcedureContainer
public class MySQLCatalog implements DBSSchema, DBPSaveableObject, DBPRefreshableObject, DBPSystemObject, DBSProcedureContainer
{
final TableCache tableCache = new TableCache();
......@@ -110,9 +110,9 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
public static class AdditionalInfoValidator implements IPropertyCacheValidator<MySQLDatabase> {
public static class AdditionalInfoValidator implements IPropertyCacheValidator<MySQLCatalog> {
@Override
public boolean isPropertyCached(MySQLDatabase object, Object propertyId)
public boolean isPropertyCached(MySQLCatalog object, Object propertyId)
{
return object.additionalInfo.loaded;
}
......@@ -161,7 +161,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
}
public MySQLDatabase(MySQLDataSource dataSource, ResultSet dbResult)
public MySQLCatalog(MySQLDataSource dataSource, ResultSet dbResult)
{
tableCache.setCaseSensitive(false);
this.dataSource = dataSource;
......@@ -405,7 +405,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
return name + " [" + dataSource.getContainer().getName() + "]";
}
public static class TableCache extends JDBCStructLookupCache<MySQLDatabase, MySQLTableBase, MySQLTableColumn> {
public static class TableCache extends JDBCStructLookupCache<MySQLCatalog, MySQLTableBase, MySQLTableColumn> {
TableCache()
{
......@@ -414,7 +414,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@NotNull
@Override
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @Nullable MySQLTableBase object, @Nullable String objectName) throws SQLException {
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @Nullable MySQLTableBase object, @Nullable String objectName) throws SQLException {
StringBuilder sql = new StringBuilder();
if (!session.getDataSource().getContainer().getPreferenceStore().getBoolean(ModelPreferences.META_USE_SERVER_SIDE_FILTERS)) {
// Client side filter
......@@ -451,7 +451,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected MySQLTableBase fetchObject(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull JDBCResultSet dbResult)
protected MySQLTableBase fetchObject(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
final String tableType = JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_TABLE_TYPE);
......@@ -463,7 +463,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @Nullable MySQLTableBase forTable)
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @Nullable MySQLTableBase forTable)
throws SQLException
{
StringBuilder sql = new StringBuilder();
......@@ -484,7 +484,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected MySQLTableColumn fetchChild(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull MySQLTableBase table, @NotNull JDBCResultSet dbResult)
protected MySQLTableColumn fetchChild(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull MySQLTableBase table, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
return new MySQLTableColumn(table, dbResult);
......@@ -495,7 +495,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
/**
* Index cache implementation
*/
static class IndexCache extends JDBCCompositeCache<MySQLDatabase, MySQLTable, MySQLTableIndex, MySQLTableIndexColumn> {
static class IndexCache extends JDBCCompositeCache<MySQLCatalog, MySQLTable, MySQLTableIndex, MySQLTableIndexColumn> {
IndexCache(TableCache tableCache)
{
super(tableCache, MySQLTable.class, MySQLConstants.COL_TABLE_NAME, MySQLConstants.COL_INDEX_NAME);
......@@ -503,7 +503,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, MySQLDatabase owner, MySQLTable forTable)
protected JDBCStatement prepareObjectsStatement(JDBCSession session, MySQLCatalog owner, MySQLTable forTable)
throws SQLException
{
StringBuilder sql = new StringBuilder();
......@@ -525,7 +525,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@Nullable
@Override
protected MySQLTableIndex fetchObject(JDBCSession session, MySQLDatabase owner, MySQLTable parent, String indexName, JDBCResultSet dbResult)
protected MySQLTableIndex fetchObject(JDBCSession session, MySQLCatalog owner, MySQLTable parent, String indexName, JDBCResultSet dbResult)
throws SQLException, DBException
{
String indexTypeName = JDBCUtils.safeGetString(dbResult, MySQLConstants.COL_INDEX_TYPE);
......@@ -587,7 +587,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
/**
* Constraint cache implementation
*/
static class ConstraintCache extends JDBCCompositeCache<MySQLDatabase, MySQLTable, MySQLTableConstraint, MySQLTableConstraintColumn> {
static class ConstraintCache extends JDBCCompositeCache<MySQLCatalog, MySQLTable, MySQLTableConstraint, MySQLTableConstraintColumn> {
ConstraintCache(TableCache tableCache)
{
super(tableCache, MySQLTable.class, MySQLConstants.COL_TABLE_NAME, MySQLConstants.COL_CONSTRAINT_NAME);
......@@ -595,7 +595,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@NotNull
@Override
protected JDBCStatement prepareObjectsStatement(JDBCSession session, MySQLDatabase owner, MySQLTable forTable)
protected JDBCStatement prepareObjectsStatement(JDBCSession session, MySQLCatalog owner, MySQLTable forTable)
throws SQLException
{
StringBuilder sql = new StringBuilder(500);
......@@ -617,7 +617,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@Nullable
@Override
protected MySQLTableConstraint fetchObject(JDBCSession session, MySQLDatabase owner, MySQLTable parent, String constraintName, JDBCResultSet dbResult)
protected MySQLTableConstraint fetchObject(JDBCSession session, MySQLCatalog owner, MySQLTable parent, String constraintName, JDBCResultSet dbResult)
throws SQLException, DBException
{
if (constraintName.equals("PRIMARY")) {
......@@ -660,7 +660,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
/**
* Procedures cache implementation
*/
static class ProceduresCache extends JDBCStructLookupCache<MySQLDatabase, MySQLProcedure, MySQLProcedureParameter> {
static class ProceduresCache extends JDBCStructLookupCache<MySQLCatalog, MySQLProcedure, MySQLProcedureParameter> {
ProceduresCache()
{
......@@ -668,14 +668,14 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected MySQLProcedure fetchObject(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull JDBCResultSet dbResult)
protected MySQLProcedure fetchObject(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
return new MySQLProcedure(owner, dbResult);
}
@Override
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @Nullable MySQLProcedure procedure)
protected JDBCStatement prepareChildrenStatement(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @Nullable MySQLProcedure procedure)
throws SQLException
{
// Load procedure columns through MySQL metadata
......@@ -690,7 +690,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected MySQLProcedureParameter fetchChild(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull MySQLProcedure parent, @NotNull JDBCResultSet dbResult)
protected MySQLProcedureParameter fetchChild(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull MySQLProcedure parent, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
String columnName = JDBCUtils.safeGetString(dbResult, JDBCConstants.COLUMN_NAME);
......@@ -729,7 +729,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
@NotNull
@Override
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @Nullable MySQLProcedure object, @Nullable String objectName) throws SQLException {
public JDBCStatement prepareLookupStatement(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @Nullable MySQLProcedure object, @Nullable String objectName) throws SQLException {
JDBCPreparedStatement dbStat = session.prepareStatement(
"SELECT * FROM " + MySQLConstants.META_TABLE_ROUTINES +
"\nWHERE " + MySQLConstants.COL_ROUTINE_SCHEMA + "=?" +
......@@ -745,17 +745,17 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
}
static class PackageCache extends JDBCObjectLookupCache<MySQLDatabase, MySQLPackage> {
static class PackageCache extends JDBCObjectLookupCache<MySQLCatalog, MySQLPackage> {
@Override
protected MySQLPackage fetchObject(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull JDBCResultSet dbResult)
protected MySQLPackage fetchObject(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
return new MySQLPackage(owner, dbResult);
}
@Override
public JDBCStatement prepareLookupStatement(JDBCSession session, MySQLDatabase owner, MySQLPackage object, String objectName) throws SQLException {
public JDBCStatement prepareLookupStatement(JDBCSession session, MySQLCatalog owner, MySQLPackage object, String objectName) throws SQLException {
JDBCPreparedStatement dbStat = session.prepareStatement(
"SELECT name,comment FROM mysql.proc\n" +
"WHERE db = ? AND type = 'PACKAGE'" +
......@@ -769,10 +769,10 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
}
static class TriggerCache extends JDBCObjectLookupCache<MySQLDatabase, MySQLTrigger> {
static class TriggerCache extends JDBCObjectLookupCache<MySQLCatalog, MySQLTrigger> {
@Override
protected MySQLTrigger fetchObject(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull JDBCResultSet dbResult)
protected MySQLTrigger fetchObject(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
String tableName = JDBCUtils.safeGetString(dbResult, "EVENT_OBJECT_TABLE");
......@@ -781,7 +781,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
public JDBCStatement prepareLookupStatement(JDBCSession session, MySQLDatabase owner, MySQLTrigger object, String objectName) throws SQLException {
public JDBCStatement prepareLookupStatement(JDBCSession session, MySQLCatalog owner, MySQLTrigger object, String objectName) throws SQLException {
JDBCPreparedStatement dbStat = session.prepareStatement(
"SELECT * FROM INFORMATION_SCHEMA.TRIGGERS\n" +
"WHERE TRIGGER_SCHEMA = ?" +
......@@ -795,9 +795,9 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
}
static class EventCache extends JDBCObjectCache<MySQLDatabase, MySQLEvent> {
static class EventCache extends JDBCObjectCache<MySQLCatalog, MySQLEvent> {
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull MySQLDatabase owner)
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull MySQLCatalog owner)
throws SQLException
{
final JDBCPreparedStatement dbStat = session.prepareStatement(
......@@ -807,7 +807,7 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
@Override
protected MySQLEvent fetchObject(@NotNull JDBCSession session, @NotNull MySQLDatabase owner, @NotNull JDBCResultSet dbResult)
protected MySQLEvent fetchObject(@NotNull JDBCSession session, @NotNull MySQLCatalog owner, @NotNull JDBCResultSet dbResult)
throws SQLException, DBException
{
return new MySQLEvent(owner, dbResult);
......@@ -815,27 +815,27 @@ public class MySQLDatabase implements DBSSchema, DBPSaveableObject, DBPRefreshab
}
public static class CharsetListProvider implements IPropertyValueListProvider<MySQLDatabase> {
public static class CharsetListProvider implements IPropertyValueListProvider<MySQLCatalog> {
@Override
public boolean allowCustomValue()
{
return false;
}
@Override
public Object[] getPossibleValues(MySQLDatabase object)
public Object[] getPossibleValues(MySQLCatalog object)
{
return object.getDataSource().getCharsets().toArray();
}
}
public static class CollationListProvider implements IPropertyValueListProvider<MySQLDatabase> {
public static class CollationListProvider implements IPropertyValueListProvider<MySQLCatalog> {
@Override
public boolean allowCustomValue()
{
return false;
}
@Override
public Object[] getPossibleValues(MySQLDatabase object)
public Object[] getPossibleValues(MySQLCatalog object)
{
if (object.additionalInfo.defaultCharset == null) {
return null;
......
......@@ -194,7 +194,7 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
protected void initializeContextState(@NotNull DBRProgressMonitor monitor, @NotNull JDBCExecutionContext context, boolean setActiveObject) throws DBCException {
if (setActiveObject) {
MySQLDatabase object = getDefaultObject();
MySQLCatalog object = getDefaultObject();
if (object != null) {
useDatabase(monitor, context, object);
}
......@@ -211,12 +211,12 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
return catalogCache;
}
public Collection<MySQLDatabase> getCatalogs()
public Collection<MySQLCatalog> getCatalogs()
{
return catalogCache.getCachedObjects();
}
public MySQLDatabase getCatalog(String name)
public MySQLCatalog getCatalog(String name)
{
return catalogCache.getCachedObject(name);
}
......@@ -311,7 +311,7 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
if (CommonUtils.isEmpty(catalogName)) {
return null;
}
MySQLDatabase catalog = getCatalog(catalogName);
MySQLCatalog catalog = getCatalog(catalogName);
if (catalog == null) {
log.error("Catalog " + catalogName + " not found");
return null;
......@@ -320,24 +320,24 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
@Override
public Collection<? extends MySQLDatabase> getChildren(@NotNull DBRProgressMonitor monitor)
public Collection<? extends MySQLCatalog> getChildren(@NotNull DBRProgressMonitor monitor)
throws DBException
{
return getCatalogs();
}
@Override
public MySQLDatabase getChild(@NotNull DBRProgressMonitor monitor, @NotNull String childName)
public MySQLCatalog getChild(@NotNull DBRProgressMonitor monitor, @NotNull String childName)
throws DBException
{
return getCatalog(childName);
}
@Override
public Class<? extends MySQLDatabase> getChildType(@NotNull DBRProgressMonitor monitor)
public Class<? extends MySQLCatalog> getChildType(@NotNull DBRProgressMonitor monitor)
throws DBException
{
return MySQLDatabase.class;
return MySQLCatalog.class;
}
@Override
......@@ -354,7 +354,7 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
@Override
public MySQLDatabase getDefaultObject()
public MySQLCatalog getDefaultObject()
{
return CommonUtils.isEmpty(activeCatalogName) ? null : getCatalog(activeCatalogName);
}
......@@ -363,12 +363,12 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object)
throws DBException
{
final MySQLDatabase oldSelectedEntity = getDefaultObject();
if (!(object instanceof MySQLDatabase)) {
final MySQLCatalog oldSelectedEntity = getDefaultObject();
if (!(object instanceof MySQLCatalog)) {
throw new DBException("Invalid object type: " + object);
}
for (JDBCExecutionContext context : getDefaultInstance().getAllContexts()) {
useDatabase(monitor, context, (MySQLDatabase) object);
useDatabase(monitor, context, (MySQLCatalog) object);
}
activeCatalogName = object.getName();
......@@ -385,7 +385,7 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
public boolean refreshDefaultObject(@NotNull DBCSession session) throws DBException {
final String newCatalogName = MySQLUtils.determineCurrentDatabase((JDBCSession) session);
if (!CommonUtils.equalObjects(newCatalogName, activeCatalogName)) {
final MySQLDatabase newCatalog = getCatalog(newCatalogName);
final MySQLCatalog newCatalog = getCatalog(newCatalogName);
if (newCatalog != null) {
setDefaultObject(session.getProgressMonitor(), newCatalog);
return true;
......@@ -394,7 +394,7 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
return false;
}
private void useDatabase(DBRProgressMonitor monitor, JDBCExecutionContext context, MySQLDatabase catalog) throws DBCException {
private void useDatabase(DBRProgressMonitor monitor, JDBCExecutionContext context, MySQLCatalog catalog) throws DBCException {
if (catalog == null) {
log.debug("Null current database");
return;
......@@ -673,13 +673,13 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
}
static class CatalogCache extends JDBCObjectCache<MySQLDataSource, MySQLDatabase>
static class CatalogCache extends JDBCObjectCache<MySQLDataSource, MySQLCatalog>
{
@Override
protected JDBCStatement prepareObjectsStatement(@NotNull JDBCSession session, @NotNull MySQLDataSource owner) throws SQLException
{
StringBuilder catalogQuery = new StringBuilder("show databases");
DBSObjectFilter catalogFilters = owner.getContainer().getObjectFilter(MySQLDatabase.class, null, false);
DBSObjectFilter catalogFilters = owner.getContainer().getObjectFilter(MySQLCatalog.class, null, false);
if (catalogFilters != null) {
JDBCUtils.appendFilterClause(catalogQuery, catalogFilters, MySQLConstants.COL_DATABASE_NAME, true);
}
......@@ -691,9 +691,9 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
@Override
protected MySQLDatabase fetchObject(@NotNull JDBCSession session, @NotNull MySQLDataSource owner, @NotNull JDBCResultSet resultSet) throws SQLException, DBException
protected MySQLCatalog fetchObject(@NotNull JDBCSession session, @NotNull MySQLDataSource owner, @NotNull JDBCResultSet resultSet) throws SQLException, DBException
{
return new MySQLDatabase(owner, resultSet);
return new MySQLCatalog(owner, resultSet);
}
}
......
......@@ -44,7 +44,7 @@ public class MySQLEvent implements MySQLSourceObject, DBPSaveableObject {
private static final String CAT_DETAILS = "Details";
private static final String CAT_STATS = "Statistics";
private MySQLDatabase catalog;
private MySQLCatalog catalog;
private boolean persisted;
private String name;
private String definer;
......@@ -69,7 +69,7 @@ public class MySQLEvent implements MySQLSourceObject, DBPSaveableObject {
private MySQLCollation collationConnection;
private MySQLCollation databaseCollation;
public MySQLEvent(MySQLDatabase catalog, ResultSet dbResult)
public MySQLEvent(MySQLCatalog catalog, ResultSet dbResult)
throws SQLException
{
this.catalog = catalog;
......@@ -78,7 +78,7 @@ public class MySQLEvent implements MySQLSourceObject, DBPSaveableObject {
this.loadInfo(dbResult);
}
public MySQLEvent(MySQLDatabase catalog, String name) {
public MySQLEvent(MySQLCatalog catalog, String name) {
this.catalog = catalog;
this.name = name;
......@@ -276,7 +276,7 @@ public class MySQLEvent implements MySQLSourceObject, DBPSaveableObject {
eventDefinition = sourceText;
}
public MySQLDatabase getCatalog() {
public MySQLCatalog getCatalog() {
return catalog;
}
......
......@@ -60,7 +60,7 @@ public class MySQLGrant implements DBAPrivilegeGrant {
public Object getObject(DBRProgressMonitor monitor) throws DBException {
if (catalogName != null) {
if (!isAllCatalogs()) {
MySQLDatabase catalog = user.getDataSource().getCatalog(catalogName);
MySQLCatalog catalog = user.getDataSource().getCatalog(catalogName);
if (catalog != null) {
if (!isAllTables()) {
MySQLTable table = catalog.getTable(monitor, tableName);
......@@ -136,7 +136,7 @@ public class MySQLGrant implements DBAPrivilegeGrant {
return privileges.isEmpty() && !isAllPrivileges() && !isGrantOption();
}
public boolean matches(MySQLDatabase catalog)
public boolean matches(MySQLCatalog catalog)
{
return (catalog == null && isAllCatalogs()) || (catalog != null && catalog.getName().equalsIgnoreCase(catalogName));
}
......
......@@ -45,7 +45,7 @@ import java.util.Map;
public class MySQLPackage
implements DBPScriptObject, DBPScriptObjectExt, DBSObjectContainer, DBPRefreshableObject, DBSProcedureContainer, DBSPackage, DBPQualifiedObject
{
private MySQLDatabase catalog;
private MySQLCatalog catalog;
private String name;
private String description;
private boolean persisted;
......@@ -54,7 +54,7 @@ public class MySQLPackage
private String sourceDefinition;
public MySQLPackage(
MySQLDatabase catalog,
MySQLCatalog catalog,
ResultSet dbResult)
{
this.catalog = catalog;
......@@ -63,7 +63,7 @@ public class MySQLPackage
this.persisted = true;
}
public MySQLPackage(MySQLDatabase catalog, String name)
public MySQLPackage(MySQLCatalog catalog, String name)
{
this.catalog = catalog;
this.name = name;
......@@ -104,7 +104,7 @@ public class MySQLPackage
return description;
}
public MySQLDatabase getCatalog() {
public MySQLCatalog getCatalog() {
return catalog;
}
......
......@@ -44,7 +44,7 @@ import java.util.Map;
/**
* MySQLProcedure
*/
public class MySQLProcedure extends AbstractProcedure<MySQLDataSource, MySQLDatabase> implements MySQLSourceObject, DBPRefreshableObject
public class MySQLProcedure extends AbstractProcedure<MySQLDataSource, MySQLCatalog> implements MySQLSourceObject, DBPRefreshableObject
{
private static final Log log = Log.getLog(MySQLProcedure.class);
......@@ -55,7 +55,7 @@ public class MySQLProcedure extends AbstractProcedure<MySQLDataSource, MySQLData
private transient String clientBody;
private String charset;
public MySQLProcedure(MySQLDatabase catalog)
public MySQLProcedure(MySQLCatalog catalog)
{
super(catalog, false);
this.procedureType = DBSProcedureType.PROCEDURE;
......@@ -65,7 +65,7 @@ public class MySQLProcedure extends AbstractProcedure<MySQLDataSource, MySQLData
}
public MySQLProcedure(
MySQLDatabase catalog,
MySQLCatalog catalog,
ResultSet dbResult)
{
super(catalog, true);
......
......@@ -89,7 +89,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
@Override
protected void findObjectsByMask(JDBCSession session, DBSObjectType objectType, DBSObject parentObject, String objectNameMask, boolean caseSensitive, boolean globalSearch, int maxResults, List<DBSObjectReference> references) throws DBException, SQLException
{
MySQLDatabase catalog = parentObject instanceof MySQLDatabase ? (MySQLDatabase) parentObject : null;
MySQLCatalog catalog = parentObject instanceof MySQLCatalog ? (MySQLCatalog) parentObject : null;
if (catalog == null && !globalSearch) {
catalog = dataSource.getDefaultObject();
}
......@@ -104,7 +104,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
}
}
private void findTablesByMask(JDBCSession session, @Nullable final MySQLDatabase catalog, String tableNameMask, int maxResults, List<DBSObjectReference> objects)
private void findTablesByMask(JDBCSession session, @Nullable final MySQLCatalog catalog, String tableNameMask, int maxResults, List<DBSObjectReference> objects)
throws SQLException, DBException
{
DBRProgressMonitor monitor = session.getProgressMonitor();
......@@ -130,7 +130,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
objects.add(new AbstractObjectReference(tableName, dataSource.getCatalog(catalogName), null, MySQLTableBase.class, RelationalObjectType.TYPE_TABLE) {
@Override
public DBSObject resolveObject(DBRProgressMonitor monitor) throws DBException {
MySQLDatabase tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
MySQLCatalog tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
if (tableCatalog == null) {
throw new DBException("Table catalog '" + catalogName + "' not found");
}
......@@ -146,7 +146,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
}
}
private void findProceduresByMask(JDBCSession session, @Nullable final MySQLDatabase catalog, String procNameMask, int maxResults, List<DBSObjectReference> objects)
private void findProceduresByMask(JDBCSession session, @Nullable final MySQLCatalog catalog, String procNameMask, int maxResults, List<DBSObjectReference> objects)
throws SQLException, DBException
{
DBRProgressMonitor monitor = session.getProgressMonitor();
......@@ -172,7 +172,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
objects.add(new AbstractObjectReference(procName, dataSource.getCatalog(catalogName), null, MySQLProcedure.class, RelationalObjectType.TYPE_PROCEDURE) {
@Override
public DBSObject resolveObject(DBRProgressMonitor monitor) throws DBException {
MySQLDatabase procCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
MySQLCatalog procCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
if (procCatalog == null) {
throw new DBException("Procedure catalog '" + catalogName + "' not found");
}
......@@ -188,7 +188,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
}
}
private void findConstraintsByMask(JDBCSession session, @Nullable final MySQLDatabase catalog, String constrNameMask, int maxResults, List<DBSObjectReference> objects)
private void findConstraintsByMask(JDBCSession session, @Nullable final MySQLCatalog catalog, String constrNameMask, int maxResults, List<DBSObjectReference> objects)
throws SQLException, DBException
{
DBRProgressMonitor monitor = session.getProgressMonitor();
......@@ -217,7 +217,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
objects.add(new AbstractObjectReference(constrName, dataSource.getCatalog(catalogName), null, isFK ? MySQLTableForeignKey.class : MySQLTableConstraint.class, RelationalObjectType.TYPE_CONSTRAINT) {
@Override
public DBSObject resolveObject(DBRProgressMonitor monitor) throws DBException {
MySQLDatabase tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
MySQLCatalog tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
if (tableCatalog == null) {
throw new DBException("Constraint catalog '" + catalogName + "' not found");
}
......@@ -242,7 +242,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
}
}
private void findTableColumnsByMask(JDBCSession session, @Nullable final MySQLDatabase catalog, String constrNameMask, int maxResults, List<DBSObjectReference> objects)
private void findTableColumnsByMask(JDBCSession session, @Nullable final MySQLCatalog catalog, String constrNameMask, int maxResults, List<DBSObjectReference> objects)
throws SQLException, DBException
{
DBRProgressMonitor monitor = session.getProgressMonitor();
......@@ -280,7 +280,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
@Override
public DBSObject resolveObject(DBRProgressMonitor monitor) throws DBException {
MySQLDatabase tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
MySQLCatalog tableCatalog = catalog != null ? catalog : dataSource.getCatalog(catalogName);
if (tableCatalog == null) {
throw new DBException("Column catalog '" + catalogName + "' not found");
}
......
......@@ -107,13 +107,13 @@ public class MySQLTable extends MySQLTableBase
private final AdditionalInfo additionalInfo = new AdditionalInfo();
public MySQLTable(MySQLDatabase catalog)
public MySQLTable(MySQLCatalog catalog)
{
super(catalog);
}
// Copy constructor
public MySQLTable(DBRProgressMonitor monitor, MySQLDatabase catalog, DBSEntity source) throws DBException {
public MySQLTable(DBRProgressMonitor monitor, MySQLCatalog catalog, DBSEntity source) throws DBException {
super(monitor, catalog, source);
if (source instanceof MySQLTable) {
AdditionalInfo sourceAI = ((MySQLTable)source).getAdditionalInfo(monitor);
......@@ -166,7 +166,7 @@ public class MySQLTable extends MySQLTableBase
}
public MySQLTable(
MySQLDatabase catalog,
MySQLCatalog catalog,
ResultSet dbResult)
{
super(catalog, dbResult);
......
......@@ -43,18 +43,18 @@ import java.util.*;
/**
* MySQLTable base
*/
public abstract class MySQLTableBase extends JDBCTable<MySQLDataSource, MySQLDatabase>
public abstract class MySQLTableBase extends JDBCTable<MySQLDataSource, MySQLCatalog>
implements DBPNamedObject2,DBPRefreshableObject, MySQLSourceObject
{
private static final Log log = Log.getLog(MySQLTableBase.class);
protected MySQLTableBase(MySQLDatabase catalog)
protected MySQLTableBase(MySQLCatalog catalog)
{
super(catalog, false);
}
// Copy constructor
protected MySQLTableBase(DBRProgressMonitor monitor, MySQLDatabase catalog, DBSEntity source) throws DBException {
protected MySQLTableBase(DBRProgressMonitor monitor, MySQLCatalog catalog, DBSEntity source) throws DBException {
super(catalog, source, false);
DBSObjectCache<MySQLTableBase, MySQLTableColumn> colCache = getContainer().getTableCache().getChildrenCache(this);
......@@ -69,14 +69,14 @@ public abstract class MySQLTableBase extends JDBCTable<MySQLDataSource, MySQLDat
}
protected MySQLTableBase(
MySQLDatabase catalog,
MySQLCatalog catalog,
ResultSet dbResult)
{
super(catalog, JDBCUtils.safeGetString(dbResult, 1), true);
}
@Override
public JDBCStructCache<MySQLDatabase, ? extends JDBCTable, ? extends JDBCTableColumn> getCache()
public JDBCStructCache<MySQLCatalog, ? extends JDBCTable, ? extends JDBCTableColumn> getCache()
{
return getContainer().getTableCache();
}
......
......@@ -38,7 +38,7 @@ import java.util.List;
/**
* MySQLTableIndex
*/
public class MySQLTableIndex extends JDBCTableIndex<MySQLDatabase, MySQLTable> implements DBPNamedObject2
public class MySQLTableIndex extends JDBCTableIndex<MySQLCatalog, MySQLTable> implements DBPNamedObject2
{
private boolean nonUnique;
private String additionalInfo;
......
......@@ -42,14 +42,14 @@ import java.util.Map;
*/
public class MySQLTrigger extends AbstractTrigger implements MySQLSourceObject, DBPRefreshableObject
{
private MySQLDatabase catalog;
private MySQLCatalog catalog;
private MySQLTable table;
private String body;
private String charsetClient;
private String sqlMode;
public MySQLTrigger(
MySQLDatabase catalog,
MySQLCatalog catalog,
MySQLTable table,
ResultSet dbResult)
{
......@@ -64,7 +64,7 @@ public class MySQLTrigger extends AbstractTrigger implements MySQLSourceObject,
}
public MySQLTrigger(
MySQLDatabase catalog,
MySQLCatalog catalog,
MySQLTable table,
String name)
{
......@@ -77,7 +77,7 @@ public class MySQLTrigger extends AbstractTrigger implements MySQLSourceObject,
this.body = "";
}
public MySQLTrigger(MySQLDatabase catalog, MySQLTable table, MySQLTrigger source) {
public MySQLTrigger(MySQLCatalog catalog, MySQLTable table, MySQLTrigger source) {
super(source.name, source.getDescription(), false);
this.catalog = catalog;
this.table = table;
......@@ -91,7 +91,7 @@ public class MySQLTrigger extends AbstractTrigger implements MySQLSourceObject,
return body;
}
public MySQLDatabase getCatalog() {
public MySQLCatalog getCatalog() {
return catalog;
}
......
......@@ -106,13 +106,13 @@ public class MySQLView extends MySQLTableBase
private final AdditionalInfo additionalInfo = new AdditionalInfo();
public MySQLView(MySQLDatabase catalog)
public MySQLView(MySQLCatalog catalog)
{
super(catalog);
}
public MySQLView(
MySQLDatabase catalog,
MySQLCatalog catalog,
ResultSet dbResult)
{
super(catalog, dbResult);
......
......@@ -19,7 +19,7 @@ package org.jkiss.dbeaver.ext.mysql.tools;
import org.jkiss.code.NotNull;
import org.jkiss.code.Nullable;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLTableBase;
import java.util.Collection;
......@@ -29,17 +29,17 @@ import java.util.Collection;
*/
public class MySQLDatabaseExportInfo {
@NotNull
private MySQLDatabase database;
private MySQLCatalog database;
@Nullable
private Collection<MySQLTableBase> tables;
public MySQLDatabaseExportInfo(@NotNull MySQLDatabase database, @Nullable Collection<MySQLTableBase> tables) {
public MySQLDatabaseExportInfo(@NotNull MySQLCatalog database, @Nullable Collection<MySQLTableBase> tables) {
this.database = database;
this.tables = tables;
}
@NotNull
public MySQLDatabase getDatabase() {
public MySQLCatalog getDatabase() {
return database;
}
......
......@@ -27,7 +27,7 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.*;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.MySQLMessages;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDataSource;
import org.jkiss.dbeaver.ext.mysql.model.MySQLTableBase;
import org.jkiss.dbeaver.model.DBIcon;
......@@ -49,9 +49,9 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
private Table catalogTable;
private Table tablesTable;
private Map<MySQLDatabase, Set<MySQLTableBase>> checkedObjects = new HashMap<>();
private Map<MySQLCatalog, Set<MySQLTableBase>> checkedObjects = new HashMap<>();
private MySQLDatabase curCatalog;
private MySQLCatalog curCatalog;
protected MySQLExportWizardPageObjects(MySQLExportWizard wizard)
{
......@@ -85,7 +85,7 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
public void handleEvent(Event event) {
TableItem item = (TableItem) event.item;
if (item != null) {
MySQLDatabase catalog = (MySQLDatabase) item.getData();
MySQLCatalog catalog = (MySQLCatalog) item.getData();
if (event.detail == SWT.CHECK) {
catalogTable.select(catalogTable.indexOf(item));
checkedObjects.remove(catalog);
......@@ -138,13 +138,13 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
}
MySQLDataSource dataSource = null;
Set<MySQLDatabase> activeCatalogs = new LinkedHashSet<>();
Set<MySQLCatalog> activeCatalogs = new LinkedHashSet<>();
for (DBSObject object : wizard.getDatabaseObjects()) {
if (object instanceof MySQLDatabase) {
activeCatalogs.add((MySQLDatabase) object);
dataSource = ((MySQLDatabase) object).getDataSource();
if (object instanceof MySQLCatalog) {
activeCatalogs.add((MySQLCatalog) object);
dataSource = ((MySQLCatalog) object).getDataSource();
} else if (object instanceof MySQLTableBase) {
MySQLDatabase catalog = ((MySQLTableBase) object).getContainer();
MySQLCatalog catalog = ((MySQLTableBase) object).getContainer();
dataSource = catalog.getDataSource();
activeCatalogs.add(catalog);
Set<MySQLTableBase> tables = checkedObjects.get(catalog);
......@@ -163,7 +163,7 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
}
if (dataSource != null) {
boolean tablesLoaded = false;
for (MySQLDatabase catalog : dataSource.getCatalogs()) {
for (MySQLCatalog catalog : dataSource.getCatalogs()) {
TableItem item = new TableItem(catalogTable, SWT.NONE);
item.setImage(DBeaverIcons.getImage(DBIcon.TREE_DATABASE));
item.setText(0, catalog.getName());
......@@ -199,7 +199,7 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
}
}
private boolean isChecked(MySQLDatabase catalog) {
private boolean isChecked(MySQLCatalog catalog) {
for (TableItem item : catalogTable.getItems()) {
if (item.getData() == catalog) {
return item.getChecked();
......@@ -208,7 +208,7 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
return false;
}
private void loadTables(final MySQLDatabase catalog) {
private void loadTables(final MySQLCatalog catalog) {
if (catalog != null) {
curCatalog = catalog;
}
......@@ -255,7 +255,7 @@ class MySQLExportWizardPageObjects extends MySQLWizardPageSettings<MySQLExportWi
wizard.objects.clear();
for (TableItem item : catalogTable.getItems()) {
if (item.getChecked()) {
MySQLDatabase catalog = (MySQLDatabase) item.getData();
MySQLCatalog catalog = (MySQLCatalog) item.getData();
MySQLDatabaseExportInfo info = new MySQLDatabaseExportInfo(catalog, checkedObjects.get(catalog));
wizard.objects.add(info);
}
......
......@@ -22,7 +22,7 @@ import org.jkiss.dbeaver.ext.mysql.MySQLConstants;
import org.jkiss.dbeaver.ext.mysql.MySQLDataSourceProvider;
import org.jkiss.dbeaver.ext.mysql.MySQLMessages;
import org.jkiss.dbeaver.ext.mysql.MySQLServerHome;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.model.runtime.DBRProgressMonitor;
import org.jkiss.dbeaver.ui.dialogs.tools.AbstractScriptExecuteWizard;
import org.jkiss.dbeaver.utils.RuntimeUtils;
......@@ -33,7 +33,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLDatabase, MySQLDatabase> {
class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLCatalog, MySQLCatalog> {
enum LogLevel {
Normal,
......@@ -47,7 +47,7 @@ class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLDatabase
private boolean isImport;
private MySQLScriptExecuteWizardPageSettings mainPage;
public MySQLScriptExecuteWizard(MySQLDatabase catalog, boolean isImport)
public MySQLScriptExecuteWizard(MySQLCatalog catalog, boolean isImport)
{
super(Collections.singleton(catalog), isImport ? MySQLMessages.tools_script_execute_wizard_db_import : MySQLMessages.tools_script_execute_wizard_execute_script);
this.isImport = isImport;
......@@ -85,7 +85,7 @@ class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLDatabase
}
@Override
public void fillProcessParameters(List<String> cmd, MySQLDatabase arg) throws IOException
public void fillProcessParameters(List<String> cmd, MySQLCatalog arg) throws IOException
{
String dumpPath = RuntimeUtils.getNativeClientBinary(getClientHome(), MySQLConstants.BIN_FOLDER, "mysql").getAbsolutePath(); //$NON-NLS-1$
cmd.add(dumpPath);
......@@ -112,12 +112,12 @@ class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLDatabase
}
@Override
public Collection<MySQLDatabase> getRunInfo() {
public Collection<MySQLCatalog> getRunInfo() {
return getDatabaseObjects();
}
@Override
protected List<String> getCommandLine(MySQLDatabase arg) throws IOException
protected List<String> getCommandLine(MySQLCatalog arg) throws IOException
{
List<String> cmd = MySQLToolScript.getMySQLToolCommandLine(this, arg);
cmd.add(arg.getName());
......@@ -128,7 +128,7 @@ class MySQLScriptExecuteWizard extends AbstractScriptExecuteWizard<MySQLDatabase
* Use binary file transform job (#2863)
*/
@Override
protected void startProcessHandler(DBRProgressMonitor monitor, final MySQLDatabase arg, ProcessBuilder processBuilder, Process process) {
protected void startProcessHandler(DBRProgressMonitor monitor, final MySQLCatalog arg, ProcessBuilder processBuilder, Process process) {
if (isImport) {
logPage.startLogReader(
processBuilder,
......
......@@ -20,7 +20,7 @@ package org.jkiss.dbeaver.ext.mysql.tools;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.dbeaver.tools.IExternalTool;
import org.jkiss.dbeaver.ui.dialogs.tools.ToolWizardDialog;
......@@ -36,10 +36,10 @@ public class MySQLToolImport implements IExternalTool
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException
{
for (DBSObject object : objects) {
if (object instanceof MySQLDatabase) {
if (object instanceof MySQLCatalog) {
ToolWizardDialog dialog = new ToolWizardDialog(
window,
new MySQLScriptExecuteWizard((MySQLDatabase) object, true));
new MySQLScriptExecuteWizard((MySQLCatalog) object, true));
dialog.open();
}
}
......
......@@ -20,7 +20,7 @@ package org.jkiss.dbeaver.ext.mysql.tools;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.IWorkbenchWindow;
import org.jkiss.dbeaver.DBException;
import org.jkiss.dbeaver.ext.mysql.model.MySQLDatabase;
import org.jkiss.dbeaver.ext.mysql.model.MySQLCatalog;
import org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration;
import org.jkiss.dbeaver.model.struct.DBSObject;
import org.jkiss.dbeaver.tools.IExternalTool;
......@@ -42,10 +42,10 @@ public class MySQLToolScript implements IExternalTool
public void execute(IWorkbenchWindow window, IWorkbenchPart activePart, Collection<DBSObject> objects) throws DBException
{
for (DBSObject object : objects) {
if (object instanceof MySQLDatabase) {
if (object instanceof MySQLCatalog) {
ToolWizardDialog dialog = new ToolWizardDialog(
window,
new MySQLScriptExecuteWizard((MySQLDatabase) object, false));
new MySQLScriptExecuteWizard((MySQLCatalog) object, false));
dialog.open();
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册