Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
7bc36ec2
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7bc36ec2
编写于
12月 30, 2018
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#2051 Command context model refactoring. DB lazy instance. PostgreSQL database altering.
Former-commit-id:
0dbb99f2
上级
0c3ea4e8
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
253 addition
and
65 deletion
+253
-65
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/manager/DB2SequenceManager.java
...org/jkiss/dbeaver/ext/db2/manager/DB2SequenceManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolFunctionManager.java
...iss/dbeaver/ext/exasol/manager/ExasolFunctionManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolScriptManager.java
...jkiss/dbeaver/ext/exasol/manager/ExasolScriptManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolViewManager.java
...g/jkiss/dbeaver/ext/exasol/manager/ExasolViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLCommandChangeUser.java
.../jkiss/dbeaver/ext/mysql/edit/MySQLCommandChangeUser.java
+1
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLProcedureManager.java
...g/jkiss/dbeaver/ext/mysql/edit/MySQLProcedureManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLViewManager.java
...rc/org/jkiss/dbeaver/ext/mysql/edit/MySQLViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleMaterializedViewManager.java
...beaver/ext/oracle/edit/OracleMaterializedViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
...org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleSequenceManager.java
.../jkiss/dbeaver/ext/oracle/edit/OracleSequenceManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleViewManager.java
.../org/jkiss/dbeaver/ext/oracle/edit/OracleViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreDatabaseManager.java
...s/dbeaver/ext/postgresql/edit/PostgreDatabaseManager.java
+34
-0
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreProcedureManager.java
.../dbeaver/ext/postgresql/edit/PostgreProcedureManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreSequenceManager.java
...s/dbeaver/ext/postgresql/edit/PostgreSequenceManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
...jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
...jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
...g/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
+105
-25
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/DBECommand.java
...er.model/src/org/jkiss/dbeaver/model/edit/DBECommand.java
+2
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/DBECommandContext.java
...l/src/org/jkiss/dbeaver/model/edit/DBECommandContext.java
+3
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/prop/DBECommandProperty.java
...org/jkiss/dbeaver/model/edit/prop/DBECommandProperty.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/AbstractCommandContext.java
...jkiss/dbeaver/model/impl/edit/AbstractCommandContext.java
+19
-13
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/DBECommandAbstract.java
...org/jkiss/dbeaver/model/impl/edit/DBECommandAbstract.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
...rg/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
+3
-3
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/struct/SQLTableColumnManager.java
...ver/model/impl/sql/edit/struct/SQLTableColumnManager.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/struct/SQLTriggerManager.java
...dbeaver/model/impl/sql/edit/struct/SQLTriggerManager.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/struct/DBSInstanceLazy.java
...l/src/org/jkiss/dbeaver/model/struct/DBSInstanceLazy.java
+34
-0
plugins/org.jkiss.dbeaver.ui.editors.base/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
...src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
+8
-0
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
...src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
+2
-1
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/actions/NavigatorHandlerObjectOpen.java
...aver/ui/navigator/actions/NavigatorHandlerObjectOpen.java
+24
-3
未找到文件。
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/manager/DB2SequenceManager.java
浏览文件 @
7bc36ec2
...
...
@@ -59,7 +59,7 @@ public class DB2SequenceManager extends SQLObjectEditor<DB2Sequence, DB2Schema>
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
throws
DBException
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
throw
new
DBException
(
"Sequence name cannot be empty"
);
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolFunctionManager.java
浏览文件 @
7bc36ec2
...
...
@@ -47,7 +47,7 @@ public class ExasolFunctionManager extends SQLObjectEditor<ExasolFunction, Exaso
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolScriptManager.java
浏览文件 @
7bc36ec2
...
...
@@ -47,7 +47,7 @@ public class ExasolScriptManager extends SQLObjectEditor<ExasolScript, ExasolSch
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/manager/ExasolViewManager.java
浏览文件 @
7bc36ec2
...
...
@@ -47,7 +47,7 @@ public class ExasolViewManager
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
ExasolTableBase
object
=
command
.
getObject
();
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLCommandChangeUser.java
浏览文件 @
7bc36ec2
...
...
@@ -59,7 +59,7 @@ public class MySQLCommandChangeUser extends DBECommandComposite<MySQLUser, UserP
}
@Override
public
void
validateCommand
()
throws
DBException
public
void
validateCommand
(
Map
<
String
,
Object
>
options
)
throws
DBException
{
String
passValue
=
CommonUtils
.
toString
(
getProperty
(
UserPropertyHandler
.
PASSWORD
));
String
confirmValue
=
CommonUtils
.
toString
(
getProperty
(
UserPropertyHandler
.
PASSWORD_CONFIRM
));
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLProcedureManager.java
浏览文件 @
7bc36ec2
...
...
@@ -55,7 +55,7 @@ public class MySQLProcedureManager extends SQLObjectEditor<MySQLProcedure, MySQL
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLViewManager.java
浏览文件 @
7bc36ec2
...
...
@@ -50,7 +50,7 @@ public class MySQLViewManager extends MySQLTableManager {
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
MySQLTableBase
object
=
command
.
getObject
();
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleMaterializedViewManager.java
浏览文件 @
7bc36ec2
...
...
@@ -49,7 +49,7 @@ public class OracleMaterializedViewManager extends SQLObjectEditor<OracleMateria
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
浏览文件 @
7bc36ec2
...
...
@@ -45,7 +45,7 @@ public class OracleQueueManager extends SQLObjectEditor<OracleQueue, OracleSchem
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
throws
DBException
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
throw
new
DBException
(
"Queue name cannot be empty"
);
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleSequenceManager.java
浏览文件 @
7bc36ec2
...
...
@@ -32,7 +32,7 @@ public class OracleSequenceManager extends SQLObjectEditor<OracleSequence, Oracl
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
throws
DBException
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
throw
new
DBException
(
"Sequence name cannot be empty"
);
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleViewManager.java
浏览文件 @
7bc36ec2
...
...
@@ -48,7 +48,7 @@ public class OracleViewManager extends SQLObjectEditor<OracleView, OracleSchema>
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreDatabaseManager.java
浏览文件 @
7bc36ec2
...
...
@@ -23,6 +23,7 @@ import org.jkiss.dbeaver.ext.postgresql.PostgreMessages;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreDataSource
;
import
org.jkiss.dbeaver.ext.postgresql.model.PostgreDatabase
;
import
org.jkiss.dbeaver.ext.postgresql.ui.PostgreCreateDatabaseDialog
;
import
org.jkiss.dbeaver.model.DBConstants
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
...
...
@@ -134,6 +135,38 @@ public class PostgreDatabaseManager extends SQLObjectEditor<PostgreDatabase, Pos
);
}
@Override
protected
void
addObjectModifyActions
(
DBRProgressMonitor
monitor
,
List
<
DBEPersistAction
>
actionList
,
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
{
if
(
command
.
getProperties
().
size
()
>
1
||
command
.
getProperty
(
DBConstants
.
PROP_ID_DESCRIPTION
)
==
null
)
{
try
{
generateAlterActions
(
monitor
,
actionList
,
command
);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
}
}
}
private
void
generateAlterActions
(
DBRProgressMonitor
monitor
,
List
<
DBEPersistAction
>
actionList
,
ObjectChangeCommand
command
)
throws
DBException
{
final
PostgreDatabase
database
=
command
.
getObject
();
final
String
alterPrefix
=
"ALTER DATABASE "
+
DBUtils
.
getQuotedIdentifier
(
command
.
getObject
())
+
" "
;
if
(
command
.
hasProperty
(
"defaultTablespace"
))
{
actionList
.
add
(
new
SQLDatabasePersistAction
(
alterPrefix
+
"SET TABLESPACE "
+
DBUtils
.
getQuotedIdentifier
(
database
.
getDefaultTablespace
(
monitor
))));
}
if
(
command
.
hasProperty
(
"defaultEncoding"
))
{
actionList
.
add
(
new
SQLDatabasePersistAction
(
alterPrefix
+
"SET ENCODING "
+
DBUtils
.
getQuotedIdentifier
(
database
.
getDefaultEncoding
(
monitor
))));
}
if
(
command
.
hasProperty
(
"dba"
))
{
actionList
.
add
(
new
SQLDatabasePersistAction
(
alterPrefix
+
"OWNER TO "
+
DBUtils
.
getQuotedIdentifier
(
database
.
getDBA
(
monitor
))));
}
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
super
.
validateObjectProperties
(
command
,
options
);
options
.
put
(
DBECommandContext
.
OPTION_AVOID_TRANSACTIONS
,
true
);
}
private
static
class
DeleteDatabaseAction
extends
SQLDatabasePersistActionAtomic
{
private
final
PostgreDatabase
database
;
...
...
@@ -169,5 +202,6 @@ public class PostgreDatabaseManager extends SQLObjectEditor<PostgreDatabase, Pos
}
}
}
}
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreProcedureManager.java
浏览文件 @
7bc36ec2
...
...
@@ -63,7 +63,7 @@ public class PostgreProcedureManager extends SQLObjectEditor<PostgreProcedure, P
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreSequenceManager.java
浏览文件 @
7bc36ec2
...
...
@@ -58,7 +58,7 @@ public class PostgreSequenceManager extends SQLObjectEditor<PostgreTableBase, Po
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/edit/PostgreViewManager.java
浏览文件 @
7bc36ec2
...
...
@@ -55,7 +55,7 @@ public class PostgreViewManager extends PostgreTableManagerBase implements DBEOb
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
PostgreTableBase
object
=
command
.
getObject
();
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
浏览文件 @
7bc36ec2
...
...
@@ -146,7 +146,7 @@ public class PostgreDataSource extends JDBCDataSource implements DBSObjectSelect
}
databaseCache
.
setCache
(
dbList
);
// Initiate default context
getDefaultInstance
().
check
Databas
eConnection
(
monitor
);
getDefaultInstance
().
check
Instanc
eConnection
(
monitor
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDatabase.java
浏览文件 @
7bc36ec2
...
...
@@ -39,12 +39,11 @@ import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache
;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectLookupCache
;
import
org.jkiss.dbeaver.model.meta.Association
;
import
org.jkiss.dbeaver.model.meta.IPropertyValueListProvider
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObjectFilter
;
import
org.jkiss.dbeaver.model.struct.DBSObjectSelector
;
import
org.jkiss.dbeaver.model.struct.DBSObjectState
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.*
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSCatalog
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.LongKeyMap
;
...
...
@@ -59,7 +58,15 @@ import java.util.List;
/**
* PostgreDatabase
*/
public
class
PostgreDatabase
extends
JDBCRemoteInstance
<
PostgreDataSource
>
implements
DBSCatalog
,
DBPRefreshableObject
,
DBPStatefulObject
,
DBPNamedObject2
,
PostgreObject
,
DBSObjectSelector
{
public
class
PostgreDatabase
extends
JDBCRemoteInstance
<
PostgreDataSource
>
implements
DBSCatalog
,
DBPRefreshableObject
,
DBPStatefulObject
,
DBPNamedObject2
,
PostgreObject
,
DBSObjectSelector
,
DBSInstanceLazy
{
private
static
final
Log
log
=
Log
.
getLog
(
PostgreDatabase
.
class
);
...
...
@@ -118,7 +125,7 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
// We need to set name first
this
.
name
=
databaseName
;
this
.
initCaches
();
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
readDatabaseInfo
(
monitor
);
}
...
...
@@ -165,7 +172,8 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
return
initialEncoding
;
}
void
checkDatabaseConnection
(
DBRProgressMonitor
monitor
)
throws
DBException
{
@Override
public
void
checkInstanceConnection
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(
executionContext
==
null
)
{
initializeMainContext
(
monitor
);
initializeMetaContext
(
monitor
);
...
...
@@ -250,12 +258,16 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
}
@Nullable
@Property
(
order
=
3
)
@Property
(
editable
=
true
,
updatable
=
true
,
order
=
3
,
listProvider
=
RoleListProvider
.
class
)
public
PostgreRole
getDBA
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
getRoleById
(
monitor
,
ownerId
);
}
public
void
setDBA
(
PostgreRole
owner
)
{
this
.
ownerId
=
owner
.
getObjectId
();
}
@Nullable
public
PostgreRole
getRoleById
(
DBRProgressMonitor
monitor
,
long
roleId
)
throws
DBException
{
if
(!
getDataSource
().
getServerType
().
supportsRoles
())
{
...
...
@@ -274,15 +286,19 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
return
roleCache
.
getObject
(
monitor
,
owner
,
roleName
);
}
@Property
(
order
=
5
)
@Property
(
editable
=
false
,
updatable
=
false
,
order
=
5
/*, listProvider = CharsetListProvider.class*/
)
public
PostgreCharset
getDefaultEncoding
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(!
getDataSource
().
getServerType
().
supportsEncodings
())
{
return
null
;
}
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
PostgreUtils
.
getObjectById
(
monitor
,
encodingCache
,
this
,
encodingId
);
}
public
void
setDefaultEncoding
(
PostgreCharset
charset
)
throws
DBException
{
this
.
encodingId
=
charset
.
getObjectId
();
}
@Property
(
order
=
10
)
public
String
getCollate
()
{
return
collate
;
...
...
@@ -313,31 +329,31 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
@Association
public
Collection
<
PostgreRole
>
getAuthIds
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
roleCache
.
getAllObjects
(
monitor
,
this
);
}
@Association
public
Collection
<
PostgreAccessMethod
>
getAccessMethods
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
accessMethodCache
.
getAllObjects
(
monitor
,
this
);
}
@Association
public
Collection
<
PostgreForeignDataWrapper
>
getForeignDataWrappers
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
foreignDataWrapperCache
.
getAllObjects
(
monitor
,
this
);
}
@Association
public
Collection
<
PostgreForeignServer
>
getForeignServers
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
foreignServerCache
.
getAllObjects
(
monitor
,
this
);
}
@Association
public
Collection
<
PostgreLanguage
>
getLanguages
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
languageCache
.
getAllObjects
(
monitor
,
this
);
}
...
...
@@ -346,7 +362,7 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
if
(!
getDataSource
().
getServerType
().
supportsEncodings
())
{
return
null
;
}
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
encodingCache
.
getAllObjects
(
monitor
,
this
);
}
...
...
@@ -355,18 +371,22 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
@Association
public
Collection
<
PostgreTablespace
>
getTablespaces
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
tablespaceCache
.
getAllObjects
(
monitor
,
this
);
}
@Property
(
order
=
4
)
@Property
(
editable
=
true
,
updatable
=
true
,
order
=
4
,
listProvider
=
TablespaceListProvider
.
class
)
public
PostgreTablespace
getDefaultTablespace
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
PostgreUtils
.
getObjectById
(
monitor
,
tablespaceCache
,
this
,
tablespaceId
);
}
public
void
setDefaultTablespace
(
PostgreTablespace
tablespace
)
throws
DBException
{
this
.
tablespaceId
=
tablespace
.
getObjectId
();
}
public
PostgreTablespace
getTablespace
(
DBRProgressMonitor
monitor
,
long
tablespaceId
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
for
(
PostgreTablespace
ts
:
tablespaceCache
.
getAllObjects
(
monitor
,
this
))
{
if
(
ts
.
getObjectId
()
==
tablespaceId
)
{
return
ts
;
...
...
@@ -380,7 +400,7 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
@Association
public
Collection
<
PostgreSchema
>
getSchemas
(
DBRProgressMonitor
monitor
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
// Get all schemas
return
schemaCache
.
getAllObjects
(
monitor
,
this
);
}
...
...
@@ -408,12 +428,12 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
}
public
PostgreSchema
getSchema
(
DBRProgressMonitor
monitor
,
String
name
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
schemaCache
.
getObject
(
monitor
,
this
,
name
);
}
public
PostgreSchema
getSchema
(
DBRProgressMonitor
monitor
,
long
oid
)
throws
DBException
{
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
for
(
PostgreSchema
schema
:
schemaCache
.
getAllObjects
(
monitor
,
this
))
{
if
(
schema
.
getObjectId
()
==
oid
)
{
return
schema
;
...
...
@@ -488,7 +508,7 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
if
(!
getDataSource
().
getServerType
().
supportsRoles
())
{
return
Collections
.
emptyList
();
}
check
Databas
eConnection
(
monitor
);
check
Instanc
eConnection
(
monitor
);
return
roleCache
.
getAllObjects
(
monitor
,
this
);
}
...
...
@@ -914,4 +934,64 @@ public class PostgreDatabase extends JDBCRemoteInstance<PostgreDataSource> imple
return
new
PostgreSchema
(
owner
,
name
,
resultSet
);
}
}
public
static
class
TablespaceListProvider
implements
IPropertyValueListProvider
<
PostgreDatabase
>
{
@Override
public
boolean
allowCustomValue
()
{
return
false
;
}
@Override
public
Object
[]
getPossibleValues
(
PostgreDatabase
object
)
{
try
{
Collection
<
PostgreTablespace
>
tablespaces
=
object
.
getTablespaces
(
new
VoidProgressMonitor
());
return
tablespaces
.
toArray
(
new
Object
[
tablespaces
.
size
()]);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
new
Object
[
0
];
}
}
}
public
static
class
RoleListProvider
implements
IPropertyValueListProvider
<
PostgreDatabase
>
{
@Override
public
boolean
allowCustomValue
()
{
return
false
;
}
@Override
public
Object
[]
getPossibleValues
(
PostgreDatabase
object
)
{
try
{
Collection
<
PostgreRole
>
roles
=
object
.
getAuthIds
(
new
VoidProgressMonitor
());
return
roles
.
toArray
(
new
Object
[
roles
.
size
()]);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
new
Object
[
0
];
}
}
}
public
static
class
CharsetListProvider
implements
IPropertyValueListProvider
<
PostgreDatabase
>
{
@Override
public
boolean
allowCustomValue
()
{
return
false
;
}
@Override
public
Object
[]
getPossibleValues
(
PostgreDatabase
object
)
{
try
{
Collection
<
PostgreCharset
>
tablespaces
=
object
.
getEncodings
(
new
VoidProgressMonitor
());
return
tablespaces
.
toArray
(
new
Object
[
tablespaces
.
size
()]);
}
catch
(
DBException
e
)
{
log
.
error
(
e
);
return
new
Object
[
0
];
}
}
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/DBECommand.java
浏览文件 @
7bc36ec2
...
...
@@ -38,8 +38,9 @@ public interface DBECommand<OBJECT_TYPE extends DBPObject> {
* Validates command.
* If command is fine then just returns, otherwise throws an exception
* @throws DBException contains information about invalid command state
* @param options
*/
void
validateCommand
()
throws
DBException
;
void
validateCommand
(
Map
<
String
,
Object
>
options
)
throws
DBException
;
void
updateModel
();
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/DBECommandContext.java
浏览文件 @
7bc36ec2
...
...
@@ -31,6 +31,9 @@ import java.util.Map;
*/
public
interface
DBECommandContext
extends
DBPContextProvider
{
// Do not use transactions in conect save
String
OPTION_AVOID_TRANSACTIONS
=
"avoidTransactions"
;
boolean
isDirty
();
DBECommand
getUndoCommand
();
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/edit/prop/DBECommandProperty.java
浏览文件 @
7bc36ec2
...
...
@@ -97,7 +97,7 @@ public class DBECommandProperty<OBJECT_TYPE extends DBPObject> extends DBEComman
}
@Override
public
void
validateCommand
()
throws
DBException
public
void
validateCommand
(
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
handler
instanceof
DBEPropertyValidator
)
{
((
DBEPropertyValidator
<
OBJECT_TYPE
>)
handler
).
validate
(
getObject
(),
newValue
);
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/AbstractCommandContext.java
浏览文件 @
7bc36ec2
...
...
@@ -80,12 +80,25 @@ public abstract class AbstractCommandContext implements DBECommandContext {
// Execute commands in transaction
DBCTransactionManager
txnManager
=
DBUtils
.
getTransactionManager
(
executionContext
);
boolean
useAutoCommit
=
false
;
// Validate commands
{
Map
<
String
,
Object
>
validateOptions
=
new
HashMap
<>();
for
(
CommandQueue
queue
:
commandQueues
)
{
for
(
CommandInfo
cmd
:
queue
.
commands
)
{
cmd
.
command
.
validateCommand
(
validateOptions
);
}
}
useAutoCommit
=
CommonUtils
.
getOption
(
validateOptions
,
OPTION_AVOID_TRANSACTIONS
);
}
boolean
oldAutoCommit
=
false
;
if
(
txnManager
!=
null
)
{
oldAutoCommit
=
txnManager
.
isAutoCommit
();
if
(
oldAutoCommit
)
{
if
(
oldAutoCommit
!=
useAutoCommit
)
{
try
{
txnManager
.
setAutoCommit
(
monitor
,
false
);
txnManager
.
setAutoCommit
(
monitor
,
useAutoCommit
);
}
catch
(
DBCException
e
)
{
log
.
warn
(
"Can't switch to transaction mode"
,
e
);
}
...
...
@@ -95,7 +108,7 @@ public abstract class AbstractCommandContext implements DBECommandContext {
executeCommands
(
monitor
,
options
);
// Commit changes
if
(
txnManager
!=
null
)
{
if
(
txnManager
!=
null
&&
!
useAutoCommit
)
{
try
(
DBCSession
session
=
executionContext
.
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Commit script transaction"
))
{
txnManager
.
commit
(
session
);
}
catch
(
DBCException
e1
)
{
...
...
@@ -106,7 +119,7 @@ public abstract class AbstractCommandContext implements DBECommandContext {
clearCommandQueues
();
}
catch
(
Throwable
e
)
{
// Rollback changes
if
(
txnManager
!=
null
)
{
if
(
txnManager
!=
null
&&
!
useAutoCommit
)
{
try
(
DBCSession
session
=
executionContext
.
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Rollback script transaction"
))
{
txnManager
.
rollback
(
session
,
null
);
}
catch
(
DBCException
e1
)
{
...
...
@@ -115,9 +128,9 @@ public abstract class AbstractCommandContext implements DBECommandContext {
}
throw
e
;
}
finally
{
if
(
txnManager
!=
null
&&
oldAutoCommit
)
{
if
(
txnManager
!=
null
&&
oldAutoCommit
!=
useAutoCommit
)
{
try
{
txnManager
.
setAutoCommit
(
monitor
,
true
);
txnManager
.
setAutoCommit
(
monitor
,
oldAutoCommit
);
}
catch
(
DBCException
e
)
{
log
.
warn
(
"Can't switch back to auto-commit mode"
,
e
);
}
...
...
@@ -128,13 +141,6 @@ public abstract class AbstractCommandContext implements DBECommandContext {
private
void
executeCommands
(
DBRProgressMonitor
monitor
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
List
<
CommandQueue
>
commandQueues
=
getCommandQueues
();
// Validate commands
for
(
CommandQueue
queue
:
commandQueues
)
{
for
(
CommandInfo
cmd
:
queue
.
commands
)
{
cmd
.
command
.
validateCommand
();
}
}
// Execute commands
List
<
CommandInfo
>
executedCommands
=
new
ArrayList
<>();
try
{
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/edit/DBECommandAbstract.java
浏览文件 @
7bc36ec2
...
...
@@ -56,7 +56,7 @@ public class DBECommandAbstract<OBJECT_TYPE extends DBPObject> implements DBECom
}
@Override
public
void
validateCommand
()
throws
DBException
public
void
validateCommand
(
Map
<
String
,
Object
>
options
)
throws
DBException
{
// do nothing by default
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/SQLObjectEditor.java
浏览文件 @
7bc36ec2
...
...
@@ -161,7 +161,7 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject, CONTAINER_T
}
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
...
...
@@ -266,9 +266,9 @@ public abstract class SQLObjectEditor<OBJECT_TYPE extends DBSObject, CONTAINER_T
}
@Override
public
void
validateCommand
()
throws
DBException
public
void
validateCommand
(
Map
<
String
,
Object
>
options
)
throws
DBException
{
validateObjectProperties
(
this
);
validateObjectProperties
(
this
,
options
);
}
@Override
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/struct/SQLTableColumnManager.java
浏览文件 @
7bc36ec2
...
...
@@ -217,7 +217,7 @@ public abstract class SQLTableColumnManager<OBJECT_TYPE extends JDBCTableColumn<
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/sql/edit/struct/SQLTriggerManager.java
浏览文件 @
7bc36ec2
...
...
@@ -45,7 +45,7 @@ public abstract class SQLTriggerManager<OBJECT_TYPE extends DBSTrigger, CONTAINE
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/struct/DBSInstanceLazy.java
0 → 100644
浏览文件 @
7bc36ec2
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2017 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.model.struct
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
/**
* Instance with lazy initialization
*/
public
interface
DBSInstanceLazy
extends
DBSInstance
{
/**
* Check instance connection
*/
void
checkInstanceConnection
(
@NotNull
DBRProgressMonitor
monitor
)
throws
DBException
;
}
plugins/org.jkiss.dbeaver.ui.editors.base/src/org/jkiss/dbeaver/ui/editors/DatabaseEditorInput.java
浏览文件 @
7bc36ec2
...
...
@@ -22,6 +22,7 @@ import org.eclipse.ui.IPersistableElement;
import
org.eclipse.ui.model.IWorkbenchAdapter
;
import
org.eclipse.ui.model.WorkbenchAdapter
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.IDataSourceContainerProvider
;
...
...
@@ -30,6 +31,8 @@ import org.jkiss.dbeaver.model.exec.DBCExecutionContext;
import
org.jkiss.dbeaver.model.navigator.DBNDataSource
;
import
org.jkiss.dbeaver.model.navigator.DBNDatabaseNode
;
import
org.jkiss.dbeaver.model.preferences.DBPPropertySource
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSInstanceLazy
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.runtime.DBWorkbench
;
import
org.jkiss.dbeaver.runtime.properties.PropertySourceEditable
;
...
...
@@ -45,6 +48,8 @@ import java.util.Map;
*/
public
abstract
class
DatabaseEditorInput
<
NODE
extends
DBNDatabaseNode
>
implements
IPersistableElement
,
IDatabaseEditorInput
,
IDataSourceContainerProvider
{
private
static
final
Log
log
=
Log
.
getLog
(
DatabaseEditorInput
.
class
);
private
final
NODE
node
;
private
final
DBCExecutionContext
executionContext
;
private
final
DBECommandContext
commandContext
;
...
...
@@ -63,6 +68,9 @@ public abstract class DatabaseEditorInput<NODE extends DBNDatabaseNode> implemen
DBSObject
object
=
node
==
null
?
null
:
node
.
getObject
();
if
(
object
!=
null
)
{
this
.
executionContext
=
DBUtils
.
getDefaultContext
(
object
,
false
);
if
(
this
.
executionContext
==
null
)
{
log
.
error
(
"Database object is not associated with any execution context"
);
}
this
.
commandContext
=
commandContext
!=
null
?
commandContext
:
new
SimpleCommandContext
(
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/editors/entity/EntityEditor.java
浏览文件 @
7bc36ec2
...
...
@@ -428,10 +428,11 @@ public class EntityEditor extends MultiPageDatabaseEditor
saveInProgress
=
true
;
UIUtils
.
runInProgressService
(
monitor
->
{
monitor
.
beginTask
(
"Generate SQL script"
,
commands
.
size
());
Map
<
String
,
Object
>
validateOptions
=
new
HashMap
<>();
for
(
DBECommand
command
:
commands
)
{
monitor
.
subTask
(
command
.
getTitle
());
try
{
command
.
validateCommand
();
command
.
validateCommand
(
validateOptions
);
}
catch
(
final
DBException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/actions/NavigatorHandlerObjectOpen.java
浏览文件 @
7bc36ec2
...
...
@@ -34,12 +34,16 @@ import org.jkiss.code.NotNull;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ModelPreferences
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.edit.DBEObjectEditor
;
import
org.jkiss.dbeaver.model.navigator.*
;
import
org.jkiss.dbeaver.model.struct.DBSInstanceLazy
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.dbeaver.runtime.DBWorkbench
;
import
org.jkiss.dbeaver.runtime.TasksJob
;
import
org.jkiss.dbeaver.runtime.ui.UIServiceConnections
;
import
org.jkiss.dbeaver.runtime.ui.UIServiceSQL
;
import
org.jkiss.dbeaver.ui.IRefreshablePart
;
...
...
@@ -180,13 +184,30 @@ public class NavigatorHandlerObjectOpen extends NavigatorHandlerObjectBase imple
objectNode
.
getMeta
().
getEditorId
());
}
else
if
(
selectedNode
instanceof
DBNDatabaseNode
)
{
DBNDatabaseNode
dnNode
=
(
DBNDatabaseNode
)
selectedNode
;
if
(
dnNode
.
getObject
()
!=
null
)
{
if
(!
dnNode
.
getObject
().
isPersisted
())
{
DBSObject
databaseObject
=
dnNode
.
getObject
();
if
(
databaseObject
!=
null
)
{
if
(!
databaseObject
.
isPersisted
())
{
return
null
;
}
if
(
DBUtils
.
getDefaultContext
(
databaseObject
,
false
)
==
null
)
{
// Not connected - try to connect
if
(
databaseObject
instanceof
DBSInstanceLazy
)
{
if
(!
RuntimeUtils
.
runTask
(
monitor
->
{
try
{
((
DBSInstanceLazy
)
databaseObject
).
checkInstanceConnection
(
monitor
);
}
catch
(
DBException
e
)
{
throw
new
InvocationTargetException
(
e
);
}
},
"Initiate instance connection"
,
dnNode
.
getDataSourceContainer
().
getPreferenceStore
().
getInt
(
ModelPreferences
.
CONNECTION_OPEN_TIMEOUT
)))
{
return
null
;
}
}
//
}
DatabaseNodeEditorInput
editorInput
=
new
DatabaseNodeEditorInput
(
dnNode
);
if
(
DBWorkbench
.
getPlatform
().
getPreferenceStore
().
getBoolean
(
NavigatorPreferences
.
NAVIGATOR_REFRESH_EDITORS_ON_OPEN
))
{
if
(
d
nNode
.
getObject
()
instanceof
DBSObjectContainer
)
{
if
(
d
atabaseObject
instanceof
DBSObjectContainer
)
{
// do not auto-refresh object containers (too expensive)
}
else
{
refreshDatabaseNode
(
dnNode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录