Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Codecrew
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
30
Merge Requests
2
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 70882ce7
authored
Oct 24, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not show disabled cards.
1 parent
b51948dd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
View file @
70882ce
...
@@ -3,7 +3,6 @@ package fi.codecrew.moya.facade;
...
@@ -3,7 +3,6 @@ package fi.codecrew.moya.facade;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.List
;
import
javax.ejb.EJB
;
import
javax.ejb.EJB
;
...
@@ -101,9 +100,10 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
...
@@ -101,9 +100,10 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
PrintedCard
>
cq
=
cb
.
createQuery
(
PrintedCard
.
class
);
CriteriaQuery
<
PrintedCard
>
cq
=
cb
.
createQuery
(
PrintedCard
.
class
);
Root
<
PrintedCard
>
root
=
cq
.
from
(
PrintedCard
.
class
);
Root
<
PrintedCard
>
root
=
cq
.
from
(
PrintedCard
.
class
);
List
<
Predicate
>
preds
=
new
ArrayList
<
Predicate
>();
List
<
Predicate
>
preds
=
new
ArrayList
<
Predicate
>();
preds
.
add
(
cb
.
isTrue
(
root
.
get
(
PrintedCard_
.
enabled
)));
preds
.
add
(
cb
.
equal
(
root
.
get
(
PrintedCard_
.
event
),
eventbean
.
getCurrentEvent
()));
preds
.
add
(
cb
.
equal
(
root
.
get
(
PrintedCard_
.
event
),
eventbean
.
getCurrentEvent
()));
if
(
state
.
length
>
0
)
{
if
(
state
.
length
>
0
)
{
...
@@ -111,15 +111,15 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
...
@@ -111,15 +111,15 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
}
}
cq
.
where
(
preds
.
toArray
(
new
Predicate
[
preds
.
size
()]));
cq
.
where
(
preds
.
toArray
(
new
Predicate
[
preds
.
size
()]));
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
PrintedCard_
.
user
)),
cb
.
asc
(
root
.
get
(
PrintedCard_
.
template
).
get
(
CardTemplate_
.
power
)));
cq
.
orderBy
(
cb
.
asc
(
root
.
get
(
PrintedCard_
.
template
).
get
(
CardTemplate_
.
power
)));
List
<
PrintedCard
>
pcl
=
getEm
().
createQuery
(
cq
).
getResultList
();
List
<
PrintedCard
>
pcl
=
getEm
().
createQuery
(
cq
).
getResultList
();
HashMap
<
Integer
,
PrintedCard
>
pch
=
new
HashMap
<>();
HashMap
<
Integer
,
PrintedCard
>
pch
=
new
HashMap
<>();
for
(
PrintedCard
pc
:
pcl
)
{
for
(
PrintedCard
pc
:
pcl
)
{
pch
.
put
(
pc
.
getUser
().
getId
(),
pc
);
pch
.
put
(
pc
.
getUser
().
getId
(),
pc
);
}
}
return
new
ArrayList
<
PrintedCard
>(
pch
.
values
());
return
new
ArrayList
<
PrintedCard
>(
pch
.
values
());
}
}
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment