Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
开发团队
Flowable Engine
提交
10b39f2e
F
Flowable Engine
项目概览
开发团队
/
Flowable Engine
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Flowable Engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
10b39f2e
编写于
10月 08, 2010
作者:
F
frederikheremans
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ACT-238 extracting common methods to Query interface
上级
f21d7910
变更
34
隐藏空白更改
内联
并排
Showing
34 changed file
with
209 addition
and
392 deletion
+209
-392
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricActivityInstanceQuery.java
...ctiviti/engine/history/HistoricActivityInstanceQuery.java
+2
-30
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricActivityInstanceQueryProperty.java
...engine/history/HistoricActivityInstanceQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricProcessInstanceQuery.java
...activiti/engine/history/HistoricProcessInstanceQuery.java
+2
-30
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricProcessInstanceQueryProperty.java
.../engine/history/HistoricProcessInstanceQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/identity/GroupQuery.java
...rc/main/java/org/activiti/engine/identity/GroupQuery.java
+2
-33
modules/activiti-engine/src/main/java/org/activiti/engine/identity/GroupQueryProperty.java
...java/org/activiti/engine/identity/GroupQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/identity/UserQuery.java
...src/main/java/org/activiti/engine/identity/UserQuery.java
+2
-34
modules/activiti-engine/src/main/java/org/activiti/engine/identity/UserQueryProperty.java
.../java/org/activiti/engine/identity/UserQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/impl/AbstractQuery.java
...src/main/java/org/activiti/engine/impl/AbstractQuery.java
+10
-10
modules/activiti-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java
...in/java/org/activiti/engine/impl/DeploymentQueryImpl.java
+6
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java
...ain/java/org/activiti/engine/impl/ExecutionQueryImpl.java
+7
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ExecutionVariableQueryImpl.java
.../org/activiti/engine/impl/ExecutionVariableQueryImpl.java
+2
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/GroupQueryImpl.java
...rc/main/java/org/activiti/engine/impl/GroupQueryImpl.java
+6
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricActivityInstanceQueryImpl.java
...tiviti/engine/impl/HistoricActivityInstanceQueryImpl.java
+7
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricProcessInstanceQueryImpl.java
...ctiviti/engine/impl/HistoricProcessInstanceQueryImpl.java
+7
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/JobQueryImpl.java
.../src/main/java/org/activiti/engine/impl/JobQueryImpl.java
+7
-4
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java
.../org/activiti/engine/impl/ProcessDefinitionQueryImpl.java
+7
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessInstanceQueryImpl.java
...va/org/activiti/engine/impl/ProcessInstanceQueryImpl.java
+5
-2
modules/activiti-engine/src/main/java/org/activiti/engine/impl/Query.java
...-engine/src/main/java/org/activiti/engine/impl/Query.java
+58
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/QueryProperty.java
...src/main/java/org/activiti/engine/impl/QueryProperty.java
+25
-0
modules/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
...src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
+6
-3
modules/activiti-engine/src/main/java/org/activiti/engine/impl/UserQueryImpl.java
...src/main/java/org/activiti/engine/impl/UserQueryImpl.java
+6
-3
modules/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentQuery.java
.../java/org/activiti/engine/repository/DeploymentQuery.java
+2
-33
modules/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentQueryProperty.java
...g/activiti/engine/repository/DeploymentQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ProcessDefinitionQuery.java
...rg/activiti/engine/repository/ProcessDefinitionQuery.java
+2
-37
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ProcessDefinitionQueryProperty.java
...iti/engine/repository/ProcessDefinitionQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ExecutionQuery.java
...main/java/org/activiti/engine/runtime/ExecutionQuery.java
+2
-34
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ExecutionQueryProperty.java
...a/org/activiti/engine/runtime/ExecutionQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/JobQuery.java
...e/src/main/java/org/activiti/engine/runtime/JobQuery.java
+2
-34
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/JobQueryProperty.java
...in/java/org/activiti/engine/runtime/JobQueryProperty.java
+3
-3
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ProcessInstanceQuery.java
...ava/org/activiti/engine/runtime/ProcessInstanceQuery.java
+2
-39
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ProcessInstanceQueryProperty.java
...activiti/engine/runtime/ProcessInstanceQueryProperty.java
+3
-1
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQuery.java
...ine/src/main/java/org/activiti/engine/task/TaskQuery.java
+2
-34
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQueryProperty.java
...main/java/org/activiti/engine/task/TaskQueryProperty.java
+3
-1
未找到文件。
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricActivityInstanceQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,10 +13,8 @@
package
org.activiti.engine.history
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.HistoricActivityInstanceQueryImpl
;
import
org.activiti.engine.impl.Query
;
/**
...
...
@@ -24,7 +22,7 @@ import org.activiti.engine.impl.HistoricActivityInstanceQueryImpl;
*
* @author Tom Baeyens
*/
public
interface
HistoricActivityInstanceQuery
{
public
interface
HistoricActivityInstanceQuery
extends
Query
<
HistoricActivityInstanceQuery
,
HistoricActivityInstance
>
{
/** Only select historic activity instances with the given process instance.
* {@link ProcessInstance) ids and {@link HistoricProcessInstance} ids match. */
...
...
@@ -73,30 +71,4 @@ public interface HistoricActivityInstanceQuery {
/** Order by processInstanceId (needs to be followed by {@link #asc()} or {@link #desc()}). */
HistoricActivityInstanceQuery
orderByProcessInstanceId
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
HistoricActivityInstanceQuery
orderBy
(
HistoricActivityInstanceQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
HistoricActivityInstanceQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
HistoricActivityInstanceQuery
desc
();
/** Executes the query and get a list of {@link HistoricProcessInstance}s as the result. */
List
<
HistoricActivityInstance
>
list
();
/** Executes the query and get a page of {@link HistoricProcessInstance}s as the result. */
List
<
HistoricActivityInstance
>
listPage
(
int
firstResult
,
int
maxResults
);
/** Executes the query and get the single expected result.
* @throws ActivitiException when the query results in more
* than one historic activity instance.
*/
HistoricActivityInstance
singleResult
();
/** Executes the query and get number of results. */
long
count
();
}
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricActivityInstanceQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,13 +16,15 @@ package org.activiti.engine.history;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
* Contains the possible properties which can be used in a {@link HistoricActivityInstanceQuery}.
*
* @author Tom Baeyens
*/
public
class
HistoricActivityInstanceQueryProperty
{
public
class
HistoricActivityInstanceQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
HistoricActivityInstanceQueryProperty
>
properties
=
new
HashMap
<
String
,
HistoricActivityInstanceQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricProcessInstanceQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,9 +13,7 @@
package
org.activiti.engine.history
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.Query
;
...
...
@@ -24,7 +22,7 @@ import org.activiti.engine.ActivitiException;
* @author Tom Baeyens
* @author Joram Barrez
*/
public
interface
HistoricProcessInstanceQuery
{
public
interface
HistoricProcessInstanceQuery
extends
Query
<
HistoricProcessInstanceQuery
,
HistoricProcessInstance
>
{
/** Only select historic process instances with the given process instance.
* {@link ProcessInstance) ids and {@link HistoricProcessInstance} ids match. */
...
...
@@ -59,30 +57,4 @@ public interface HistoricProcessInstanceQuery {
/** Order by the duration of the process instance (needs to be followed by {@link #asc()} or {@link #desc()}). */
HistoricProcessInstanceQuery
orderByDuration
();
/** Order by the given property */
HistoricProcessInstanceQuery
orderBy
(
HistoricProcessInstanceQueryProperty
property
);
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
HistoricProcessInstanceQuery
desc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
HistoricProcessInstanceQuery
asc
();
/** Executes the query and get a list of {@link HistoricProcessInstance}s as the result. */
List
<
HistoricProcessInstance
>
list
();
/** Executes the query and get a page of {@link HistoricProcessInstance}s as the result. */
List
<
HistoricProcessInstance
>
listPage
(
int
firstResult
,
int
maxResults
);
/** Executes the query and get the single expected result.
* @throws ActivitiException when the query results in more
* than one historic process instance.
*/
HistoricProcessInstance
singleResult
();
/** Executes the query and get number of results. */
long
count
();
}
modules/activiti-engine/src/main/java/org/activiti/engine/history/HistoricProcessInstanceQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,11 +16,13 @@ package org.activiti.engine.history;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
* @author Joram Barrez
*/
public
class
HistoricProcessInstanceQueryProperty
{
public
class
HistoricProcessInstanceQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
HistoricProcessInstanceQueryProperty
>
properties
=
new
HashMap
<
String
,
HistoricProcessInstanceQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/identity/GroupQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,9 +13,7 @@
package
org.activiti.engine.identity
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.Query
;
/**
...
...
@@ -23,7 +21,7 @@ import org.activiti.engine.ActivitiException;
*
* @author Joram Barrez
*/
public
interface
GroupQuery
{
public
interface
GroupQuery
extends
Query
<
GroupQuery
,
Group
>
{
/** Only select {@link Group}s with the given id. */
GroupQuery
id
(
String
id
);
...
...
@@ -52,33 +50,4 @@ public interface GroupQuery {
/** Order by group type (needs to be followed by {@link #asc()} or {@link #desc()}). */
GroupQuery
orderByType
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
GroupQuery
orderBy
(
GroupQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
GroupQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
GroupQuery
desc
();
//results ////////////////////////////////////////////////////////
/** Executes the query and counts number of {@link Group}s in the result. */
long
count
();
/**
* Executes the query and returns the {@link Group}.
* @throws ActivitiException when the query results in more
* than one {@link Group}.
*/
Group
singleResult
();
/** Executes the query and get a list of {@link Group}s as the result. */
List
<
Group
>
list
();
/** Executes the query and get a list of {@link Group}s as the result. */
List
<
Group
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/identity/GroupQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,6 +16,8 @@ package org.activiti.engine.identity;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
...
...
@@ -23,7 +25,7 @@ import java.util.Map;
*
* @author Joram Barrez
*/
public
class
GroupQueryProperty
{
public
class
GroupQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
GroupQueryProperty
>
properties
=
new
HashMap
<
String
,
GroupQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/identity/UserQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,9 +13,7 @@
package
org.activiti.engine.identity
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.Query
;
/**
...
...
@@ -23,7 +21,7 @@ import org.activiti.engine.ActivitiException;
*
* @author Joram Barrez
*/
public
interface
UserQuery
{
public
interface
UserQuery
extends
Query
<
UserQuery
,
User
>
{
/** Only select {@link User}s with the given id/ */
UserQuery
id
(
String
id
);
...
...
@@ -68,34 +66,4 @@ public interface UserQuery {
/** Order by user email (needs to be followed by {@link #asc()} or {@link #desc()}). */
UserQuery
orderByEmail
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
UserQuery
orderBy
(
UserQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
UserQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
UserQuery
desc
();
//results ////////////////////////////////////////////////////////
/** Executes the query and counts number of {@link User}s in the result. */
long
count
();
/**
* Executes the query and returns the {@link User}.
* @throws ActivitiException when the query results in more
* than one {@link User}.
*/
User
singleResult
();
/** Executes the query and get a list of {@link User}s as the result. */
List
<
User
>
list
();
/** Executes the query and get a list of {@link User}s as the result. */
List
<
User
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/identity/UserQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,6 +16,8 @@ package org.activiti.engine.identity;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
...
...
@@ -23,7 +25,7 @@ import java.util.Map;
*
* @author Joram Barrez
*/
public
class
UserQueryProperty
{
public
class
UserQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
UserQueryProperty
>
properties
=
new
HashMap
<
String
,
UserQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/AbstractQuery.java
浏览文件 @
10b39f2e
...
...
@@ -25,7 +25,7 @@ import org.activiti.engine.impl.interceptor.CommandExecutor;
*
* @author Joram Barrez
*/
public
abstract
class
AbstractQuery
<
T
>
implements
Command
<
Object
>{
public
abstract
class
AbstractQuery
<
T
extends
Query
<?,?>,
U
>
implements
Command
<
Object
>,
Query
<
T
,
U
>{
public
static
final
String
SORTORDER_ASC
=
"asc"
;
public
static
final
String
SORTORDER_DESC
=
"desc"
;
...
...
@@ -49,23 +49,23 @@ public abstract class AbstractQuery<T> implements Command<Object>{
}
@SuppressWarnings
(
"unchecked"
)
public
T
singleResult
()
{
public
U
singleResult
()
{
this
.
resultType
=
ResultType
.
SINGLE_RESULT
;
return
(
T
)
commandExecutor
.
execute
(
this
);
return
(
U
)
commandExecutor
.
execute
(
this
);
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
T
>
list
()
{
public
List
<
U
>
list
()
{
this
.
resultType
=
ResultType
.
LIST
;
return
(
List
)
commandExecutor
.
execute
(
this
);
return
(
List
<
U
>
)
commandExecutor
.
execute
(
this
);
}
@SuppressWarnings
(
"unchecked"
)
public
List
<
T
>
listPage
(
int
firstResult
,
int
maxResults
)
{
public
List
<
U
>
listPage
(
int
firstResult
,
int
maxResults
)
{
this
.
firstResult
=
firstResult
;
this
.
maxResults
=
maxResults
;
this
.
resultType
=
ResultType
.
LIST_PAGE
;
return
(
List
)
commandExecutor
.
execute
(
this
);
return
(
List
<
U
>
)
commandExecutor
.
execute
(
this
);
}
public
long
count
()
{
...
...
@@ -91,10 +91,10 @@ public abstract class AbstractQuery<T> implements Command<Object>{
* Executes the actual query to retrieve the list of results.
* @param page used if the results must be paged. If null, no paging will be applied.
*/
public
abstract
List
<
T
>
executeList
(
CommandContext
commandContext
,
Page
page
);
public
abstract
List
<
U
>
executeList
(
CommandContext
commandContext
,
Page
page
);
public
T
executeSingleResult
(
CommandContext
commandContext
)
{
List
<
T
>
results
=
executeList
(
commandContext
,
null
);
public
U
executeSingleResult
(
CommandContext
commandContext
)
{
List
<
U
>
results
=
executeList
(
commandContext
,
null
);
if
(
results
.
size
()
==
1
)
{
return
results
.
get
(
0
);
}
else
if
(
results
.
size
()
>
1
)
{
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/DeploymentQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -27,7 +27,7 @@ import org.activiti.engine.repository.DeploymentQueryProperty;
* @author Tom Baeyens
* @author Joram Barrez
*/
public
class
DeploymentQueryImpl
extends
AbstractQuery
<
Deployment
>
implements
DeploymentQuery
{
public
class
DeploymentQueryImpl
extends
AbstractQuery
<
Deployment
Query
,
Deployment
>
implements
DeploymentQuery
{
protected
String
deploymentId
;
protected
String
name
;
...
...
@@ -79,8 +79,11 @@ public class DeploymentQueryImpl extends AbstractQuery<Deployment> implements De
return
orderBy
(
DeploymentQueryProperty
.
NAME
);
}
public
DeploymentQueryImpl
orderBy
(
DeploymentQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
DeploymentQueryImpl
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
DeploymentQueryProperty
))
{
throw
new
ActivitiException
(
"Only DeploymentQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
DeploymentQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ExecutionQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -26,7 +26,8 @@ import org.activiti.engine.runtime.ExecutionQueryProperty;
* @author Joram Barrez
* @author Frederik Heremans
*/
public
class
ExecutionQueryImpl
extends
ExecutionVariableQueryImpl
<
ExecutionQueryImpl
,
Execution
>
implements
ExecutionQuery
{
public
class
ExecutionQueryImpl
extends
ExecutionVariableQueryImpl
<
ExecutionQuery
,
Execution
>
implements
ExecutionQuery
{
protected
String
processDefinitionId
;
protected
String
processDefinitionKey
;
...
...
@@ -108,8 +109,11 @@ public class ExecutionQueryImpl extends ExecutionVariableQueryImpl<ExecutionQuer
return
this
;
}
public
ExecutionQueryImpl
orderBy
(
ExecutionQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
ExecutionQueryImpl
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
ExecutionQueryProperty
))
{
throw
new
ActivitiException
(
"Only ExecutionQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
ExecutionQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ExecutionVariableQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -28,7 +28,7 @@ import org.activiti.engine.impl.variable.VariableTypes;
*
* @author Frederik Heremans
*/
public
abstract
class
ExecutionVariableQueryImpl
<
T
,
U
>
extends
AbstractQuery
<
U
>
{
public
abstract
class
ExecutionVariableQueryImpl
<
T
extends
Query
<?,?>,
U
>
extends
AbstractQuery
<
T
,
U
>
{
protected
List
<
QueryVariableValue
>
variables
=
new
ArrayList
<
QueryVariableValue
>();
...
...
@@ -62,7 +62,7 @@ public abstract class ExecutionVariableQueryImpl<T, U> extends AbstractQuery<U>
public
T
variableValueGreaterThan
(
String
name
,
Object
value
)
{
addVariable
(
name
,
value
,
QueryOperator
.
GREATER_THAN
);
return
(
T
)
this
;
}
}
@SuppressWarnings
(
"unchecked"
)
public
T
variableValueGreaterThanOrEqual
(
String
name
,
Object
value
)
{
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/GroupQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -26,7 +26,7 @@ import org.activiti.engine.impl.interceptor.CommandExecutor;
/**
* @author Joram Barrez
*/
public
class
GroupQueryImpl
extends
AbstractQuery
<
Group
>
implements
GroupQuery
{
public
class
GroupQueryImpl
extends
AbstractQuery
<
Group
Query
,
Group
>
implements
GroupQuery
{
protected
String
id
;
protected
String
name
;
...
...
@@ -97,8 +97,11 @@ public class GroupQueryImpl extends AbstractQuery<Group> implements GroupQuery {
return
orderBy
(
GroupQueryProperty
.
TYPE
);
}
public
GroupQuery
orderBy
(
GroupQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
GroupQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
GroupQueryProperty
))
{
throw
new
ActivitiException
(
"Only GroupQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
GroupQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricActivityInstanceQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -26,7 +26,8 @@ import org.activiti.engine.impl.interceptor.CommandExecutor;
/**
* @author Tom Baeyens
*/
public
class
HistoricActivityInstanceQueryImpl
extends
AbstractQuery
<
HistoricActivityInstance
>
implements
HistoricActivityInstanceQuery
{
public
class
HistoricActivityInstanceQueryImpl
extends
AbstractQuery
<
HistoricActivityInstanceQuery
,
HistoricActivityInstance
>
implements
HistoricActivityInstanceQuery
{
protected
String
processInstanceId
;
protected
String
executionId
;
...
...
@@ -128,8 +129,11 @@ public class HistoricActivityInstanceQueryImpl extends AbstractQuery<HistoricAct
return
this
;
}
public
HistoricActivityInstanceQueryImpl
orderBy
(
HistoricActivityInstanceQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
HistoricActivityInstanceQueryImpl
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
HistoricActivityInstanceQueryProperty
))
{
throw
new
ActivitiException
(
"Only HistoricActivityInstanceQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
HistoricActivityInstanceQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/HistoricProcessInstanceQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -26,7 +26,8 @@ import org.activiti.engine.impl.interceptor.CommandExecutor;
/**
* @author Tom Baeyens
*/
public
class
HistoricProcessInstanceQueryImpl
extends
AbstractQuery
<
HistoricProcessInstance
>
implements
HistoricProcessInstanceQuery
{
public
class
HistoricProcessInstanceQueryImpl
extends
AbstractQuery
<
HistoricProcessInstanceQuery
,
HistoricProcessInstance
>
implements
HistoricProcessInstanceQuery
{
protected
String
processInstanceId
;
protected
String
processDefinitionId
;
...
...
@@ -107,8 +108,11 @@ public class HistoricProcessInstanceQueryImpl extends AbstractQuery<HistoricProc
return
this
;
}
public
HistoricProcessInstanceQuery
orderBy
(
HistoricProcessInstanceQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
HistoricProcessInstanceQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
HistoricProcessInstanceQueryProperty
))
{
throw
new
ActivitiException
(
"Only HistoricProcessInstanceQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
HistoricProcessInstanceQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/JobQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -20,16 +20,16 @@ import org.activiti.engine.ActivitiException;
import
org.activiti.engine.impl.interceptor.CommandContext
;
import
org.activiti.engine.impl.interceptor.CommandExecutor
;
import
org.activiti.engine.impl.util.ClockUtil
;
import
org.activiti.engine.management.JobQueryProperty
;
import
org.activiti.engine.runtime.Job
;
import
org.activiti.engine.runtime.JobQuery
;
import
org.activiti.engine.runtime.JobQueryProperty
;
/**
* @author Joram Barrez
* @author Tom Baeyens
*/
public
class
JobQueryImpl
extends
AbstractQuery
<
Job
>
implements
JobQuery
{
public
class
JobQueryImpl
extends
AbstractQuery
<
Job
Query
,
Job
>
implements
JobQuery
{
protected
String
id
;
protected
String
processInstanceId
;
...
...
@@ -155,8 +155,11 @@ public class JobQueryImpl extends AbstractQuery<Job> implements JobQuery {
return
orderBy
(
JobQueryProperty
.
RETRIES
);
}
public
JobQuery
orderBy
(
JobQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
JobQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
JobQueryProperty
))
{
throw
new
ActivitiException
(
"Only JobQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
JobQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessDefinitionQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -27,7 +27,8 @@ import org.activiti.engine.repository.ProcessDefinitionQueryProperty;
* @author Tom Baeyens
* @author Joram Barrez
*/
public
class
ProcessDefinitionQueryImpl
extends
AbstractQuery
<
ProcessDefinition
>
implements
ProcessDefinitionQuery
{
public
class
ProcessDefinitionQueryImpl
extends
AbstractQuery
<
ProcessDefinitionQuery
,
ProcessDefinition
>
implements
ProcessDefinitionQuery
{
protected
String
id
;
protected
String
name
;
...
...
@@ -124,8 +125,11 @@ public class ProcessDefinitionQueryImpl extends AbstractQuery<ProcessDefinition>
return
orderBy
(
ProcessDefinitionQueryProperty
.
VERSION
);
}
public
ProcessDefinitionQuery
orderBy
(
ProcessDefinitionQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
ProcessDefinitionQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
ProcessDefinitionQueryProperty
))
{
throw
new
ActivitiException
(
"Only ProcessDefinitionQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
ProcessDefinitionQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/ProcessInstanceQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -117,8 +117,11 @@ public class ProcessInstanceQueryImpl extends ExecutionVariableQueryImpl<Process
return
this
;
}
public
ProcessInstanceQuery
orderBy
(
ProcessInstanceQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
ProcessInstanceQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
ProcessInstanceQueryProperty
))
{
throw
new
ActivitiException
(
"Only ProcessInstanceQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
ProcessInstanceQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/Query.java
0 → 100644
浏览文件 @
10b39f2e
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine.impl
;
import
java.util.List
;
/**
* Describes basic methods for querying.
*
* @author Frederik Heremans
*/
public
interface
Query
<
T
extends
Query
<
?
,
?
>,
U
extends
Object
>
{
/**
* Order by the given property (needs to be followed by {@link #asc()} or
* {@link #desc()}).
*/
T
orderBy
(
QueryProperty
property
);
/**
* Order the results ascending on the given property as defined in this
* class (needs to come after a call to one of the orderByXxxx methods).
*/
T
asc
();
/**
* Order the results descending on the given property as defined in this
* class (needs to come after a call to one of the orderByXxxx methods).
*/
T
desc
();
/** Executes the query and returns the number of results */
long
count
();
/**
* Executes the query and returns the resulting entity.
* @throws ActivitiException when the query results in more than one
* entities.. Ê
*/
U
singleResult
();
/** Executes the query and get a list of entities as the result. */
List
<
U
>
list
();
/** Executes the query and get a list of entities as the result. */
List
<
U
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/QueryProperty.java
0 → 100644
浏览文件 @
10b39f2e
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.activiti.engine.impl
;
/**
* Describes a property that can be used in a Query.
*
* @author Frederik Heremans
*/
public
interface
QueryProperty
{
String
getName
();
}
modules/activiti-engine/src/main/java/org/activiti/engine/impl/TaskQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -28,7 +28,7 @@ import org.activiti.engine.task.TaskQueryProperty;
* @author Joram Barrez
* @author Tom Baeyens
*/
public
class
TaskQueryImpl
extends
AbstractQuery
<
Task
>
implements
TaskQuery
{
public
class
TaskQueryImpl
extends
AbstractQuery
<
Task
Query
,
Task
>
implements
TaskQuery
{
protected
String
taskId
;
protected
String
name
;
...
...
@@ -192,8 +192,11 @@ public class TaskQueryImpl extends AbstractQuery<Task> implements TaskQuery {
return
orderBy
(
TaskQueryProperty
.
ASSIGNEE
);
}
public
TaskQueryImpl
orderBy
(
TaskQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
TaskQueryImpl
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
QueryProperty
))
{
throw
new
ActivitiException
(
"Only QueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
TaskQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/impl/UserQueryImpl.java
浏览文件 @
10b39f2e
...
...
@@ -26,7 +26,7 @@ import org.activiti.engine.impl.interceptor.CommandExecutor;
/**
* @author Joram Barrez
*/
public
class
UserQueryImpl
extends
AbstractQuery
<
User
>
implements
UserQuery
{
public
class
UserQueryImpl
extends
AbstractQuery
<
User
Query
,
User
>
implements
UserQuery
{
protected
String
id
;
protected
String
firstName
;
...
...
@@ -119,8 +119,11 @@ public class UserQueryImpl extends AbstractQuery<User> implements UserQuery {
return
orderBy
(
UserQueryProperty
.
LAST_NAME
);
}
public
UserQuery
orderBy
(
UserQueryProperty
property
)
{
this
.
orderProperty
=
property
;
public
UserQuery
orderBy
(
QueryProperty
property
)
{
if
(!(
property
instanceof
UserQueryProperty
))
{
throw
new
ActivitiException
(
"Only UserQueryProperty can be used with orderBy"
);
}
this
.
orderProperty
=
(
UserQueryProperty
)
property
;
return
this
;
}
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,10 +13,8 @@
package
org.activiti.engine.repository
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.RepositoryService
;
import
org.activiti.engine.impl.Query
;
/**
* Allows programmatic querying of {@link Deployment}s.
...
...
@@ -32,7 +30,7 @@ import org.activiti.engine.RepositoryService;
* @author Tom Baeyens
* @author Joram Barrez
*/
public
interface
DeploymentQuery
{
public
interface
DeploymentQuery
extends
Query
<
DeploymentQuery
,
Deployment
>
{
/** Only select deployments with the given deployment id. */
DeploymentQuery
deploymentId
(
String
deploymentId
);
...
...
@@ -53,33 +51,4 @@ public interface DeploymentQuery {
/** Order by deployment time (needs to be followed by {@link #asc()} or {@link #desc()}). */
DeploymentQuery
orderByDeploymenTime
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
DeploymentQuery
orderBy
(
DeploymentQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
DeploymentQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
DeploymentQuery
desc
();
//results ////////////////////////////////////////////////////////
/** Executes the query and counts number of {@link Deployment}s in the result. */
long
count
();
/**
* Executes the query and returns the {@link Deployment}.
* @throws ActivitiException when the query results in more
* than one deployment.
*/
Deployment
singleResult
();
/** Executes the query and get a list of {@link Deployment}s as the result. */
List
<
Deployment
>
list
();
/** Executes the query and get a list of {@link Deployment}s as the result. */
List
<
Deployment
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/repository/DeploymentQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -29,6 +29,8 @@ package org.activiti.engine.repository;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
...
...
@@ -36,7 +38,7 @@ import java.util.Map;
*
* @author Joram Barrez
*/
public
class
DeploymentQueryProperty
{
public
class
DeploymentQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
DeploymentQueryProperty
>
properties
=
new
HashMap
<
String
,
DeploymentQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ProcessDefinitionQuery.java
浏览文件 @
10b39f2e
...
...
@@ -16,6 +16,7 @@ package org.activiti.engine.repository;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.Query
;
/**
* Allows programmatic querying of {@link ProcessDefinition}s.
...
...
@@ -23,7 +24,7 @@ import org.activiti.engine.ActivitiException;
* @author Tom Baeyens
* @author Joram Barrez
*/
public
interface
ProcessDefinitionQuery
{
public
interface
ProcessDefinitionQuery
extends
Query
<
ProcessDefinitionQuery
,
ProcessDefinition
>
{
/** Only select process definiton with the given id. */
ProcessDefinitionQuery
id
(
String
processDefinitionId
);
...
...
@@ -86,40 +87,4 @@ public interface ProcessDefinitionQuery {
/** Order by process definition version (needs to be followed by {@link #asc()} or {@link #desc()}). */
ProcessDefinitionQuery
orderByVersion
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
ProcessDefinitionQuery
orderBy
(
ProcessDefinitionQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ProcessDefinitionQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ProcessDefinitionQuery
desc
();
// results ////////////////////////////////////////////////////////////
/**
* Executes the query and counts number of {@link ProcessDefinition}s in the result.
*/
long
count
();
/**
* Executes the query and returns the {@link ProcessDefinition}.
*
* @throws ActivitiException
* when the query results in more than one process definition.
*/
ProcessDefinition
singleResult
();
/**
* Executes the query and get a list of {@link ProcessDefinition}s as the result.
*/
List
<
ProcessDefinition
>
list
();
/**
* Executes the query and get a list of {@link ProcessDefinition}s as the result.
*/
List
<
ProcessDefinition
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/repository/ProcessDefinitionQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,13 +16,15 @@ package org.activiti.engine.repository;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
* Contains the possible properties that can be used in a {@link ProcessDefinitionQuery}.
*
* @author Joram Barrez
*/
public
class
ProcessDefinitionQueryProperty
{
public
class
ProcessDefinitionQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
ProcessDefinitionQueryProperty
>
properties
=
new
HashMap
<
String
,
ProcessDefinitionQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ExecutionQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,9 +13,8 @@
package
org.activiti.engine.runtime
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.activiti.engine.
ActivitiException
;
import
org.activiti.engine.
impl.Query
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfiguration
;
...
...
@@ -25,7 +24,7 @@ import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
* @author Joram Barrez
* @author Frederik Heremans
*/
public
interface
ExecutionQuery
{
public
interface
ExecutionQuery
extends
Query
<
ExecutionQuery
,
Execution
>
{
/** Only select executions which have the given process definition key. **/
ExecutionQuery
processDefinitionKey
(
String
processDefinitionKey
);
...
...
@@ -119,35 +118,4 @@ public interface ExecutionQuery {
/** Order by process definition id (needs to be followed by {@link #asc()} or {@link #desc()}). */
ExecutionQuery
orderByProcessDefinitionId
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
ExecutionQuery
orderBy
(
ExecutionQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ExecutionQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ExecutionQuery
desc
();
//results //////////////////////////////////////////////////////////////
/** Executes the query and get a list of {@link Execution}s as the result. */
List
<
Execution
>
list
();
/** Executes the query and get a list of {@link Execution}s as the result. */
List
<
Execution
>
listPage
(
int
firstResult
,
int
maxResults
);
/**
* Executes the query and returns the {@link Execution}.
* @throws ActivitiException when the query results in more
* than one execution.
*/
Execution
singleResult
();
/** Executes the query and gets the number of result */
long
count
();
}
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ExecutionQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,12 +16,14 @@ package org.activiti.engine.runtime;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
* Contains the possible properties that can be used in a {@link ExecutionQueryt}.
*
* @author Joram Barrez
*/
public
class
ExecutionQueryProperty
{
public
class
ExecutionQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
ExecutionQueryProperty
>
properties
=
new
HashMap
<
String
,
ExecutionQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/JobQuery.java
浏览文件 @
10b39f2e
...
...
@@ -14,10 +14,8 @@
package
org.activiti.engine.runtime
;
import
java.util.Date
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.management.JobQueryProperty
;
import
org.activiti.engine.impl.Query
;
/**
...
...
@@ -25,7 +23,7 @@ import org.activiti.engine.management.JobQueryProperty;
*
* @author Joram Barrez
*/
public
interface
JobQuery
{
public
interface
JobQuery
extends
Query
<
JobQuery
,
Job
>
{
/** Only select jobs with the given id */
JobQuery
id
(
String
jobId
);
...
...
@@ -79,34 +77,4 @@ public interface JobQuery {
/** Order by retries (needs to be followed by {@link #asc()} or {@link #desc()}). */
JobQuery
orderByRetries
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
JobQuery
orderBy
(
JobQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
JobQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
JobQuery
desc
();
//results //////////////////////////////////////////
/** Executes the query and returns the number of results */
long
count
();
/**
* Executes the query and returns the {@link Job}.
* @throws ActivitiException when the query results in more
* than one job.
*/
Job
singleResult
();
/** Executes the query and get a list of {@link Job}s as the result. */
List
<
Job
>
list
();
/** Executes the query and get a list of {@link Job}s as the result. */
List
<
Job
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/
management
/JobQueryProperty.java
→
modules/activiti-engine/src/main/java/org/activiti/engine/
runtime
/JobQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -11,19 +11,19 @@
* limitations under the License.
*/
package
org.activiti.engine.
management
;
package
org.activiti.engine.
runtime
;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.
runtime.JobQuer
y
;
import
org.activiti.engine.
impl.QueryPropert
y
;
/**
* Contains the possible properties that can be used in a {@link JobQuery}.
*
* @author Joram Barrez
*/
public
class
JobQueryProperty
{
public
class
JobQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
JobQueryProperty
>
properties
=
new
HashMap
<
String
,
JobQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ProcessInstanceQuery.java
浏览文件 @
10b39f2e
...
...
@@ -13,9 +13,8 @@
package
org.activiti.engine.runtime
;
import
java.io.Serializable
;
import
java.util.List
;
import
org.activiti.engine.
ActivitiException
;
import
org.activiti.engine.
impl.Query
;
import
org.activiti.engine.impl.cfg.ProcessEngineConfiguration
;
/**
...
...
@@ -24,7 +23,7 @@ import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
* @author Joram Barrez
* @author Frederik Heremans
*/
public
interface
ProcessInstanceQuery
{
public
interface
ProcessInstanceQuery
extends
Query
<
ProcessInstanceQuery
,
ProcessInstance
>
{
/** Select the process instance with the given id */
ProcessInstanceQuery
processInstanceId
(
String
processInstanceId
);
...
...
@@ -138,40 +137,4 @@ public interface ProcessInstanceQuery {
/** Order by process definition id (needs to be followed by {@link #asc()} or {@link #desc()}). */
ProcessInstanceQuery
orderByProcessDefinitionId
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
ProcessInstanceQuery
orderBy
(
ProcessInstanceQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ProcessInstanceQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
ProcessInstanceQuery
desc
();
//results /////////////////////////////////////////////////////////////////
/**
* Executes the query and get a list of {@link ProcessInstance}s as the
* result.
*/
List
<
ProcessInstance
>
list
();
/**
* Executes the query and get a list of {@link ProcessInstance}s as the
* result.
*/
List
<
ProcessInstance
>
listPage
(
int
firstResult
,
int
maxResults
);
/**
* Executes the query and returns the {@link ProcessInstance}.
*
* @throws ActivitiException
* when the query results in more than one process instance.
*/
ProcessInstance
singleResult
();
/** Executes the query and returns the number of results */
long
count
();
}
modules/activiti-engine/src/main/java/org/activiti/engine/runtime/ProcessInstanceQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -16,13 +16,15 @@ package org.activiti.engine.runtime;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
* Contains the possible properties that can be used in a {@link ProcessInstanceQuery}.
*
* @author Joram Barrez
*/
public
class
ProcessInstanceQueryProperty
{
public
class
ProcessInstanceQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
ProcessInstanceQueryProperty
>
properties
=
new
HashMap
<
String
,
ProcessInstanceQueryProperty
>();
...
...
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQuery.java
浏览文件 @
10b39f2e
...
...
@@ -12,16 +12,14 @@
*/
package
org.activiti.engine.task
;
import
java.util.List
;
import
org.activiti.engine.ActivitiException
;
import
org.activiti.engine.impl.Query
;
/**
* Allows programmatic querying of {@link Task}s;
*
* @author Joram Barrez
*/
public
interface
TaskQuery
{
public
interface
TaskQuery
extends
Query
<
TaskQuery
,
Task
>
{
/**
* Only select tasks with the given task id (in practice, there will be
...
...
@@ -86,35 +84,5 @@ public interface TaskQuery {
/** Order by execution id (needs to be followed by {@link #asc()} or {@link #desc()}). */
TaskQuery
orderByExecutionId
();
/** Order by the given property (needs to be followed by {@link #asc()} or {@link #desc()}). */
TaskQuery
orderBy
(
TaskQueryProperty
property
);
/** Order the results ascending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
TaskQuery
asc
();
/** Order the results descending on the given property as
* defined in this class (needs to come after a call to one of the orderByXxxx methods). */
TaskQuery
desc
();
// results ////////////////////////////////////////////////////////////
/** Execute the query and return the number of results. */
long
count
();
/**
* Executes the query and returns the {@link Task}.
*
* @throws ActivitiException
* when the query results in more than one process definition.
*/
Task
singleResult
();
/** Executes the query and get a list of {@link Task}s as the result. */
List
<
Task
>
list
();
/** Executes the query and get a list of {@link Task}s as the result. */
List
<
Task
>
listPage
(
int
firstResult
,
int
maxResults
);
}
modules/activiti-engine/src/main/java/org/activiti/engine/task/TaskQueryProperty.java
浏览文件 @
10b39f2e
...
...
@@ -29,6 +29,8 @@ package org.activiti.engine.task;
import
java.util.HashMap
;
import
java.util.Map
;
import
org.activiti.engine.impl.QueryProperty
;
/**
...
...
@@ -36,7 +38,7 @@ import java.util.Map;
*
* @author Joram Barrez
*/
public
class
TaskQueryProperty
{
public
class
TaskQueryProperty
implements
QueryProperty
{
private
static
final
Map
<
String
,
TaskQueryProperty
>
properties
=
new
HashMap
<
String
,
TaskQueryProperty
>();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录