Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
698caa2c
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,发现更多精彩内容 >>
提交
698caa2c
编写于
8月 29, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#6637 Data transfer from custom query results: reuse data container's execution context
Former-commit-id:
6803f7ca
上级
729f1232
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
29 addition
and
13 deletion
+29
-13
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/handlers/OpenSpreadsheetHandler.java
.../dbeaver/data/office/handlers/OpenSpreadsheetHandler.java
+1
-1
plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseTransferProducer.java
...ver/tools/transfer/database/DatabaseTransferProducer.java
+6
-3
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBUtils.java
...ss.dbeaver.model/src/org/jkiss/dbeaver/model/DBUtils.java
+3
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetDataContainer.java
...dbeaver/ui/controls/resultset/ResultSetDataContainer.java
+14
-4
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerCopyAs.java
...dbeaver/ui/controls/resultset/ResultSetHandlerCopyAs.java
+1
-1
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
...s/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
+1
-1
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerOpenWith.java
...eaver/ui/controls/resultset/ResultSetHandlerOpenWith.java
+1
-1
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
.../jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
+2
-2
未找到文件。
plugins/org.jkiss.dbeaver.data.office/src/org/jkiss/dbeaver/data/office/handlers/OpenSpreadsheetHandler.java
浏览文件 @
698caa2c
...
...
@@ -77,7 +77,7 @@ public class OpenSpreadsheetHandler extends AbstractHandler
options
.
setSelectedRows
(
selectedRows
);
options
.
setSelectedColumns
(
selectedAttributes
);
}
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
.
getDataContainer
(),
resultSet
.
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
,
options
);
if
(
dataContainer
.
getDataSource
()
==
null
)
{
DBeaverUI
.
getInstance
().
showError
(
"Open Excel"
,
ModelMessages
.
error_not_connected_to_database
);
return
null
;
...
...
plugins/org.jkiss.dbeaver.data.transfer/src/org/jkiss/dbeaver/tools/transfer/database/DatabaseTransferProducer.java
浏览文件 @
698caa2c
...
...
@@ -128,9 +128,12 @@ public class DatabaseTransferProducer implements IDataTransferProducer<DatabaseP
boolean
newConnection
=
settings
.
isOpenNewConnections
()
&&
!
getDatabaseObject
().
getDataSource
().
getContainer
().
getDriver
().
isEmbedded
();
boolean
forceDataReadTransactions
=
Boolean
.
TRUE
.
equals
(
dataSource
.
getDataSourceFeature
(
DBConstants
.
FEATURE_LOB_REQUIRE_TRANSACTIONS
));
DBCExecutionContext
context
=
!
selectiveExportFromUI
&&
newConnection
?
DBUtils
.
getObjectOwnerInstance
(
getDatabaseObject
()).
openIsolatedContext
(
monitor
,
"Data transfer producer"
)
:
DBUtils
.
getDefaultContext
(
getDatabaseObject
(),
false
);
DBCExecutionContext
context
;
if
(!
selectiveExportFromUI
&&
newConnection
)
{
context
=
DBUtils
.
getObjectOwnerInstance
(
getDatabaseObject
()).
openIsolatedContext
(
monitor
,
"Data transfer producer"
);
}
else
{
context
=
DBUtils
.
getDefaultContext
(
dataContainer
,
false
);
}
try
(
DBCSession
session
=
context
.
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
contextTask
))
{
try
{
AbstractExecutionSource
transferSource
=
new
AbstractExecutionSource
(
dataContainer
,
context
,
consumer
);
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/DBUtils.java
浏览文件 @
698caa2c
...
...
@@ -1811,6 +1811,9 @@ public final class DBUtils {
if
(
object
==
null
)
{
return
null
;
}
if
(
object
instanceof
DBPContextProvider
)
{
return
((
DBPContextProvider
)
object
).
getExecutionContext
();
}
DBSInstance
instance
=
getObjectOwnerInstance
(
object
);
return
instance
==
null
?
null
:
instance
.
getDefaultContext
(
meta
);
}
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetDataContainer.java
浏览文件 @
698caa2c
...
...
@@ -18,7 +18,9 @@ package org.jkiss.dbeaver.ui.controls.resultset;
import
org.eclipse.core.runtime.IAdaptable
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.DBPContextProvider
;
import
org.jkiss.dbeaver.model.DBPDataSource
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.data.DBDAttributeBinding
;
...
...
@@ -38,17 +40,19 @@ import java.util.List;
* Client-side data container.
* Wraps RSV model and original data container.
*/
public
class
ResultSetDataContainer
implements
DBSDataContainer
,
IAdaptable
{
public
class
ResultSetDataContainer
implements
DBSDataContainer
,
DBPContextProvider
,
IAdaptable
{
private
static
final
Log
log
=
Log
.
getLog
(
ResultSetDataContainer
.
class
);
private
final
IResultSetController
controller
;
private
final
DBSDataContainer
dataContainer
;
private
final
ResultSetModel
model
;
private
ResultSetDataContainerOptions
options
;
public
ResultSetDataContainer
(
DBSDataContainer
dataContainer
,
ResultSetModel
model
,
ResultSetDataContainerOptions
options
)
{
this
.
dataContainer
=
dataContainer
;
this
.
model
=
model
;
public
ResultSetDataContainer
(
IResultSetController
controller
,
ResultSetDataContainerOptions
options
)
{
this
.
controller
=
controller
;
this
.
dataContainer
=
controller
.
getDataContainer
();
this
.
model
=
controller
.
getModel
();
this
.
options
=
options
;
}
...
...
@@ -149,6 +153,12 @@ public class ResultSetDataContainer implements DBSDataContainer, IAdaptable {
return
null
;
}
@Nullable
@Override
public
DBCExecutionContext
getExecutionContext
()
{
return
controller
.
getExecutionContext
();
}
private
class
ModelResultSet
implements
DBCResultSet
{
private
final
DBCSession
session
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerCopyAs.java
浏览文件 @
698caa2c
...
...
@@ -112,7 +112,7 @@ public class ResultSetHandlerCopyAs extends AbstractHandler implements IElementU
options
.
setSelectedRows
(
selectedRows
);
options
.
setSelectedColumns
(
selectedAttributes
);
}
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
.
getDataContainer
(),
resultSet
.
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
,
options
);
if
(
dataContainer
.
getDataSource
()
==
null
)
{
DBWorkbench
.
getPlatformUI
().
showError
(
"Copy As "
+
processor
.
getName
(),
ModelMessages
.
error_not_connected_to_database
);
return
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerMain.java
浏览文件 @
698caa2c
...
...
@@ -509,7 +509,7 @@ public class ResultSetHandlerMain extends AbstractHandler {
options
.
setSelectedRows
(
selectedRows
);
options
.
setSelectedColumns
(
selectedAttributes
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
rsv
.
getDataContainer
(),
rsv
.
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
rsv
,
options
);
ActiveWizardDialog
dialog
=
new
ActiveWizardDialog
(
HandlerUtil
.
getActiveWorkbenchWindow
(
event
),
new
DataTransferWizard
(
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetHandlerOpenWith.java
浏览文件 @
698caa2c
...
...
@@ -131,7 +131,7 @@ public class ResultSetHandlerOpenWith extends AbstractHandler implements IElemen
options
.
setSelectedRows
(
selectedRows
);
options
.
setSelectedColumns
(
selectedAttributes
);
}
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
.
getDataContainer
(),
resultSet
.
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
resultSet
,
options
);
if
(
dataContainer
.
getDataSource
()
==
null
)
{
DBWorkbench
.
getPlatformUI
().
showError
(
"Open "
+
processor
.
getAppName
(),
ModelMessages
.
error_not_connected_to_database
);
return
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetViewer.java
浏览文件 @
698caa2c
...
...
@@ -1221,7 +1221,7 @@ public class ResultSetViewer extends Viewer
void
fillOpenWithMenu
(
IContributionManager
openWithMenu
)
{
ResultSetDataContainerOptions
options
=
new
ResultSetDataContainerOptions
();
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
getDataContainer
(),
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
this
,
options
);
List
<
DataTransferProcessorDescriptor
>
appProcessors
=
new
ArrayList
<>();
...
...
@@ -1262,7 +1262,7 @@ public class ResultSetViewer extends Viewer
copyAsMenu
.
add
(
new
Separator
());
ResultSetDataContainerOptions
options
=
new
ResultSetDataContainerOptions
();
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
getDataContainer
(),
getModel
()
,
options
);
ResultSetDataContainer
dataContainer
=
new
ResultSetDataContainer
(
this
,
options
);
List
<
DataTransferProcessorDescriptor
>
appProcessors
=
new
ArrayList
<>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录