Policy failures:
Code warning - failed on resource UserManagerBean.java. Reason: Type safety: The expression of type List needs unchecked conversion to conform to List<Role>, line 71 - failed on resource ConferenceManagerBean.java. Reason: Type safety: The expression of type List needs unchecked conversion to conform to List<Role>, line 8 Override reason: d
This commit is contained in:
@@ -7,7 +7,7 @@ import javax.ejb.Stateless;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.NoResultException;
|
||||
import javax.persistence.PersistenceContext;
|
||||
import javax.persistence.Query;
|
||||
|
||||
|
||||
import org.yacos.core.users.User;
|
||||
|
||||
@@ -26,7 +26,9 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
|
||||
}
|
||||
|
||||
public Article addArticle(Article a) {
|
||||
public Article addArticle(int reference, String title, String topic,String url_article,
|
||||
String mainAuthor, List<String> secondaryAuthor, int state) {
|
||||
Article a = new Article(reference, title, topic, url_article, mainAuthor, secondaryAuthor, state);
|
||||
em.persist(a);
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,13 @@ package org.yacos.core.article;
|
||||
|
||||
import java.util.List;
|
||||
import javax.ejb.Remote;
|
||||
import javax.persistence.EntityManager;
|
||||
|
||||
|
||||
@Remote
|
||||
public interface IArticleManager {
|
||||
public Article getArticle(Integer id);
|
||||
public Article addArticle(Article a);
|
||||
public Article addArticle(int reference, String title, String topic,String url_article,
|
||||
String mainAuthor, List<String> secondaryAuthor, int state);
|
||||
public void removeArticle(Article a);
|
||||
public void updateArticle(Article article);
|
||||
public List<Article> getArticles();
|
||||
|
||||
@@ -65,6 +65,7 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
|
||||
public void addRole(Role.RoleType roleType, User user, Conference conf) {
|
||||
Role role = new Role(roleType, user, conf);
|
||||
System.out.println(role);
|
||||
em.persist(role);
|
||||
}
|
||||
|
||||
@@ -76,6 +77,8 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
em.merge(role);
|
||||
}
|
||||
|
||||
//FIXME
|
||||
//methode utile?
|
||||
public List<Role> getRoles(){
|
||||
return em.createQuery("from Role role").getResultList();
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@ package org.yacos.core.users;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.users.Role.RoleType;
|
||||
|
||||
@@ -19,10 +23,16 @@ public class RolePK implements Serializable{
|
||||
/**
|
||||
* Public key, as described here : http://www.jpox.org/docs/1_2/primary_key.html
|
||||
*/
|
||||
@Id
|
||||
@ManyToOne(targetEntity=User.class,optional=false)
|
||||
@JoinColumn(name="user_id",nullable=false)
|
||||
public User user;
|
||||
/**
|
||||
* Public key, as described here : http://www.jpox.org/docs/1_2/primary_key.html
|
||||
*/
|
||||
@Id
|
||||
@ManyToOne(targetEntity=Conference.class,optional=false)
|
||||
@JoinColumn(name="conference_id",nullable=false)
|
||||
public Conference conference;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -68,7 +68,7 @@ public class UserManagerBean implements IUserManager{
|
||||
|
||||
public List<Role> getRoles() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
return em.createQuery("from Role").getResultList();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user