Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Max Mecklin
/
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 9025e382
authored
May 17, 2014
by
Juho Juopperi
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'votelistfix' into 'master'
Votelistfix
2 parents
d1e979ff
7c81f2f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/VotingBean.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/CompoEntryFacade.java
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/VotingBeanLocal.java
code/MoyaBeans/ejbModule/fi/codecrew/moya/beans/VotingBean.java
View file @
9025e38
...
...
@@ -190,4 +190,9 @@ public class VotingBean implements VotingBeanLocal {
compoEntryFileFacade
.
create
(
cef
);
}
@Override
public
List
<
CompoEntry
>
getEntriesForCurrentUser
()
{
EventUser
user
=
permissionBean
.
getCurrentUser
();
return
compoEntryFacade
.
findUsersEntries
(
user
);
}
}
code/MoyaBeans/ejbModule/fi/codecrew/moya/facade/CompoEntryFacade.java
View file @
9025e38
package
fi
.
codecrew
.
moya
.
facade
;
import
java.util.List
;
import
javax.ejb.LocalBean
;
import
javax.ejb.Stateless
;
import
javax.persistence.criteria.CriteriaBuilder
;
import
javax.persistence.criteria.CriteriaQuery
;
import
javax.persistence.criteria.Root
;
import
fi.codecrew.moya.model.CompoEntry
;
import
fi.codecrew.moya.model.CompoEntry_
;
import
fi.codecrew.moya.model.EventUser
;
@Stateless
@LocalBean
...
...
@@ -14,4 +21,11 @@ public class CompoEntryFacade extends IntegerPkGenericFacade<CompoEntry> {
super
(
CompoEntry
.
class
);
}
public
List
<
CompoEntry
>
findUsersEntries
(
EventUser
user
)
{
CriteriaBuilder
cb
=
getEm
().
getCriteriaBuilder
();
CriteriaQuery
<
CompoEntry
>
cq
=
cb
.
createQuery
(
CompoEntry
.
class
);
Root
<
CompoEntry
>
root
=
cq
.
from
(
CompoEntry
.
class
);
cq
.
where
(
cb
.
equal
(
root
.
get
(
CompoEntry_
.
creator
),
user
));
return
getEm
().
createQuery
(
cq
).
getResultList
();
}
}
code/MoyaBeansClient/ejbModule/fi/codecrew/moya/beans/VotingBeanLocal.java
View file @
9025e38
...
...
@@ -39,4 +39,6 @@ public interface VotingBeanLocal {
public
void
create
(
CompoEntryFile
cef
);
public
List
<
CompoEntry
>
getEntriesForCurrentUser
();
}
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