Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
6bcd1a3f
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,发现更多精彩内容 >>
提交
6bcd1a3f
编写于
4月 14, 2020
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
dbeaver/dbeaver#342 Data comparator
上级
978f1e08
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
34 addition
and
17 deletion
+34
-17
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDRowIdentifier.java
...el/src/org/jkiss/dbeaver/model/data/DBDRowIdentifier.java
+7
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
...g/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
+11
-0
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetPersister.java
...iss/dbeaver/ui/controls/resultset/ResultSetPersister.java
+4
-15
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
...org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
+2
-2
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
...ntrols/resultset/spreadsheet/SpreadsheetPresentation.java
+10
-0
未找到文件。
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/data/DBDRowIdentifier.java
浏览文件 @
6bcd1a3f
...
...
@@ -33,6 +33,7 @@ import java.util.ArrayList;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* Row identifier.
...
...
@@ -105,4 +106,10 @@ public class DBDRowIdentifier implements DBPObject {
public
void
clearAttributes
()
{
attributes
.
clear
();
}
@Override
public
String
toString
()
{
return
entity
.
getName
()
+
"."
+
entityIdentifier
.
getName
()
+
"("
+
attributes
.
stream
().
map
(
DBDAttributeBinding:
:
getName
).
collect
(
Collectors
.
joining
(
","
))
+
")"
;
}
}
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetModel.java
浏览文件 @
6bcd1a3f
...
...
@@ -279,6 +279,17 @@ public class ResultSetModel {
return
null
;
}
@Nullable
public
DBDRowIdentifier
getDefaultRowIdentifier
()
{
for
(
DBDAttributeBinding
column
:
attributes
)
{
DBDRowIdentifier
rowIdentifier
=
column
.
getRowIdentifier
();
if
(
rowIdentifier
!=
null
)
{
return
rowIdentifier
;
}
}
return
null
;
}
void
refreshValueHandlersConfiguration
()
{
for
(
DBDAttributeBinding
binding
:
attributes
)
{
DBDValueHandler
valueHandler
=
binding
.
getValueHandler
();
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetPersister.java
浏览文件 @
6bcd1a3f
...
...
@@ -188,7 +188,7 @@ class ResultSetPersister {
// Nothing to refresh
return
false
;
}
final
DBDRowIdentifier
rowIdentifier
=
getDefaultRowIdentifier
();
final
DBDRowIdentifier
rowIdentifier
=
model
.
getDefaultRowIdentifier
();
if
(
rowIdentifier
==
null
||
rowIdentifier
.
getAttributes
().
isEmpty
())
{
// No key - can't refresh
return
false
;
...
...
@@ -256,7 +256,7 @@ class ResultSetPersister {
private
void
prepareDeleteStatements
(
@NotNull
DBRProgressMonitor
monitor
,
boolean
deleteCascade
,
boolean
deepCascade
)
throws
DBException
{
// Make delete statements
DBDRowIdentifier
rowIdentifier
=
getDefaultRowIdentifier
();
DBDRowIdentifier
rowIdentifier
=
model
.
getDefaultRowIdentifier
();
if
(
rowIdentifier
==
null
)
{
throw
new
DBCException
(
"Internal error: can't find entity identifier, delete is not possible"
);
}
...
...
@@ -497,17 +497,6 @@ class ResultSetPersister {
}
}
@Nullable
public
DBDRowIdentifier
getDefaultRowIdentifier
()
{
for
(
DBDAttributeBinding
column
:
columns
)
{
DBDRowIdentifier
rowIdentifier
=
column
.
getRowIdentifier
();
if
(
rowIdentifier
!=
null
)
{
return
rowIdentifier
;
}
}
return
null
;
}
@NotNull
private
DBSDataManipulator
getDataManipulator
(
DBSEntity
entity
)
throws
DBCException
{
if
(
entity
instanceof
DBSDataManipulator
)
{
...
...
@@ -550,7 +539,7 @@ class ResultSetPersister {
List
<
DBDAttributeBinding
>
updatedAttributes
=
this
.
getUpdatedAttributes
();
if
(
this
.
hasDeletes
())
{
DBDRowIdentifier
defIdentifier
=
this
.
getDefaultRowIdentifier
();
DBDRowIdentifier
defIdentifier
=
model
.
getDefaultRowIdentifier
();
if
(
defIdentifier
==
null
)
{
throw
new
DBCException
(
"No unique row identifier is result set. Cannot proceed with row(s) delete."
);
}
else
if
(!
defIdentifier
.
isValidIdentifier
())
{
...
...
@@ -584,7 +573,7 @@ class ResultSetPersister {
private
DBCSavepoint
savepoint
;
private
Throwable
error
;
protected
DataUpdaterJob
(
boolean
generateScript
,
@NotNull
ResultSetSaveSettings
settings
,
@Nullable
DataUpdateListener
listener
,
@NotNull
DBCExecutionContext
executionContext
)
{
DataUpdaterJob
(
boolean
generateScript
,
@NotNull
ResultSetSaveSettings
settings
,
@Nullable
DataUpdateListener
listener
,
@NotNull
DBCExecutionContext
executionContext
)
{
super
(
ResultSetMessages
.
controls_resultset_viewer_job_update
,
executionContext
);
this
.
generateScript
=
generateScript
;
this
.
settings
=
settings
;
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/ResultSetRow.java
浏览文件 @
6bcd1a3f
...
...
@@ -108,14 +108,14 @@ public class ResultSetRow {
return
changes
!=
null
&&
changes
.
containsKey
(
attr
);
}
void
addChange
(
DBDAttributeBinding
attr
,
@Nullable
Object
oldValue
)
{
public
void
addChange
(
DBDAttributeBinding
attr
,
@Nullable
Object
oldValue
)
{
if
(
changes
==
null
)
{
changes
=
new
IdentityHashMap
<>();
}
changes
.
put
(
attr
,
oldValue
);
}
void
resetChange
(
DBDAttributeBinding
attr
)
{
public
void
resetChange
(
DBDAttributeBinding
attr
)
{
assert
changes
!=
null
;
changes
.
remove
(
attr
);
if
(
changes
.
isEmpty
())
{
...
...
plugins/org.jkiss.dbeaver.ui.editors.data/src/org/jkiss/dbeaver/ui/controls/resultset/spreadsheet/SpreadsheetPresentation.java
浏览文件 @
6bcd1a3f
...
...
@@ -1815,6 +1815,16 @@ public class SpreadsheetPresentation extends AbstractPresentation implements IRe
}
}
switch
(
row
.
getState
())
{
case
ResultSetRow
.
STATE_ADDED
:
return
backgroundAdded
;
case
ResultSetRow
.
STATE_REMOVED
:
return
backgroundDeleted
;
}
if
(
row
.
changes
!=
null
&&
row
.
changes
.
containsKey
(
attribute
))
{
return
backgroundModified
;
}
Color
bg
=
controller
.
getLabelProvider
().
getCellBackground
(
attribute
,
row
);
if
(
bg
!=
null
)
{
return
bg
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录