Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
481b7c67
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
481b7c67
编写于
9月 10, 2020
作者:
Z
zhourui
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
x_processplatform_assemble_designer fixed
上级
1f1dab7e
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
43 addition
and
55 deletion
+43
-55
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/content/factory/WorkCompletedFactory.java
...semble/designer/content/factory/WorkCompletedFactory.java
+5
-2
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/content/factory/WorkFactory.java
...atform/assemble/designer/content/factory/WorkFactory.java
+5
-2
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ApplicationFactory.java
...assemble/designer/element/factory/ApplicationFactory.java
+3
-21
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ProcessFactory.java
...orm/assemble/designer/element/factory/ProcessFactory.java
+8
-12
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionApplicationDictOrphan.java
...signer/jaxrs/elementtool/ActionApplicationDictOrphan.java
+5
-4
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionFormOrphan.java
...assemble/designer/jaxrs/elementtool/ActionFormOrphan.java
+5
-4
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionProcessOrphan.java
...emble/designer/jaxrs/elementtool/ActionProcessOrphan.java
+5
-4
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionScriptOrphan.java
...semble/designer/jaxrs/elementtool/ActionScriptOrphan.java
+3
-2
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/input/BaseAction.java
...essplatform/assemble/designer/jaxrs/input/BaseAction.java
+4
-4
未找到文件。
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/content/factory/WorkCompletedFactory.java
浏览文件 @
481b7c67
package
com.x.processplatform.assemble.designer.content.factory
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -45,7 +46,8 @@ public class WorkCompletedFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
WorkCompleted
>
root
=
cq
.
from
(
WorkCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
application
),
applicationId
);
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
WorkCompleted_
.
job
)).
where
(
p
).
distinct
(
true
)).
getResultList
();
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
WorkCompleted_
.
job
)).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
}
public
List
<
String
>
listJobWithProcess
(
String
processId
)
throws
Exception
{
...
...
@@ -54,6 +56,7 @@ public class WorkCompletedFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
WorkCompleted
>
root
=
cq
.
from
(
WorkCompleted
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
WorkCompleted_
.
process
),
processId
);
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
WorkCompleted_
.
job
)).
where
(
p
).
distinct
(
true
)).
getResultList
();
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
WorkCompleted_
.
job
)).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
}
}
\ No newline at end of file
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/content/factory/WorkFactory.java
浏览文件 @
481b7c67
package
com.x.processplatform.assemble.designer.content.factory
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -45,7 +46,8 @@ public class WorkFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Work
>
root
=
cq
.
from
(
Work
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Work_
.
application
),
applicationId
);
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Work_
.
job
)).
where
(
p
).
distinct
(
true
)).
getResultList
();
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Work_
.
job
)).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
}
public
List
<
String
>
listJobWithProcess
(
String
processId
)
throws
Exception
{
...
...
@@ -54,6 +56,7 @@ public class WorkFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Work
>
root
=
cq
.
from
(
Work
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Work_
.
process
),
processId
);
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Work_
.
job
)).
where
(
p
).
distinct
(
true
)).
getResultList
();
return
em
.
createQuery
(
cq
.
select
(
root
.
get
(
Work_
.
job
)).
where
(
p
)).
getResultList
().
stream
().
distinct
()
.
collect
(
Collectors
.
toList
());
}
}
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ApplicationFactory.java
浏览文件 @
481b7c67
...
...
@@ -57,25 +57,7 @@ public class ApplicationFactory extends AbstractFactory {
return
em
.
createQuery
(
cq
).
getResultList
();
}
// /* 如果是isManager列示所有应用,如果不是则判断权限 */
// public List<String> listApplicationCategoryWithPerson(EffectivePerson
// effectivePerson) throws Exception {
// EntityManager em = this.entityManagerContainer().get(Application.class);
// CriteriaBuilder cb = em.getCriteriaBuilder();
// CriteriaQuery<String> cq = cb.createQuery(String.class);
// Root<Application> root = cq.from(Application.class);
// cq.select(root.get(Application_.applicationCategory)).distinct(true);
// if (!effectivePerson.isManager()) {
// Predicate p = cb.isMember(effectivePerson.getDistinguishedName(),
// root.get(Application_.controllerList));
// p = cb.or(p, cb.equal(root.get(Application_.creatorPerson),
// effectivePerson.getDistinguishedName()));
// cq.where(p);
// }
// return em.createQuery(cq).getResultList();
// }
/* 如果是isManager列示所有应用,如果不是则判断权限 */
// 如果是isManager列示所有应用,如果不是则判断权限
public
Long
countWithPersonWithApplicationCategory
(
EffectivePerson
effectivePerson
,
String
applicationCategory
)
throws
Exception
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Application
.
class
);
...
...
@@ -88,8 +70,8 @@ public class ApplicationFactory extends AbstractFactory {
cb
.
or
(
cb
.
isMember
(
effectivePerson
.
getDistinguishedName
(),
root
.
get
(
Application_
.
controllerList
)),
cb
.
equal
(
root
.
get
(
Application_
.
creatorPerson
),
effectivePerson
.
getDistinguishedName
())));
}
cq
.
select
(
root
.
get
(
Application_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
List
<
String
>
list
=
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
Application_
.
id
)).
where
(
p
);
List
<
String
>
list
=
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
return
new
Long
(
list
.
size
());
}
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/element/factory/ProcessFactory.java
浏览文件 @
481b7c67
...
...
@@ -26,8 +26,7 @@ public class ProcessFactory extends AbstractFactory {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
);
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
cq
.
select
(
root
.
get
(
Process_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
...
...
@@ -38,8 +37,7 @@ public class ProcessFactory extends AbstractFactory {
CriteriaQuery
<
Process
>
cq
=
cb
.
createQuery
(
Process
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
);
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
p
=
cb
.
and
(
p
,
cb
.
or
(
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)),
cb
.
isNull
(
root
.
get
(
Process_
.
editionEnable
))));
cq
.
select
(
root
).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
}
...
...
@@ -74,7 +72,6 @@ public class ProcessFactory extends AbstractFactory {
Predicate
p
=
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
);
p
=
cb
.
and
(
p
,
cb
.
isNotNull
(
root
.
get
(
Process_
.
edition
)));
p
=
cb
.
and
(
p
,
cb
.
notEqual
(
root
.
get
(
Process_
.
edition
),
""
));
Subquery
<
Process
>
subquery
=
cq
.
subquery
(
Process
.
class
);
Root
<
Process
>
subRoot
=
subquery
.
from
(
Process
.
class
);
Predicate
subP
=
cb
.
conjunction
();
...
...
@@ -82,9 +79,8 @@ public class ProcessFactory extends AbstractFactory {
subP
=
cb
.
and
(
subP
,
cb
.
isTrue
(
subRoot
.
get
(
Process_
.
editionEnable
)));
subquery
.
select
(
subRoot
).
where
(
subP
);
p
=
cb
.
and
(
p
,
cb
.
not
(
cb
.
exists
(
subquery
)));
cq
.
distinct
(
true
).
select
(
root
.
get
(
Process_
.
edition
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
Process_
.
edition
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
().
stream
().
distinct
().
collect
(
Collectors
.
toList
());
}
public
Process
getEnabledProcess
(
String
application
,
String
edition
)
throws
Exception
{
...
...
@@ -97,7 +93,7 @@ public class ProcessFactory extends AbstractFactory {
p
=
cb
.
and
(
p
,
cb
.
isTrue
(
root
.
get
(
Process_
.
editionEnable
)));
cq
.
select
(
root
).
where
(
p
).
orderBy
(
cb
.
desc
(
root
.
get
(
Process_
.
editionNumber
)));
List
<
Process
>
list
=
em
.
createQuery
(
cq
).
getResultList
();
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
if
(
list
!=
null
&&
!
list
.
isEmpty
())
{
return
list
.
get
(
0
);
}
return
null
;
...
...
@@ -110,16 +106,16 @@ public class ProcessFactory extends AbstractFactory {
}
public
Double
getMaxEditionNumber
(
String
application
,
String
edition
)
throws
Exception
{
if
(
StringUtils
.
isNotEmpty
(
edition
)){
if
(
StringUtils
.
isNotEmpty
(
edition
))
{
EntityManager
em
=
this
.
entityManagerContainer
().
get
(
Process
.
class
);
CriteriaBuilder
cb
=
em
.
getCriteriaBuilder
();
CriteriaQuery
<
Double
>
cq
=
cb
.
createQuery
(
Double
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Process_
.
application
),
application
);
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
edition
),
edition
));
p
=
cb
.
and
(
p
,
cb
.
equal
(
root
.
get
(
Process_
.
edition
),
edition
));
cq
.
select
(
cb
.
max
(
root
.
get
(
Process_
.
editionNumber
))).
where
(
p
);
Double
max
=
em
.
createQuery
(
cq
).
getSingleResult
();
if
(
max
==
null
||
max
<
1.0
)
{
if
(
max
==
null
||
max
<
1.0
)
{
max
=
1.0
;
}
return
max
;
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionApplicationDictOrphan.java
浏览文件 @
481b7c67
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.designer.jaxrs.elementtool;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -49,8 +50,8 @@ class ActionApplicationDictOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ApplicationDict
>
root
=
cq
.
from
(
ApplicationDict
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
ApplicationDict_
.
application
).
in
(
applicationIds
));
cq
.
select
(
root
.
get
(
ApplicationDict_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
ApplicationDict_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
private
List
<
String
>
listOrphanApplicationDictItem
(
Business
business
,
List
<
String
>
applicationDictIds
)
...
...
@@ -60,8 +61,8 @@ class ActionApplicationDictOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
ApplicationDictItem
>
root
=
cq
.
from
(
ApplicationDictItem
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
ApplicationDictItem_
.
bundle
).
in
(
applicationDictIds
));
cq
.
select
(
root
.
get
(
ApplicationDictItem_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
ApplicationDictItem_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
public
static
class
WoApplicationDict
extends
ApplicationDict
{
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionFormOrphan.java
浏览文件 @
481b7c67
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.designer.jaxrs.elementtool;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -47,8 +48,8 @@ class ActionFormOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Form
>
root
=
cq
.
from
(
Form
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
Form_
.
application
).
in
(
applicationIds
));
cq
.
select
(
root
.
get
(
Form_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
Form_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
private
List
<
String
>
listOrphanFormField
(
Business
business
,
List
<
String
>
formIds
)
throws
Exception
{
...
...
@@ -57,8 +58,8 @@ class ActionFormOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
FormField
>
root
=
cq
.
from
(
FormField
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
FormField_
.
form
).
in
(
formIds
));
cq
.
select
(
root
.
get
(
FormField_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
FormField_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
public
static
class
WoForm
extends
Form
{
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionProcessOrphan.java
浏览文件 @
481b7c67
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.designer.jaxrs.elementtool;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -88,8 +89,8 @@ class ActionProcessOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Process
>
root
=
cq
.
from
(
Process
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
Process_
.
application
).
in
(
applicationIds
));
cq
.
select
(
root
.
get
(
Process_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
Process_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
private
<
T
extends
JpaObject
,
W
>
List
<
String
>
listOrphanProcessElement
(
Business
business
,
List
<
String
>
processIds
,
...
...
@@ -99,8 +100,8 @@ class ActionProcessOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
T
>
root
=
cq
.
from
(
copier
.
getOrigClass
());
Predicate
p
=
cb
.
not
(
root
.
get
(
Agent
.
process_FIELDNAME
).
in
(
processIds
));
cq
.
select
(
root
.
get
(
JpaObject
.
id_FIELDNAME
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
JpaObject
.
id_FIELDNAME
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
public
static
class
WoProcess
extends
Process
{
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/elementtool/ActionScriptOrphan.java
浏览文件 @
481b7c67
...
...
@@ -2,6 +2,7 @@ package com.x.processplatform.assemble.designer.jaxrs.elementtool;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
javax.persistence.EntityManager
;
import
javax.persistence.criteria.CriteriaBuilder
;
...
...
@@ -43,8 +44,8 @@ class ActionScriptOrphan extends BaseAction {
CriteriaQuery
<
String
>
cq
=
cb
.
createQuery
(
String
.
class
);
Root
<
Script
>
root
=
cq
.
from
(
Script
.
class
);
Predicate
p
=
cb
.
not
(
root
.
get
(
Script_
.
application
).
in
(
applicationIds
));
cq
.
select
(
root
.
get
(
Script_
.
id
)).
where
(
p
)
.
distinct
(
true
)
;
return
em
.
createQuery
(
cq
).
getResultList
();
cq
.
select
(
root
.
get
(
Script_
.
id
)).
where
(
p
);
return
em
.
createQuery
(
cq
).
getResultList
()
.
stream
().
distinct
().
collect
(
Collectors
.
toList
())
;
}
public
static
class
WoScript
extends
Script
{
...
...
o2server/x_processplatform_assemble_designer/src/main/java/com/x/processplatform/assemble/designer/jaxrs/input/BaseAction.java
浏览文件 @
481b7c67
...
...
@@ -24,8 +24,8 @@ abstract class BaseAction extends StandardJaxrsAction {
// protected Ehcache inputCache = ApplicationCache.instance().getCache(BaseAction.class.getName(), 100,
// ApplicationCache.MINUTES_20, ApplicationCache.MINUTES_20);
protected
CacheCategory
cacheCategory
=
new
CacheCategory
(
BaseAction
.
class
);
protected
CacheCategory
cacheCategory
=
new
CacheCategory
(
BaseAction
.
class
);
public
enum
Method
{
cover
,
create
,
ignore
;
...
...
@@ -51,7 +51,7 @@ abstract class BaseAction extends StandardJaxrsAction {
CriteriaQuery
<
Application
>
cq
=
cb
.
createQuery
(
Application
.
class
);
Root
<
Application
>
root
=
cq
.
from
(
Application
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Application_
.
alias
),
alias
);
List
<
Application
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)
.
distinct
(
true
)
).
getResultList
();
List
<
Application
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
();
if
(
os
.
size
()
==
1
)
{
return
os
.
get
(
0
);
}
else
{
...
...
@@ -68,7 +68,7 @@ abstract class BaseAction extends StandardJaxrsAction {
CriteriaQuery
<
Application
>
cq
=
cb
.
createQuery
(
Application
.
class
);
Root
<
Application
>
root
=
cq
.
from
(
Application
.
class
);
Predicate
p
=
cb
.
equal
(
root
.
get
(
Application_
.
name
),
name
);
List
<
Application
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)
.
distinct
(
true
)
).
getResultList
();
List
<
Application
>
os
=
em
.
createQuery
(
cq
.
select
(
root
).
where
(
p
)).
getResultList
();
if
(
os
.
size
()
==
1
)
{
return
os
.
get
(
0
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录