Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
8ded5a4c
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,发现更多精彩内容 >>
提交
8ded5a4c
编写于
12月 21, 2017
作者:
E
Evgeny Fradkin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#2640 Initial Oracle queues support
Former-commit-id:
b3f322eb
上级
20ddcf2f
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
237 addition
and
1 deletion
+237
-1
plugins/org.jkiss.dbeaver.ext.oracle/OSGI-INF/l10n/bundle.properties
....jkiss.dbeaver.ext.oracle/OSGI-INF/l10n/bundle.properties
+13
-0
plugins/org.jkiss.dbeaver.ext.oracle/plugin.xml
plugins/org.jkiss.dbeaver.ext.oracle/plugin.xml
+4
-0
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
...org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
+80
-0
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleObjectType.java
.../org/jkiss/dbeaver/ext/oracle/model/OracleObjectType.java
+7
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleQueue.java
...e/src/org/jkiss/dbeaver/ext/oracle/model/OracleQueue.java
+106
-0
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleSchema.java
.../src/org/jkiss/dbeaver/ext/oracle/model/OracleSchema.java
+27
-0
未找到文件。
plugins/org.jkiss.dbeaver.ext.oracle/OSGI-INF/l10n/bundle.properties
浏览文件 @
8ded5a4c
...
...
@@ -39,6 +39,8 @@ tree.views.node.name=Views
tree.view.node.name
=
View
tree.materialized_views.node.name
=
Materialized Views
tree.materialized_view.node.name
=
Materialized View
tree.queues.node.name
=
Queues
tree.queue.node.name
=
Queue
tree.sequences.node.name
=
Sequences
tree.sequence.node.name
=
Sequence
tree.types.node.name
=
Types
...
...
@@ -204,6 +206,17 @@ meta.org.jkiss.dbeaver.ext.oracle.model.OracleProcedureArgument.precision.name=P
meta.org.jkiss.dbeaver.ext.oracle.model.OracleProcedureBase.procedureType.name
=
Procedure Type
meta.org.jkiss.dbeaver.ext.oracle.model.OracleProcedureStandalone.valid.name
=
Valid
meta.org.jkiss.dbeaver.ext.oracle.model.OracleProcedureStandalone.compileActions.name
=
Declaration
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.name.name
=
Queue Name
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.queueTable.name
=
Queue Table
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.qId.name
=
QId
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.queueType.name
=
Queue Type
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.maxRetries.name
=
Max Retries
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.retryDelay.name
=
Retry Delay
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.enqueueEnabled.name
=
Enqueue Enabled
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.dequeueEnabled.name
=
Dequeue Enabled
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.retention.name
=
Retention Name
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.userComment.name
=
User Comment
meta.org.jkiss.dbeaver.ext.oracle.model.OracleQueue.networkName.name
=
Network Name
meta.org.jkiss.dbeaver.ext.oracle.model.OracleRecycledObject.recycledName.name
=
Object name
meta.org.jkiss.dbeaver.ext.oracle.model.OracleRecycledObject.recycledName.description
=
New object name
meta.org.jkiss.dbeaver.ext.oracle.model.OracleRecycledObject.operation.name
=
Operation
...
...
plugins/org.jkiss.dbeaver.ext.oracle/plugin.xml
浏览文件 @
8ded5a4c
...
...
@@ -116,6 +116,10 @@
<items
label=
"%tree.sequence.node.name"
path=
"sequence"
property=
"sequences"
icon=
"#sequence"
>
</items>
</folder>
<folder
type=
"org.jkiss.dbeaver.ext.oracle.model.OracleQueue"
label=
"%tree.queues.node.name"
description=
"Queues"
>
<items
label=
"%tree.queue.node.name"
path=
"queues"
property=
"queues"
>
</items>
</folder>
<folder
type=
"org.jkiss.dbeaver.ext.oracle.model.OracleDataType"
label=
"%tree.types.node.name"
icon=
"#data_types"
description=
"Types"
>
<items
label=
"%tree.type.node.name"
path=
"type"
property=
"dataTypes"
icon=
"#data_type"
>
<folder
type=
"org.jkiss.dbeaver.ext.oracle.model.OracleDataTypeAttribute"
label=
"%tree.attributes.node.name"
icon=
"#attributes"
description=
"Type attributes"
visibleIf=
"object.hasAttributes()"
>
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/edit/OracleQueueManager.java
0 → 100644
浏览文件 @
8ded5a4c
package
org.jkiss.dbeaver.ext.oracle.edit
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.ext.oracle.model.OracleQueue
;
import
org.jkiss.dbeaver.ext.oracle.model.OracleSchema
;
import
org.jkiss.dbeaver.model.edit.DBECommandContext
;
import
org.jkiss.dbeaver.model.edit.DBEPersistAction
;
import
org.jkiss.dbeaver.model.impl.DBSObjectCache
;
import
org.jkiss.dbeaver.model.impl.sql.edit.SQLObjectEditor
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSEntityType
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.ui.UITask
;
import
org.jkiss.dbeaver.ui.editors.object.struct.EntityEditPage
;
import
org.jkiss.utils.CommonUtils
;
import
java.util.List
;
import
java.util.Map
;
public
class
OracleQueueManager
extends
SQLObjectEditor
<
OracleQueue
,
OracleSchema
>
{
@Override
public
long
getMakerOptions
()
{
return
FEATURE_EDITOR_ON_CREATE
;
}
@Override
protected
void
validateObjectProperties
(
ObjectChangeCommand
command
)
throws
DBException
{
if
(
CommonUtils
.
isEmpty
(
command
.
getObject
().
getName
()))
{
throw
new
DBException
(
"Queue name cannot be empty"
);
}
}
@Nullable
@Override
public
DBSObjectCache
<?
extends
DBSObject
,
OracleQueue
>
getObjectsCache
(
OracleQueue
object
)
{
return
object
.
getSchema
().
queueCache
;
}
@Override
protected
OracleQueue
createDatabaseObject
(
DBRProgressMonitor
monitor
,
DBECommandContext
context
,
final
OracleSchema
schema
,
Object
copyFrom
)
{
return
new
UITask
<
OracleQueue
>()
{
@Override
protected
OracleQueue
runTask
()
{
EntityEditPage
page
=
new
EntityEditPage
(
schema
.
getDataSource
(),
DBSEntityType
.
SEQUENCE
);
if
(!
page
.
edit
())
{
return
null
;
}
final
OracleQueue
queue
=
new
OracleQueue
(
schema
,
page
.
getEntityName
());
return
queue
;
}
}.
execute
();
}
@Override
protected
void
addObjectCreateActions
(
List
<
DBEPersistAction
>
actions
,
ObjectCreateCommand
command
,
Map
<
String
,
Object
>
options
)
{
}
@Override
protected
void
addObjectModifyActions
(
List
<
DBEPersistAction
>
actionList
,
ObjectChangeCommand
command
,
Map
<
String
,
Object
>
options
)
{
}
@Override
protected
void
addObjectDeleteActions
(
List
<
DBEPersistAction
>
actions
,
ObjectDeleteCommand
command
,
Map
<
String
,
Object
>
options
)
{
}
}
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleObjectType.java
浏览文件 @
8ded5a4c
...
...
@@ -92,7 +92,13 @@ public enum OracleObjectType implements DBSObjectType {
}
}),
PROGRAM
(
"PROGRAM"
,
null
,
DBSObject
.
class
,
null
),
QUEUE
(
"QUEUE"
,
null
,
DBSObject
.
class
,
null
),
QUEUE
(
"QUEUE"
,
null
,
OracleQueue
.
class
,
new
ObjectFinder
()
{
@Override
public
OracleQueue
findObject
(
DBRProgressMonitor
monitor
,
OracleSchema
schema
,
String
objectName
)
throws
DBException
{
return
schema
.
queueCache
.
getObject
(
monitor
,
schema
,
objectName
);
}
}),
RULE
(
"RULE"
,
null
,
DBSObject
.
class
,
null
),
RULE_SET
(
"RULE SET"
,
null
,
DBSObject
.
class
,
null
),
SCHEDULE
(
"SCHEDULE"
,
null
,
DBSObject
.
class
,
null
),
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleQueue.java
0 → 100644
浏览文件 @
8ded5a4c
package
org.jkiss.dbeaver.ext.oracle.model
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.impl.DBObjectNameCaseTransformer
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
java.math.BigDecimal
;
import
java.sql.ResultSet
;
/**
* Oracle sequence
*/
public
class
OracleQueue
extends
OracleSchemaObject
{
private
static
final
Log
log
=
Log
.
getLog
(
OracleQueue
.
class
);
public
static
enum
QueueType
{
NORMAL_QUEUE
,
EXCEPTION_QUEUE
};
private
String
queueTable
;
private
int
qId
;
private
QueueType
queueType
;
private
Integer
maxRetries
;
private
Integer
retryDelay
;
private
String
enqueueEnabled
;
private
String
dequeueEnabled
;
private
String
retention
;
private
String
userComment
;
private
String
networkName
;
public
OracleQueue
(
OracleSchema
schema
,
String
name
)
{
super
(
schema
,
name
,
false
);
}
public
OracleQueue
(
OracleSchema
schema
,
ResultSet
dbResult
)
{
super
(
schema
,
JDBCUtils
.
safeGetString
(
dbResult
,
"NAME"
),
true
);
this
.
queueTable
=
JDBCUtils
.
safeGetString
(
dbResult
,
"QUEUE_TABLE"
);
this
.
queueType
=
QueueType
.
valueOf
(
JDBCUtils
.
safeGetString
(
dbResult
,
"QUEUE_TYPE"
));
this
.
maxRetries
=
JDBCUtils
.
safeGetInteger
(
dbResult
,
"MAX_RETRIES"
);
this
.
retryDelay
=
JDBCUtils
.
safeGetInteger
(
dbResult
,
"RETRY_DELAY"
);
this
.
qId
=
JDBCUtils
.
safeGetInt
(
dbResult
,
"QID"
);
this
.
enqueueEnabled
=
JDBCUtils
.
safeGetString
(
dbResult
,
"ENQUEUE_ENABLED"
);
this
.
dequeueEnabled
=
JDBCUtils
.
safeGetString
(
dbResult
,
"DEQUEUE_ENABLED"
);
this
.
retention
=
JDBCUtils
.
safeGetString
(
dbResult
,
"RETENTION"
);
this
.
userComment
=
JDBCUtils
.
safeGetString
(
dbResult
,
"USER_COMMENT"
);
this
.
networkName
=
JDBCUtils
.
safeGetString
(
dbResult
,
"NETWORK_NAME"
);
}
@NotNull
@Property
(
viewable
=
true
,
order
=
2
)
public
OracleTableBase
getQueueTable
(
DBRProgressMonitor
monitor
)
throws
DBException
{
return
this
.
parent
.
tableCache
.
getObject
(
monitor
,
parent
,
queueTable
);
}
@NotNull
@Property
(
viewable
=
true
,
order
=
3
)
public
int
getQId
()
{
return
qId
;
}
@Property
(
viewable
=
true
,
order
=
4
)
public
QueueType
getQueueType
()
{
return
queueType
;
}
@Property
(
viewable
=
true
,
order
=
5
)
public
Integer
getMaxRetries
()
{
return
maxRetries
;
}
@Property
(
viewable
=
true
,
order
=
6
)
public
Integer
getRetryDelay
()
{
return
retryDelay
;
}
@Property
(
viewable
=
true
,
order
=
7
)
public
String
getEnqueueEnabled
()
{
return
enqueueEnabled
;
}
@Property
(
viewable
=
true
,
order
=
8
)
public
String
getDequeueEnabled
()
{
return
dequeueEnabled
;
}
@Property
(
viewable
=
true
,
order
=
9
)
public
String
getRetention
()
{
return
retention
;
}
@Property
(
viewable
=
true
,
order
=
10
)
public
String
getUserComment
()
{
return
userComment
;
}
@Property
(
viewable
=
true
,
order
=
11
)
public
String
getNetworkName
()
{
return
networkName
;
}
}
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleSchema.java
浏览文件 @
8ded5a4c
...
...
@@ -61,6 +61,7 @@ public class OracleSchema extends OracleGlobalObject implements DBSSchema, DBPRe
final
public
IndexCache
indexCache
=
new
IndexCache
();
final
public
DataTypeCache
dataTypeCache
=
new
DataTypeCache
();
final
public
SequenceCache
sequenceCache
=
new
SequenceCache
();
final
public
QueueCache
queueCache
=
new
QueueCache
();
final
public
PackageCache
packageCache
=
new
PackageCache
();
final
public
SynonymCache
synonymCache
=
new
SynonymCache
();
final
public
DBLinkCache
dbLinkCache
=
new
DBLinkCache
();
...
...
@@ -210,6 +211,13 @@ public class OracleSchema extends OracleGlobalObject implements DBSSchema, DBPRe
}
}
@Association
public
Collection
<
OracleQueue
>
getQueues
(
DBRProgressMonitor
monitor
)
throws
DBException
{
return
queueCache
.
getAllObjects
(
monitor
,
this
);
}
@Association
public
Collection
<
OracleSequence
>
getSequences
(
DBRProgressMonitor
monitor
)
throws
DBException
...
...
@@ -741,6 +749,25 @@ public class OracleSchema extends OracleGlobalObject implements DBSSchema, DBPRe
}
}
/**
* Queue cache implementation
*/
static
class
QueueCache
extends
JDBCObjectCache
<
OracleSchema
,
OracleQueue
>
{
@Override
protected
JDBCStatement
prepareObjectsStatement
(
@NotNull
JDBCSession
session
,
@NotNull
OracleSchema
owner
)
throws
SQLException
{
final
JDBCPreparedStatement
dbStat
=
session
.
prepareStatement
(
"SELECT "
+
OracleUtils
.
getSysCatalogHint
(
owner
.
getDataSource
())
+
" * FROM SYS.USER_QUEUES ORDER BY NAME"
);
return
dbStat
;
}
@Override
protected
OracleQueue
fetchObject
(
@NotNull
JDBCSession
session
,
@NotNull
OracleSchema
owner
,
@NotNull
JDBCResultSet
resultSet
)
throws
SQLException
,
DBException
{
return
new
OracleQueue
(
owner
,
resultSet
);
}
}
/**
* Procedures cache implementation
*/
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录