Implémentation d'une méthode qui permet de récupérer tous les utilisateurs ayant un rôle dans une conférence donnée.

This commit is contained in:
Frederic Debuire
2008-02-10 14:52:31 +00:00
parent 4c6181a523
commit 5087083ffa
2 changed files with 8 additions and 6 deletions

View File

@@ -29,7 +29,7 @@ public interface IUserManager {
// Lists methods
public List<User> getUsers();
public List<User> getUsers(Conference conf);
public List<User> getUsers(int conf_id);
public List<User> getUsers(int conf_id, Role.RoleType type);
public List<User> getRefereesOFPCMemberForArticle(String PCMemberLogin, Integer articleId);
public List<User> getPCMemberForArticle(Integer articleId);

View File

@@ -95,9 +95,12 @@ public class UserManagerBean implements IUserManager{
return (this.getUser(login)!= null);
}
public List<User> getUsers(Conference conf) {
// TODO Auto-generated method stub
return null;
@SuppressWarnings("unchecked")
public List<User> getUsers(int conf_id) {
Query query = em.createQuery("select user from Role role where role.conference = ?");
Conference conference = em.find(Conference.class, conf_id);
query.setParameter(1, conference);
return query.getResultList();
}
@SuppressWarnings("unchecked")
@@ -109,7 +112,6 @@ public class UserManagerBean implements IUserManager{
return query.getResultList();
}
@SuppressWarnings("unchecked")
public List<User> getPCMemberForArticle(Integer articleId){
//select p from Paper p join p.referees r where r.login=:aLogin and p.conference=:aConf