Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
d9060711
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,发现更多精彩内容 >>
未验证
提交
d9060711
编写于
6月 30, 2021
作者:
S
ShadelessFox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#12182 Code cleanup
上级
57cca7d7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
19 addition
and
37 deletion
+19
-37
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerStructureAssistant.java
.../dbeaver/ext/mssql/model/SQLServerStructureAssistant.java
+2
-5
plugins/org.jkiss.dbeaver.model.sql/src/org/jkiss/dbeaver/model/sql/SQLSearchUtils.java
...l.sql/src/org/jkiss/dbeaver/model/sql/SQLSearchUtils.java
+2
-3
plugins/org.jkiss.dbeaver.model.sql/src/org/jkiss/dbeaver/model/sql/completion/SQLCompletionAnalyzer.java
...s/dbeaver/model/sql/completion/SQLCompletionAnalyzer.java
+4
-6
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/struct/DBSStructureAssistant.java
...org/jkiss/dbeaver/model/struct/DBSStructureAssistant.java
+4
-13
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLContextInformer.java
...iss/dbeaver/ui/editors/sql/syntax/SQLContextInformer.java
+3
-4
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
.../jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
+2
-3
plugins/org.jkiss.dbeaver.ui.search/src/org/jkiss/dbeaver/ui/search/metadata/SearchMetadataPage.java
.../jkiss/dbeaver/ui/search/metadata/SearchMetadataPage.java
+2
-3
未找到文件。
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerStructureAssistant.java
浏览文件 @
d9060711
...
@@ -30,10 +30,7 @@ import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
...
@@ -30,10 +30,7 @@ import org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils;
import
org.jkiss.dbeaver.model.impl.struct.AbstractObjectReference
;
import
org.jkiss.dbeaver.model.impl.struct.AbstractObjectReference
;
import
org.jkiss.dbeaver.model.impl.struct.RelationalObjectType
;
import
org.jkiss.dbeaver.model.impl.struct.RelationalObjectType
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.*
;
import
org.jkiss.dbeaver.model.struct.DBSObjectReference
;
import
org.jkiss.dbeaver.model.struct.DBSObjectType
;
import
org.jkiss.dbeaver.model.struct.DBSStructureAssistant
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Collections
;
...
@@ -129,7 +126,7 @@ public class SQLServerStructureAssistant implements DBSStructureAssistant<SQLSer
...
@@ -129,7 +126,7 @@ public class SQLServerStructureAssistant implements DBSStructureAssistant<SQLSer
try
(
JDBCSession
session
=
executionContext
.
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Find objects by name"
))
{
try
(
JDBCSession
session
=
executionContext
.
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Find objects by name"
))
{
List
<
DBSObjectReference
>
objects
=
new
ArrayList
<>();
List
<
DBSObjectReference
>
objects
=
new
ArrayList
<>();
if
(
params
.
get
Name
().
startsWith
(
"#"
))
{
if
(
params
.
get
Mask
().
startsWith
(
"%#"
)
||
params
.
getMask
().
startsWith
(
"#"
))
{
// Search temp tables
// Search temp tables
searchTempTables
(
session
,
params
,
objects
);
searchTempTables
(
session
,
params
,
objects
);
}
else
{
}
else
{
...
...
plugins/org.jkiss.dbeaver.model.sql/src/org/jkiss/dbeaver/model/sql/SQLSearchUtils.java
浏览文件 @
d9060711
...
@@ -89,9 +89,8 @@ public class SQLSearchUtils
...
@@ -89,9 +89,8 @@ public class SQLSearchUtils
if
(
structureAssistant
!=
null
)
{
if
(
structureAssistant
!=
null
)
{
String
objectNameMask
=
nameList
.
get
(
0
);
String
objectNameMask
=
nameList
.
get
(
0
);
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
structureAssistant
.
getAutoCompleteObjectTypes
(),
structureAssistant
.
getAutoCompleteObjectTypes
(),
identifierDetector
.
removeQuotes
(
objectNameMask
),
identifierDetector
.
removeQuotes
(
objectNameMask
)
identifierDetector
.
removeQuotes
(
objectNameMask
)
);
);
params
.
setParentObject
(
sc
);
params
.
setParentObject
(
sc
);
params
.
setCaseSensitive
(
identifierDetector
.
isQuoted
(
objectNameMask
));
params
.
setCaseSensitive
(
identifierDetector
.
isQuoted
(
objectNameMask
));
...
...
plugins/org.jkiss.dbeaver.model.sql/src/org/jkiss/dbeaver/model/sql/completion/SQLCompletionAnalyzer.java
浏览文件 @
d9060711
...
@@ -743,9 +743,8 @@ public class SQLCompletionAnalyzer implements DBRRunnableParametrized<DBRProgres
...
@@ -743,9 +743,8 @@ public class SQLCompletionAnalyzer implements DBRRunnableParametrized<DBRProgres
DBSStructureAssistant
structureAssistant
=
DBUtils
.
getAdapter
(
DBSStructureAssistant
.
class
,
sc
);
DBSStructureAssistant
structureAssistant
=
DBUtils
.
getAdapter
(
DBSStructureAssistant
.
class
,
sc
);
if
(
structureAssistant
!=
null
)
{
if
(
structureAssistant
!=
null
)
{
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
structureAssistant
.
getAutoCompleteObjectTypes
(),
structureAssistant
.
getAutoCompleteObjectTypes
(),
request
.
getWordDetector
().
removeQuotes
(
token
),
request
.
getWordDetector
().
removeQuotes
(
token
)
request
.
getWordDetector
().
removeQuotes
(
token
)
);
);
params
.
setCaseSensitive
(
request
.
getWordDetector
().
isQuoted
(
token
));
params
.
setCaseSensitive
(
request
.
getWordDetector
().
isQuoted
(
token
));
params
.
setMaxResults
(
2
);
params
.
setMaxResults
(
2
);
...
@@ -1110,9 +1109,8 @@ public class SQLCompletionAnalyzer implements DBRRunnableParametrized<DBRProgres
...
@@ -1110,9 +1109,8 @@ public class SQLCompletionAnalyzer implements DBRRunnableParametrized<DBRProgres
@NotNull
Map
<
String
,
Object
>
params
)
throws
DBException
@NotNull
Map
<
String
,
Object
>
params
)
throws
DBException
{
{
DBSStructureAssistant
.
ObjectsSearchParams
assistantParams
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
assistantParams
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
objectTypes
==
null
?
assistant
.
getAutoCompleteObjectTypes
()
:
objectTypes
,
objectTypes
==
null
?
assistant
.
getAutoCompleteObjectTypes
()
:
objectTypes
,
objectName
,
makeObjectNameMask
(
objectName
,
rootSC
)
makeObjectNameMask
(
objectName
,
rootSC
)
);
);
assistantParams
.
setParentObject
(
rootSC
);
assistantParams
.
setParentObject
(
rootSC
);
assistantParams
.
setCaseSensitive
(
request
.
getWordDetector
().
isQuoted
(
objectName
));
assistantParams
.
setCaseSensitive
(
request
.
getWordDetector
().
isQuoted
(
objectName
));
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/struct/DBSStructureAssistant.java
浏览文件 @
d9060711
...
@@ -57,7 +57,6 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
...
@@ -57,7 +57,6 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
* <li>{@code parentObject}: parent (schema or catalog)</li>
* <li>{@code parentObject}: parent (schema or catalog)</li>
* <li>{@code objectTypes}: type of objects to search</li>
* <li>{@code objectTypes}: type of objects to search</li>
* <li>{@code mask}: name mask</li>
* <li>{@code mask}: name mask</li>
* <li>{@code mask}: original name</li>
* <li>{@code caseSensitive}: case sensitive search (ignored by some implementations)</li>
* <li>{@code caseSensitive}: case sensitive search (ignored by some implementations)</li>
* <li>{@code globalSearch}: search in all available schemas/catalogs. If {@code false} then search with respect of active schema/catalog</li>
* <li>{@code globalSearch}: search in all available schemas/catalogs. If {@code false} then search with respect of active schema/catalog</li>
* <li>{@code maxResults}: maximum number of results</li>
* <li>{@code maxResults}: maximum number of results</li>
...
@@ -66,9 +65,11 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
...
@@ -66,9 +65,11 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
* </ul>
* </ul>
*/
*/
class
ObjectsSearchParams
{
class
ObjectsSearchParams
{
@NotNull
private
final
DBSObjectType
[]
objectTypes
;
private
final
DBSObjectType
[]
objectTypes
;
private
String
name
;
@NotNull
private
String
mask
;
private
String
mask
;
@Nullable
private
DBSObject
parentObject
;
private
DBSObject
parentObject
;
private
int
maxResults
=
Integer
.
MAX_VALUE
;
private
int
maxResults
=
Integer
.
MAX_VALUE
;
private
boolean
caseSensitive
;
private
boolean
caseSensitive
;
...
@@ -76,9 +77,8 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
...
@@ -76,9 +77,8 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
private
boolean
searchInDefinitions
;
private
boolean
searchInDefinitions
;
private
boolean
globalSearch
;
private
boolean
globalSearch
;
public
ObjectsSearchParams
(
@NotNull
DBSObjectType
[]
objectTypes
,
@NotNull
String
name
,
@NotNull
String
mask
)
{
public
ObjectsSearchParams
(
@NotNull
DBSObjectType
[]
objectTypes
,
@NotNull
String
mask
)
{
this
.
objectTypes
=
objectTypes
;
this
.
objectTypes
=
objectTypes
;
this
.
name
=
name
;
this
.
mask
=
mask
;
this
.
mask
=
mask
;
}
}
...
@@ -105,15 +105,6 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
...
@@ -105,15 +105,6 @@ public interface DBSStructureAssistant<CONTEXT extends DBCExecutionContext> {
this
.
mask
=
mask
;
this
.
mask
=
mask
;
}
}
@NotNull
public
String
getName
()
{
return
name
;
}
public
void
setName
(
@NotNull
String
name
)
{
this
.
name
=
name
;
}
public
boolean
isCaseSensitive
()
{
public
boolean
isCaseSensitive
()
{
return
caseSensitive
;
return
caseSensitive
;
}
}
...
...
plugins/org.jkiss.dbeaver.ui.editors.sql/src/org/jkiss/dbeaver/ui/editors/sql/syntax/SQLContextInformer.java
浏览文件 @
d9060711
...
@@ -301,9 +301,8 @@ public class SQLContextInformer
...
@@ -301,9 +301,8 @@ public class SQLContextInformer
DBCExecutionContext
executionContext
=
editor
.
getExecutionContext
();
DBCExecutionContext
executionContext
=
editor
.
getExecutionContext
();
if
(
executionContext
!=
null
)
{
if
(
executionContext
!=
null
)
{
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
structureAssistant
.
getAutoCompleteObjectTypes
(),
structureAssistant
.
getAutoCompleteObjectTypes
(),
containerNames
[
0
],
containerNames
[
0
]
containerNames
[
0
]
);
);
params
.
setGlobalSearch
(
true
);
params
.
setGlobalSearch
(
true
);
params
.
setMaxResults
(
1
);
params
.
setMaxResults
(
1
);
...
@@ -360,7 +359,7 @@ public class SQLContextInformer
...
@@ -360,7 +359,7 @@ public class SQLContextInformer
DBSObjectType
[]
objectTypes
=
structureAssistant
.
getHyperlinkObjectTypes
();
DBSObjectType
[]
objectTypes
=
structureAssistant
.
getHyperlinkObjectTypes
();
DBCExecutionContext
executionContext
=
editor
.
getExecutionContext
();
DBCExecutionContext
executionContext
=
editor
.
getExecutionContext
();
if
(
executionContext
!=
null
)
{
if
(
executionContext
!=
null
)
{
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
objectTypes
,
objectName
,
objectName
);
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
objectTypes
,
objectName
);
params
.
setParentObject
(
container
);
params
.
setParentObject
(
container
);
params
.
setCaseSensitive
(
caseSensitive
);
params
.
setCaseSensitive
(
caseSensitive
);
params
.
setMaxResults
(
10
);
params
.
setMaxResults
(
10
);
...
...
plugins/org.jkiss.dbeaver.ui.navigator/src/org/jkiss/dbeaver/ui/navigator/dialogs/GotoObjectDialog.java
浏览文件 @
d9060711
...
@@ -368,9 +368,8 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
...
@@ -368,9 +368,8 @@ public class GotoObjectDialog extends FilteredItemsSelectionDialog {
public
void
run
(
DBRProgressMonitor
param
)
throws
InvocationTargetException
,
InterruptedException
{
public
void
run
(
DBRProgressMonitor
param
)
throws
InvocationTargetException
,
InterruptedException
{
try
{
try
{
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
typesToSearch
.
toArray
(
new
DBSObjectType
[
0
]),
typesToSearch
.
toArray
(
new
DBSObjectType
[
0
]),
nameMask
,
nameMask
nameMask
);
);
params
.
setParentObject
(
container
);
params
.
setParentObject
(
container
);
params
.
setGlobalSearch
(
true
);
params
.
setGlobalSearch
(
true
);
...
...
plugins/org.jkiss.dbeaver.ui.search/src/org/jkiss/dbeaver/ui/search/metadata/SearchMetadataPage.java
浏览文件 @
d9060711
...
@@ -444,9 +444,8 @@ public class SearchMetadataPage extends AbstractSearchPage {
...
@@ -444,9 +444,8 @@ public class SearchMetadataPage extends AbstractSearchPage {
}
}
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
DBSStructureAssistant
.
ObjectsSearchParams
params
=
new
DBSStructureAssistant
.
ObjectsSearchParams
(
objectTypes
.
toArray
(
new
DBSObjectType
[
0
]),
objectTypes
.
toArray
(
new
DBSObjectType
[
0
]),
nameMask
,
objectNameMask
objectNameMask
);
);
params
.
setParentObject
(
parentObject
);
params
.
setParentObject
(
parentObject
);
params
.
setCaseSensitive
(
caseSensitive
);
params
.
setCaseSensitive
(
caseSensitive
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录