Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
5f842c47
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
5f842c47
编写于
7月 21, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
LOB editors fixed.
Oracle XML tables edit support.
上级
063230f3
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
58 addition
and
62 deletion
+58
-62
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleTable.java
...e/src/org/jkiss/dbeaver/ext/oracle/model/OracleTable.java
+27
-23
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentBLOB.java
...g/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentBLOB.java
+6
-8
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentCLOB.java
...g/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentCLOB.java
+7
-9
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentXML.java
...rg/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentXML.java
+13
-20
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCRowId.java
...src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCRowId.java
+3
-0
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
...c/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
+2
-2
未找到文件。
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleTable.java
浏览文件 @
5f842c47
...
...
@@ -18,6 +18,7 @@
package
org.jkiss.dbeaver.ext.oracle.model
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.model.data.DBDPseudoAttribute
;
import
org.jkiss.dbeaver.model.data.DBDPseudoAttributeContainer
;
...
...
@@ -43,7 +44,7 @@ public class OracleTable extends OracleTablePhysical implements DBDPseudoAttribu
private
boolean
temporary
;
private
boolean
secondary
;
private
boolean
nested
;
private
OracleTableColumn
objectValueAttribute
;
//
private OracleTableColumn objectValueAttribute;
public
static
class
AdditionalInfo
extends
TableAdditionalInfo
{
}
...
...
@@ -134,27 +135,23 @@ public class OracleTable extends OracleTablePhysical implements DBDPseudoAttribu
public
OracleTableColumn
getAttribute
(
DBRProgressMonitor
monitor
,
String
attributeName
)
throws
DBException
{
// Fake XML attribute handle
if
(
tableType
!=
null
&&
tableType
.
getName
().
equals
(
OracleConstants
.
TYPE_NAME_XML
)
&&
OracleConstants
.
XML_COLUMN_NAME
.
equals
(
attributeName
))
{
/*
for (OracleTableColumn col : CommonUtils.safeCollection(getAttributes(monitor))) {
if (col.getType() == tableType) {
return col;
}
}
*/
if
(
objectValueAttribute
==
null
)
{
objectValueAttribute
=
new
OracleTableColumn
(
this
);
objectValueAttribute
.
setName
(
OracleConstants
.
OBJECT_VALUE_COLUMN_NAME
);
objectValueAttribute
.
setTypeName
(
tableType
.
getTypeName
());
objectValueAttribute
.
setType
(
tableType
);
objectValueAttribute
.
setOrdinalPosition
(
1
);
}
return
objectValueAttribute
;
OracleTableColumn
col
=
getXMLColumn
(
monitor
);
if
(
col
!=
null
)
return
col
;
}
return
super
.
getAttribute
(
monitor
,
attributeName
);
}
@Nullable
private
OracleTableColumn
getXMLColumn
(
DBRProgressMonitor
monitor
)
throws
DBException
{
for
(
OracleTableColumn
col
:
CommonUtils
.
safeCollection
(
getAttributes
(
monitor
)))
{
if
(
col
.
getType
()
==
tableType
)
{
return
col
;
}
}
return
null
;
}
@Override
public
Collection
<
OracleTableForeignKey
>
getReferences
(
DBRProgressMonitor
monitor
)
...
...
@@ -204,14 +201,21 @@ public class OracleTable extends OracleTablePhysical implements DBDPseudoAttribu
}
@Override
protected
void
appendSelectSource
(
StringBuilder
query
,
String
tableAlias
,
DBDPseudoAttribute
rowIdAttribute
)
{
protected
void
appendSelectSource
(
DBRProgressMonitor
monitor
,
StringBuilder
query
,
String
tableAlias
,
DBDPseudoAttribute
rowIdAttribute
)
{
if
(
tableType
!=
null
&&
tableType
.
getName
().
equals
(
OracleConstants
.
TYPE_NAME_XML
))
{
query
.
append
(
"XMLType(value("
).
append
(
tableAlias
).
append
(
").getClobval()) as XML"
);
if
(
rowIdAttribute
!=
null
)
{
query
.
append
(
","
).
append
(
rowIdAttribute
.
translateExpression
(
tableAlias
));
try
{
OracleTableColumn
xmlColumn
=
getXMLColumn
(
monitor
);
if
(
xmlColumn
!=
null
)
{
query
.
append
(
"XMLType("
).
append
(
tableAlias
).
append
(
"."
).
append
(
xmlColumn
.
getName
()).
append
(
".getClobval()) as "
).
append
(
xmlColumn
.
getName
());
if
(
rowIdAttribute
!=
null
)
{
query
.
append
(
","
).
append
(
rowIdAttribute
.
translateExpression
(
tableAlias
));
}
return
;
}
}
catch
(
DBException
e
)
{
log
.
warn
(
e
);
}
}
else
{
super
.
appendSelectSource
(
query
,
tableAlias
,
rowIdAttribute
);
}
super
.
appendSelectSource
(
monitor
,
query
,
tableAlias
,
rowIdAttribute
);
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentBLOB.java
浏览文件 @
5f842c47
...
...
@@ -116,13 +116,7 @@ public class JDBCContentBLOB extends JDBCContentLOB {
this
.
storage
=
new
TemporaryContentStorage
(
application
,
tempFile
);
}
// Free blob - we don't need it anymore
try
{
blob
.
free
();
}
catch
(
Throwable
e
)
{
log
.
debug
(
e
);
}
finally
{
blob
=
null
;
}
releaseBlob
();
}
return
storage
;
}
...
...
@@ -131,6 +125,11 @@ public class JDBCContentBLOB extends JDBCContentLOB {
public
void
release
()
{
releaseTempStream
();
releaseBlob
();
super
.
release
();
}
private
void
releaseBlob
()
{
if
(
blob
!=
null
)
{
try
{
blob
.
free
();
...
...
@@ -139,7 +138,6 @@ public class JDBCContentBLOB extends JDBCContentLOB {
}
blob
=
null
;
}
super
.
release
();
}
private
void
releaseTempStream
()
{
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentCLOB.java
浏览文件 @
5f842c47
...
...
@@ -114,14 +114,8 @@ public class JDBCContentCLOB extends JDBCContentLOB implements DBDContent {
}
this
.
storage
=
new
TemporaryContentStorage
(
application
,
tempFile
);
}
// Free blob - we don't need it anymore
try
{
clob
.
free
();
}
catch
(
Throwable
e
)
{
log
.
debug
(
e
);
}
finally
{
clob
=
null
;
}
// Free lob - we don't need it anymore
releaseClob
();
}
return
storage
;
}
...
...
@@ -130,6 +124,11 @@ public class JDBCContentCLOB extends JDBCContentLOB implements DBDContent {
public
void
release
()
{
releaseTempStream
();
releaseClob
();
super
.
release
();
}
private
void
releaseClob
()
{
if
(
clob
!=
null
)
{
try
{
clob
.
free
();
...
...
@@ -138,7 +137,6 @@ public class JDBCContentCLOB extends JDBCContentLOB implements DBDContent {
}
clob
=
null
;
}
super
.
release
();
}
private
void
releaseTempStream
()
{
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCContentXML.java
浏览文件 @
5f842c47
...
...
@@ -46,7 +46,6 @@ public class JDBCContentXML extends JDBCContentLOB {
static
final
Log
log
=
Log
.
getLog
(
JDBCContentXML
.
class
);
private
SQLXML
xml
;
protected
Reader
tmpReader
;
public
JDBCContentXML
(
DBPDataSource
dataSource
,
SQLXML
xml
)
{
super
(
dataSource
);
...
...
@@ -79,13 +78,7 @@ public class JDBCContentXML extends JDBCContentLOB {
throw
new
DBCException
(
e
,
dataSource
);
}
// Free blob - we don't need it anymore
try
{
xml
.
free
();
}
catch
(
Exception
e
)
{
log
.
warn
(
e
);
}
finally
{
xml
=
null
;
}
releaseXML
();
}
return
storage
;
}
...
...
@@ -93,21 +86,21 @@ public class JDBCContentXML extends JDBCContentLOB {
@Override
public
void
release
()
{
if
(
tmpReader
!=
null
)
{
ContentUtils
.
close
(
tmpReader
);
tmpReader
=
null
;
}
// if (xml != null) {
// try {
// xml.free();
// } catch (Exception e) {
// log.warn(e);
// }
// xml = null;
// }
releaseXML
();
super
.
release
();
}
private
void
releaseXML
()
{
if
(
xml
!=
null
)
{
try
{
xml
.
free
();
}
catch
(
Exception
e
)
{
log
.
warn
(
e
);
}
xml
=
null
;
}
}
@Override
public
void
bindParameter
(
JDBCSession
session
,
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/data/JDBCRowId.java
浏览文件 @
5f842c47
...
...
@@ -62,6 +62,9 @@ public class JDBCRowId implements DBDValue {
@Override
public
String
toString
()
{
if
(
value
==
null
)
{
return
"null"
;
}
return
new
String
(
value
.
getBytes
());
}
}
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/struct/JDBCTable.java
浏览文件 @
5f842c47
...
...
@@ -142,7 +142,7 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
StringBuilder
query
=
new
StringBuilder
(
100
);
query
.
append
(
"SELECT "
);
appendSelectSource
(
query
,
tableAlias
,
rowIdAttribute
);
appendSelectSource
(
session
.
getProgressMonitor
(),
query
,
tableAlias
,
rowIdAttribute
);
query
.
append
(
" FROM "
).
append
(
getFullQualifiedName
());
if
(
tableAlias
!=
null
)
{
query
.
append
(
" "
).
append
(
tableAlias
);
//$NON-NLS-1$
...
...
@@ -238,7 +238,7 @@ public abstract class JDBCTable<DATASOURCE extends DBPDataSource, CONTAINER exte
}
}
protected
void
appendSelectSource
(
StringBuilder
query
,
String
tableAlias
,
DBDPseudoAttribute
rowIdAttribute
)
{
protected
void
appendSelectSource
(
DBRProgressMonitor
monitor
,
StringBuilder
query
,
String
tableAlias
,
DBDPseudoAttribute
rowIdAttribute
)
{
if
(
rowIdAttribute
!=
null
)
{
// If we have pseudo attributes then query gonna be more complex
query
.
append
(
tableAlias
).
append
(
".*"
);
//$NON-NLS-1$
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录