Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b2e4836a
authored
Oct 24, 2013
by
Tuomas Riihimäki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Print sorting
1 parent
5c87ae42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/PrintedCardFacade.java
View file @
b2e4836
...
@@ -15,6 +15,7 @@ import javax.persistence.criteria.Root;
...
@@ -15,6 +15,7 @@ import javax.persistence.criteria.Root;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.beans.EventBeanLocal
;
import
fi.codecrew.moya.enums.CardState
;
import
fi.codecrew.moya.enums.CardState
;
import
fi.codecrew.moya.model.CardTemplate_
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.EventUser
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.LanEvent
;
import
fi.codecrew.moya.model.PrintedCard
;
import
fi.codecrew.moya.model.PrintedCard
;
...
@@ -98,8 +99,10 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
...
@@ -98,8 +99,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
);
cq
.
select
(
root
).
distinct
(
true
);
List
<
Predicate
>
preds
=
new
ArrayList
<
Predicate
>();
List
<
Predicate
>
preds
=
new
ArrayList
<
Predicate
>();
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
)
{
...
@@ -107,6 +110,7 @@ public class PrintedCardFacade extends IntegerPkGenericFacade<PrintedCard> {
...
@@ -107,6 +110,7 @@ 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
)));
return
getEm
().
createQuery
(
cq
).
getResultList
();
return
getEm
().
createQuery
(
cq
).
getResultList
();
...
...
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