Policy failures:
Code warning - failed on resource User.java. Reason: The import javax.persistence.FetchType is never used, line 10 - failed on resource UserManagerBean.java. Reason: Type safety: The expression of type List needs unchecked conversion to conform to List<User>, line 7 Override reason: f
This commit is contained in:
@@ -30,7 +30,7 @@ public interface IConferenceManager {
|
||||
|
||||
|
||||
//role et user methode
|
||||
public void addRole(Role.RoleType roleType, String login, Integer confId);
|
||||
public Role addRole(Role.RoleType roleType, String login, Integer confId);
|
||||
public void removeRole(Role role);
|
||||
public List<Role> getRoles(Conference conf);
|
||||
public List<Role> getRoles(User user, Conference conf);
|
||||
|
||||
@@ -4,10 +4,10 @@ import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class User implements Serializable{
|
||||
* Roles for this user
|
||||
*/
|
||||
//@OneToMany(targetEntity=Role.class,mappedBy="user",fetch=FetchType.EAGER,cascade=CascadeType.ALL)
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user",cascade=CascadeType.ALL)
|
||||
private List<Role> roles;
|
||||
|
||||
@OneToMany(targetEntity=Article.class,mappedBy="mainAuthor")
|
||||
|
||||
@@ -74,8 +74,9 @@ public class UserManagerBean implements IUserManager{
|
||||
}
|
||||
|
||||
public List<User> getUsers(RoleType type) {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
Query query = em.createQuery("from Role role where type = ?");
|
||||
query.setParameter(1, type);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
public List<Role> getRoles() {
|
||||
|
||||
Reference in New Issue
Block a user