Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
20139198
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,发现更多精彩内容 >>
提交
20139198
编写于
11月 30, 2017
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
PostgreSQL inheritance model fix
上级
aadcb6f3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
24 addition
and
41 deletion
+24
-41
nls/bundles/org.jkiss.dbeaver.ext.postgresql.nls/OSGI-INF/l10n/bundle_ru.properties
...ver.ext.postgresql.nls/OSGI-INF/l10n/bundle_ru.properties
+0
-2
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
...ss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
+7
-0
plugins/org.jkiss.dbeaver.ext.postgresql/plugin.xml
plugins/org.jkiss.dbeaver.ext.postgresql/plugin.xml
+5
-9
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
.../org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
+12
-30
未找到文件。
nls/bundles/org.jkiss.dbeaver.ext.postgresql.nls/OSGI-INF/l10n/bundle_ru.properties
浏览文件 @
20139198
...
...
@@ -482,10 +482,8 @@ tree.partition_columns.node.name=Partition columns
tree.partitions.node.name
=
Partitions
tree.tablechildren.node.name
=
Child tables
tree.tablechildren_columns.node.name
=
Child Tables columns
tree.tablechildren.node.name
=
Child tables
tree.rules.node.name
=
Rules
tree.rules_columns.node.name
=
Rules columns
tree.rules.node.name
=
Rules
tree.schema.node.name
=
Schema
tree.schemas.node.name
=
Schemas
tree.sequence.node.name
=
Sequence
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/OSGI-INF/l10n/bundle.properties
浏览文件 @
20139198
...
...
@@ -490,6 +490,13 @@ tree.procedures.node.name=Procedures
tree.reference.node.name
=
Reference
tree.reference_columns.node.name
=
Reference columns
tree.references.node.name
=
References
tree.partition.node.name
=
Partition
tree.partition_columns.node.name
=
Partition columns
tree.partitions.node.name
=
Partitions
tree.tablechildren.node.name
=
Child tables
tree.tablechildren_columns.node.name
=
Child Tables columns
tree.rules.node.name
=
Rules
tree.rules_columns.node.name
=
Rules columns
tree.schema.node.name
=
Schema
tree.schemas.node.name
=
Schemas
tree.sequence.node.name
=
Sequence
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/plugin.xml
浏览文件 @
20139198
...
...
@@ -72,19 +72,15 @@
</items>
</folder>
<folder
type=
"org.jkiss.dbeaver.ext.postgresql.model.PostgreTablePartition"
label=
"%tree.partitions.node.name"
icon=
"#folder_table"
description=
"Table partitions"
virtual=
"true"
>
<items
label=
"%tree.partitions.node.name"
path=
"partition"
property=
"partitions"
icon=
"#partition"
virtual=
"true"
>
<items
label=
"%tree.partitions_columns.node.name"
itemLabel=
"%tree.column.node.name"
path=
"column"
property=
"attributePartitions"
navigable=
"false"
inline=
"true"
virtual=
"true"
>
</items>
<items
label=
"%tree.partitions.node.name"
path=
"partition"
property=
"partitions"
icon=
"#partition"
virtual=
"true"
recursive=
"../.."
>
</items>
</folder>
<folder
type=
"org.jkiss.dbeaver.ext.postgresql.model.PostgreTableChildren"
label=
"%tree.tablechildren.node.name"
icon=
"#folder_table"
description=
"Table children"
virtual=
"true"
>
<items
label=
"%tree.tablechildren.node.name"
path=
"tablechildren"
property=
"tablechildren"
icon=
"#table"
virtual=
"true"
>
<items
label=
"%tree.tablechildren_columns.node.name"
itemLabel=
"%tree.column.node.name"
path=
"column"
property=
"attributeTablechildren"
navigable=
"false"
inline=
"true"
virtual=
"true"
>
</items>
<folder
type=
"org.jkiss.dbeaver.ext.postgresql.model.PostgreTableBase"
label=
"%tree.tablechildren.node.name"
icon=
"#folder_table"
description=
"Table children"
virtual=
"true"
>
<items
label=
"%tree.tablechildren.node.name"
path=
"subTables"
property=
"subTables"
icon=
"#table"
virtual=
"true"
recursive=
"../.."
>
</items>
</folder>
<folder
type=
"org.jkiss.dbeaver.ext.postgresql.model.PostgreTable
Rules
"
label=
"%tree.rules.node.name"
icon=
"#triggers"
description=
"Table rules"
virtual=
"true"
>
<items
label=
"%tree.rules.node.name"
path=
"rules"
property=
"rules"
icon=
"#trigger"
virtual=
"true"
>
<folder
type=
"org.jkiss.dbeaver.ext.postgresql.model.PostgreTable
Base
"
label=
"%tree.rules.node.name"
icon=
"#triggers"
description=
"Table rules"
virtual=
"true"
>
<items
label=
"%tree.rules.node.name"
path=
"rules"
property=
"rules"
icon=
"#trigger"
virtual=
"true"
>
<items
label=
"%tree.rules_columns.node.name"
itemLabel=
"%tree.column.node.name"
path=
"column"
property=
"attributeRules"
navigable=
"false"
inline=
"true"
virtual=
"true"
>
</items>
</items>
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreTable.java
浏览文件 @
20139198
...
...
@@ -51,8 +51,7 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
private
static
final
Log
log
=
Log
.
getLog
(
PostgreTable
.
class
);
private
SimpleObjectCache
<
PostgreTable
,
PostgreTableForeignKey
>
foreignKeys
=
new
SimpleObjectCache
<>();
private
List
<
PostgreTablePartition
>
partitions
=
null
;
private
List
<
PostgreTableBase
>
children
=
null
;
//private List<PostgreTablePartition> partitions = null;
private
boolean
hasOids
;
private
long
tablespaceId
;
...
...
@@ -80,8 +79,7 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
super
(
container
,
source
,
persisted
);
if
(
source
instanceof
PostgreTable
)
{
this
.
hasOids
=
((
PostgreTable
)
source
).
hasOids
;
this
.
partitions
=
((
PostgreTable
)
source
).
partitions
==
null
?
null
:
new
ArrayList
<>(((
PostgreTable
)
source
).
partitions
);
this
.
children
=
((
PostgreTable
)
source
).
children
==
null
?
null
:
new
ArrayList
<>(((
PostgreTable
)
source
).
children
);
//this.partitions = ((PostgreTable) source).partitions == null ? null : new ArrayList<>(((PostgreTable) source).partitions);
}
}
...
...
@@ -244,7 +242,7 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
try
(
JDBCPreparedStatement
dbStat
=
session
.
prepareStatement
(
"SELECT i.*,c.relnamespace "
+
"FROM pg_catalog.pg_inherits i,pg_catalog.pg_class c "
+
"WHERE i.inhparent=? AND c.oid=i.inhrelid"
))
{
"WHERE i.inhparent=? AND c.oid=i.inhrelid
AND c.relispartition=false
"
))
{
dbStat
.
setLong
(
1
,
getObjectId
());
try
(
JDBCResultSet
dbResult
=
dbStat
.
executeQuery
())
{
while
(
dbResult
.
next
())
{
...
...
@@ -281,32 +279,16 @@ public abstract class PostgreTable extends PostgreTableReal implements DBDPseudo
}
return
subTables
;
}
public
Collection
<?
extends
DBSTable
>
getPartitions
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(
partitions
==
null
)
{
partitions
=
new
ArrayList
<>();
for
(
PostgreTableBase
t
:
getSchema
().
tableCache
.
getCachedObjects
())
{
if
(
t
.
isParentOf
(
this
.
getObjectId
())
&&
t
.
isPartition
())
{
partitions
.
add
(
new
PostgreTablePartition
(
t
.
getContainer
(),
t
,
t
.
isPersisted
()));
}
}
}
return
partitions
;
}
public
Collection
<?
extends
DBSTable
>
getTablechildren
(
DBRProgressMonitor
monitor
)
throws
DBException
{
if
(
children
==
null
)
{
children
=
new
ArrayList
<>();
for
(
PostgreTableBase
t
:
getSchema
().
tableCache
.
getCachedObjects
())
{
if
(
t
.
isParentOf
(
this
.
getObjectId
())
&&
!
t
.
isPartition
())
{
children
.
add
(
t
);
}
}
}
return
children
;
@Association
public
Collection
<
PostgreTableBase
>
getPartitions
(
DBRProgressMonitor
monitor
)
throws
DBException
{
List
<
PostgreTableBase
>
partitions
=
new
ArrayList
<>();
for
(
PostgreTableBase
t
:
getSchema
().
tableCache
.
getCachedObjects
())
{
if
(
t
.
isParentOf
(
this
.
getObjectId
())
&&
t
.
isPartition
())
{
partitions
.
add
(
t
);
}
}
return
partitions
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录