Policy failures:
Code warning - failed on resource ConferenceManagerBean.java. Reason: The import java.util.Collection is never used, line 3 - failed on resource ConferenceManagerBean.java. Reason: Type safety: The expression of type List needs unchecked conversion to conform to List<Role>, line 6 Override reason: f
This commit is contained in:
@@ -2,22 +2,19 @@ package org.yacos.core.conferences;
|
|||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Entity;
|
import javax.persistence.Entity;
|
||||||
import javax.persistence.GeneratedValue;
|
import javax.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import javax.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import javax.persistence.Id;
|
||||||
import javax.persistence.JoinColumn;
|
|
||||||
import javax.persistence.OneToMany;
|
import javax.persistence.OneToMany;
|
||||||
import javax.persistence.OneToOne;
|
|
||||||
import javax.persistence.Temporal;
|
import javax.persistence.Temporal;
|
||||||
import javax.persistence.TemporalType;
|
import javax.persistence.TemporalType;
|
||||||
|
|
||||||
import org.yacos.core.article.Article;
|
import org.yacos.core.article.Article;
|
||||||
import org.yacos.core.users.Role;
|
import org.yacos.core.users.Role;
|
||||||
import org.yacos.core.users.User;
|
|
||||||
|
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@@ -46,14 +43,14 @@ public class Conference implements Serializable{
|
|||||||
* Roles of users for this conference
|
* Roles of users for this conference
|
||||||
*/
|
*/
|
||||||
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
||||||
private Collection<Role> roles;
|
private List<Role> roles;
|
||||||
|
|
||||||
/* @OneToOne(targetEntity=User.class,optional=true)
|
/* @OneToOne(targetEntity=User.class,optional=true)
|
||||||
@JoinColumn(name="chairman_id",nullable=true)
|
@JoinColumn(name="chairman_id",nullable=true)
|
||||||
private User chairman;
|
private User chairman;
|
||||||
*/
|
*/
|
||||||
@OneToMany(targetEntity=Article.class,mappedBy="conference")
|
@OneToMany(targetEntity=Article.class,mappedBy="conference")
|
||||||
private Collection<Article> articles;
|
private List<Article> articles;
|
||||||
/*
|
/*
|
||||||
/**
|
/**
|
||||||
* @return the chairman
|
* @return the chairman
|
||||||
@@ -158,22 +155,22 @@ public class Conference implements Serializable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@OneToMany(targetEntity=Article.class,mappedBy="articles")
|
@OneToMany(targetEntity=Article.class,mappedBy="articles")
|
||||||
public void setArticles(Collection<Article> articles) {
|
public void setArticles(List<Article> articles) {
|
||||||
this.articles = articles;
|
this.articles = articles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OneToMany(targetEntity=Article.class,mappedBy="articles")
|
@OneToMany(targetEntity=Article.class,mappedBy="articles")
|
||||||
public Collection<Article> getArticles() {
|
public List<Article> getArticles() {
|
||||||
return articles;
|
return articles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
||||||
public Collection<Role> getRoles() {
|
public List<Role> getRoles() {
|
||||||
return roles;
|
return roles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
@OneToMany(targetEntity=Role.class,mappedBy="conference")
|
||||||
public void setRoles(Collection<Role> roles) {
|
public void setRoles(List<Role> roles) {
|
||||||
this.roles = roles;
|
this.roles = roles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class ConferenceManagerBean implements IConferenceManager {
|
|||||||
em.merge(conf);
|
em.merge(conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<Article> getArticles(Integer conference_id) {
|
public List<Article> getArticles(Integer conference_id) {
|
||||||
//FIXME cast a verifier lors des tests
|
//FIXME cast a verifier lors des tests
|
||||||
return getConference(conference_id).getArticles();
|
return getConference(conference_id).getArticles();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public interface IConferenceManager {
|
|||||||
//CRUD methodes
|
//CRUD methodes
|
||||||
public Conference addConference(String titre, String descirption, String infoComplementray, Date dataAbstract, Date dateArticle, Date dateEvaluation, Date dateStart, Date dateEnd);
|
public Conference addConference(String titre, String descirption, String infoComplementray, Date dataAbstract, Date dateArticle, Date dateEvaluation, Date dateStart, Date dateEnd);
|
||||||
public Conference getConference(Integer id);
|
public Conference getConference(Integer id);
|
||||||
public Collection<Conference> getConferences();
|
public List<Conference> getConferences();
|
||||||
public void remove(Conference conf);
|
public void remove(Conference conf);
|
||||||
public void update(Conference conf);
|
public void update(Conference conf);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user