This commit is contained in:
@@ -5,6 +5,7 @@ import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
@@ -13,7 +14,6 @@ import javax.persistence.OneToMany;
|
||||
import javax.persistence.Temporal;
|
||||
import javax.persistence.TemporalType;
|
||||
|
||||
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.evaluation.Criterion;
|
||||
import org.yacos.core.users.Role;
|
||||
@@ -54,7 +54,7 @@ public class Conference implements Serializable{
|
||||
@OneToMany(targetEntity=Article.class,mappedBy="conference")
|
||||
private List<Article> articles;
|
||||
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference")
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference",cascade=CascadeType.ALL)
|
||||
private List<Criterion> criterions;
|
||||
|
||||
/*
|
||||
@@ -193,12 +193,12 @@ public class Conference implements Serializable{
|
||||
/*
|
||||
* criterions
|
||||
*/
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference")
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference",cascade=CascadeType.ALL)
|
||||
public List<Criterion> getCriterions() {
|
||||
return criterions;
|
||||
}
|
||||
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference")
|
||||
@OneToMany(targetEntity=Criterion.class,mappedBy="conference",cascade=CascadeType.ALL)
|
||||
public void setCriterions(List<Criterion> criterions) {
|
||||
this.criterions = criterions;
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package org.yacos.core.conferences;
|
||||
|
||||
public class ConferenceDoesntExistException extends Exception {
|
||||
|
||||
}
|
||||
@@ -21,6 +21,7 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
public Conference addConference(String titre, String descirption, String infoComplementray, Date dataAbstract, Date dateArticle, Date dateEvaluation, Date dateStart, Date dateEnd) {
|
||||
Conference conf = new Conference(titre, descirption, infoComplementray, dataAbstract, dateArticle, dateEvaluation, dateStart, dateEnd);
|
||||
em.persist(conf);
|
||||
em.flush();
|
||||
return conf;
|
||||
}
|
||||
|
||||
@@ -31,10 +32,12 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
public void remove(Integer conferenceId) {
|
||||
Conference persistedConf = em.find(Conference.class, conferenceId);
|
||||
em.remove(persistedConf);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public void update(Conference conf) {
|
||||
em.merge(conf);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -58,7 +61,7 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
|
||||
/*
|
||||
*
|
||||
* m<>thodes relatives aux roles
|
||||
* m<>thodes relatives aux roles
|
||||
* */
|
||||
|
||||
public void addRole(Role.RoleType roleType, String login, Integer confId) {
|
||||
@@ -66,14 +69,17 @@ public class ConferenceManagerBean implements IConferenceManager {
|
||||
Conference conf = em.find(Conference.class, confId);
|
||||
Role role = new Role(roleType, user, conf);
|
||||
em.persist(role);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public void removeRole(Role role) {
|
||||
em.remove(role);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public void updateRole(Role role){
|
||||
em.merge(role);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user