Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
54d0ad1d
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,发现更多精彩内容 >>
提交
54d0ad1d
编写于
1月 25, 2013
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Data container refactoring
Former-commit-id:
845129ed
上级
034fdea3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
18 addition
and
24 deletion
+18
-24
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
...c/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
+13
-19
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
.../src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/data/wizard/DataExportJob.java
...rc/org/jkiss/dbeaver/tools/data/wizard/DataExportJob.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
...c/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
+1
-1
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
....core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
+1
-1
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIClass.java
...ver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIClass.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
浏览文件 @
54d0ad1d
...
...
@@ -31,9 +31,6 @@ import org.jkiss.dbeaver.model.data.DBDDataReceiver;
import
org.jkiss.dbeaver.model.data.DBDValueHandler
;
import
org.jkiss.dbeaver.model.data.query.DBQOrderColumn
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCStatement
;
import
org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer
;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCStructCache
;
import
org.jkiss.dbeaver.model.impl.struct.AbstractTable
;
...
...
@@ -43,7 +40,6 @@ import org.jkiss.dbeaver.model.struct.DBSDataContainer;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.utils.CommonUtils
;
import
java.sql.SQLException
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -101,9 +97,6 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
public
long
readData
(
DBCExecutionContext
context
,
DBDDataReceiver
dataReceiver
,
DBDDataFilter
dataFilter
,
long
firstRow
,
long
maxRows
)
throws
DBException
{
if
(!(
context
instanceof
JDBCExecutionContext
))
{
throw
new
IllegalArgumentException
(
"Bad execution context"
);
}
boolean
hasLimits
=
firstRow
>=
0
&&
maxRows
>
0
;
DBRProgressMonitor
monitor
=
context
.
getProgressMonitor
();
...
...
@@ -173,35 +166,36 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
}
@Override
public
long
readDataCount
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
public
long
countData
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
{
if
(!(
context
instanceof
JDBCExecutionContext
))
{
throw
new
IllegalArgumentException
(
"Bad execution context"
);
}
JDBCExecutionContext
jdbcContext
=
(
JDBCExecutionContext
)
context
;
DBRProgressMonitor
monitor
=
context
.
getProgressMonitor
();
StringBuilder
query
=
new
StringBuilder
(
"SELECT COUNT(*) FROM "
);
//$NON-NLS-1$
query
.
append
(
getFullQualifiedName
());
appendQueryConditions
(
query
,
dataFilter
);
monitor
.
subTask
(
CoreMessages
.
model_jdbc_fetch_table_row_count
);
JDBCStatement
dbStat
=
jdbcContext
.
prepareStatement
(
DBCStatementType
.
QUERY
,
query
.
toString
(),
false
,
false
,
false
);
DBCStatement
dbStat
=
context
.
prepareStatement
(
DBCStatementType
.
QUERY
,
query
.
toString
(),
false
,
false
,
false
);
try
{
dbStat
.
setDataContainer
(
this
);
if
(!
dbStat
.
executeStatement
())
{
return
0
;
}
J
DBCResultSet
dbResult
=
dbStat
.
openResultSet
();
DBCResultSet
dbResult
=
dbStat
.
openResultSet
();
if
(
dbResult
==
null
)
{
return
0
;
}
try
{
if
(
dbResult
.
nextRow
())
{
try
{
return
dbResult
.
getLong
(
1
);
}
catch
(
SQLException
e
)
{
throw
new
DBException
(
e
);
Object
result
=
dbResult
.
getColumnValue
(
1
);
if
(
result
==
null
)
{
return
0
;
}
else
if
(
result
instanceof
Number
)
{
return
((
Number
)
result
).
longValue
();
}
else
{
return
Long
.
parseLong
(
result
.
toString
());
}
}
else
{
return
0
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/struct/DBSDataContainer.java
浏览文件 @
54d0ad1d
...
...
@@ -54,7 +54,7 @@ public interface DBSDataContainer extends DBSObject {
long
maxRows
)
throws
DBException
;
long
readDataCount
(
long
countData
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
;
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/tools/data/wizard/DataExportJob.java
浏览文件 @
54d0ad1d
...
...
@@ -349,7 +349,7 @@ public class DataExportJob extends AbstractJob {
long
totalRows
=
0
;
if
(
settings
.
isQueryRowCount
()
&&
(
dataProvider
.
getDataContainer
().
getSupportedFeatures
()
&
DBSDataContainer
.
DATA_COUNT
)
!=
0
)
{
monitor
.
beginTask
(
CoreMessages
.
dialog_export_wizard_job_task_retrieve
,
1
);
totalRows
=
dataProvider
.
getDataContainer
().
readDataCount
(
context
,
dataProvider
.
getDataFilter
());
totalRows
=
dataProvider
.
getDataContainer
().
countData
(
context
,
dataProvider
.
getDataFilter
());
monitor
.
done
();
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/dialogs/data/CursorViewDialog.java
浏览文件 @
54d0ad1d
...
...
@@ -177,7 +177,7 @@ public class CursorViewDialog extends ValueViewDialog implements ResultSetProvid
}
@Override
public
long
readDataCount
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
public
long
countData
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
{
return
-
1
;
}
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/ui/editors/sql/SQLEditor.java
浏览文件 @
54d0ad1d
...
...
@@ -824,7 +824,7 @@ public class SQLEditor extends SQLEditorBase
}
@Override
public
long
readDataCount
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
public
long
countData
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
{
throw
new
DBException
(
"Not Implemented"
);
}
...
...
plugins/org.jkiss.dbeaver.wmi/src/org/jkiss/dbeaver/ext/wmi/model/WMIClass.java
浏览文件 @
54d0ad1d
...
...
@@ -460,7 +460,7 @@ public class WMIClass extends WMIContainer
}
@Override
public
long
readDataCount
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
public
long
countData
(
DBCExecutionContext
context
,
DBDDataFilter
dataFilter
)
throws
DBException
{
throw
new
DBException
(
"Not implemented"
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录