Policy failures:
Code warning - failed on resource Report.java. Reason: The import javax.persistence.CascadeType is never used, line 9 - failed on resource Report.java. Reason: The import javax.persistence.FetchType is never used, line 11 - failed on resource UserManagerBean.java. Reason: The import org.yacos.core.article.Article is never used, line 15 - failed on resource Article.java. Reason: The import org.yacos.core.users.Role is never used, line 2 Override reason: u
This commit is contained in:
@@ -2,7 +2,6 @@ package org.yacos.core.article;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
@@ -20,6 +19,7 @@ import javax.persistence.OneToMany;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.evaluation.Report;
|
||||
import org.yacos.core.users.Role;
|
||||
import org.yacos.core.users.User;
|
||||
|
||||
@Entity
|
||||
@@ -37,8 +37,8 @@ public class Article implements Serializable {
|
||||
private String topic;
|
||||
private String URL_article;
|
||||
|
||||
//@ManyToOne(targetEntity=Conference.class)
|
||||
//@JoinColumn(name="mainAuthor",nullable=false)
|
||||
@ManyToOne(targetEntity=Conference.class)
|
||||
@JoinColumn(name="mainAuthor",nullable=false)
|
||||
private User mainAuthor;
|
||||
|
||||
private ArrayList<String> secondaryAuthors;
|
||||
@@ -50,16 +50,8 @@ public class Article implements Serializable {
|
||||
@JoinColumn(name="conference_id",nullable=false)
|
||||
private Conference conference;
|
||||
|
||||
/**
|
||||
* The referees reviewing this article
|
||||
*/
|
||||
@ManyToMany(targetEntity=User.class)
|
||||
@JoinTable(
|
||||
name="articles_referees_map",
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
private Collection<User> referees;
|
||||
@OneToMany(cascade=CascadeType.ALL, targetEntity=Delegation.class, mappedBy="article")
|
||||
private List<Delegation> delegation;
|
||||
|
||||
/**
|
||||
* The PC Members responsible for this article evaluation
|
||||
@@ -70,13 +62,13 @@ public class Article implements Serializable {
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
private Collection<User> pcMembers;
|
||||
private List<User> pcMembers;
|
||||
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article")
|
||||
private Collection<Preference> preferences;
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article", cascade=CascadeType.ALL)
|
||||
private List<Preference> preferences;
|
||||
|
||||
@OneToMany(targetEntity=Report.class, mappedBy="article", cascade=CascadeType.ALL)
|
||||
private Collection<Report> report;
|
||||
private List<Report> report;
|
||||
|
||||
|
||||
public enum State {
|
||||
@@ -105,7 +97,6 @@ public class Article implements Serializable {
|
||||
this.secondaryAuthors = new ArrayList<String>();
|
||||
}
|
||||
this.state = state;
|
||||
referees = new ArrayList<User>();
|
||||
pcMembers = new ArrayList<User>();
|
||||
this.conference = conference;
|
||||
}
|
||||
@@ -160,7 +151,7 @@ public class Article implements Serializable {
|
||||
return secondaryAuthors;
|
||||
}
|
||||
|
||||
public void setSecondaryAuthors(List<String> secondaryAuthors) {
|
||||
public void setSecondaryAuthors(ArrayList<String> secondaryAuthors) {
|
||||
this.secondaryAuthors = new ArrayList<String>(secondaryAuthors);
|
||||
}
|
||||
|
||||
@@ -174,36 +165,13 @@ public class Article implements Serializable {
|
||||
this.state=state;
|
||||
}
|
||||
|
||||
@ManyToMany(targetEntity=User.class)
|
||||
@JoinTable(
|
||||
name="articles_referees_map",
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
public Collection<User> getReferees(){
|
||||
return referees;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param referees the referees to set
|
||||
*/
|
||||
@ManyToMany(targetEntity=User.class)
|
||||
@JoinTable(
|
||||
name="articles_referees_map",
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
public void setReferees(Collection<User> referees) {
|
||||
this.referees = referees;
|
||||
}
|
||||
|
||||
@ManyToMany(targetEntity=User.class)
|
||||
@JoinTable(
|
||||
name="articles_pcmembers_map",
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
public Collection<User> getPCMembers(){
|
||||
public List<User> getPcMembers() {
|
||||
return pcMembers;
|
||||
}
|
||||
@ManyToMany(targetEntity=User.class)
|
||||
@@ -212,10 +180,9 @@ public class Article implements Serializable {
|
||||
joinColumns=@JoinColumn(name="user_id"),
|
||||
inverseJoinColumns=@JoinColumn(name="article_id")
|
||||
)
|
||||
public void setPCMembers(Collection<User> pcMembers){
|
||||
public void setPcMembers(List<User> pcMembers) {
|
||||
this.pcMembers = pcMembers;
|
||||
}
|
||||
|
||||
public void addPCMember(User pcMember){
|
||||
if(! pcMembers.contains(pcMember)){
|
||||
pcMembers.add(pcMember);
|
||||
@@ -229,11 +196,11 @@ public class Article implements Serializable {
|
||||
}
|
||||
|
||||
public void delegateTo(User referee, User pcMember) {
|
||||
if(pcMembers.contains(pcMember)){
|
||||
/* if(pcMembers.contains(pcMember)){
|
||||
if(! referees.contains(referee)){
|
||||
referees.add(referee);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@ManyToOne(targetEntity=Conference.class)
|
||||
@JoinColumn(name="conference_id",nullable=false)
|
||||
@@ -249,16 +216,16 @@ public class Article implements Serializable {
|
||||
/**
|
||||
* @return the preferences
|
||||
*/
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article")
|
||||
public Collection<Preference> getPreferences() {
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article", cascade=CascadeType.ALL)
|
||||
public List<Preference> getPreferences() {
|
||||
return preferences;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param preferences the preferences to set
|
||||
*/
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article")
|
||||
public void setPreferences(Collection<Preference> preferences) {
|
||||
@OneToMany(targetEntity=Preference.class,mappedBy="article", cascade=CascadeType.ALL)
|
||||
public void setPreferences(List<Preference> preferences) {
|
||||
this.preferences = preferences;
|
||||
}
|
||||
|
||||
@@ -266,12 +233,24 @@ public class Article implements Serializable {
|
||||
return false;
|
||||
}
|
||||
|
||||
@OneToMany(targetEntity=Report.class, mappedBy="article")
|
||||
public Collection<Report> getReport() {
|
||||
@OneToMany(targetEntity=Report.class, mappedBy="article", cascade=CascadeType.ALL)
|
||||
public List<Report> getReport() {
|
||||
return report;
|
||||
}
|
||||
@OneToMany(targetEntity=Report.class, mappedBy="article")
|
||||
public void setReport(Collection<Report> report) {
|
||||
@OneToMany(targetEntity=Report.class, mappedBy="article", cascade=CascadeType.ALL)
|
||||
public void setReport(List<Report> report) {
|
||||
this.report = report;
|
||||
}
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL, targetEntity=Delegation.class, mappedBy="article")
|
||||
public List<Delegation> getDelegation() {
|
||||
return delegation;
|
||||
}
|
||||
|
||||
@OneToMany(cascade=CascadeType.ALL, targetEntity=Delegation.class, mappedBy="article")
|
||||
public void setDelegation(List<Delegation> delegation) {
|
||||
this.delegation = delegation;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.yacos.core.article;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Stateless;
|
||||
@@ -34,7 +35,7 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
}
|
||||
|
||||
public Article addArticle(String title, String topic,String url_article,
|
||||
String mainAuthorLogin, List<String> secondaryAuthors, State state,Integer conferenceId) {
|
||||
String mainAuthorLogin, ArrayList<String> secondaryAuthors, State state,Integer conferenceId) {
|
||||
Article a = new Article();
|
||||
a.setTitle(title);
|
||||
a.setTopic(topic);
|
||||
@@ -110,7 +111,7 @@ public class ArticleManagerBean implements IArticleManager, Serializable {
|
||||
|
||||
public List<User> getArticlePCMembers(Integer articleId) {
|
||||
Article article = this.getArticle(articleId);
|
||||
List<User> users = (List<User>)article.getPCMembers();
|
||||
List<User> users = (List<User>)article.getPcMembers();
|
||||
return users;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.yacos.core.article;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
@@ -7,7 +8,6 @@ import javax.ejb.Remote;
|
||||
import org.yacos.core.article.Article.State;
|
||||
import org.yacos.core.article.Preference.PreferenceType;
|
||||
import org.yacos.core.exceptions.ConferenceDoesntExistException;
|
||||
import org.yacos.core.users.User;
|
||||
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.yacos.core.users.User;
|
||||
public interface IArticleManager {
|
||||
public Article getArticle(Integer id);
|
||||
public Article addArticle(String title, String topic,String url_article,
|
||||
String mainauthor, List<String> secondaryAuthor, State state,Integer integer);
|
||||
String mainauthor, ArrayList<String> secondaryAuthor, State state,Integer integer);
|
||||
public void removeArticle(Integer articleId);
|
||||
public void updateArticle(Article article);
|
||||
|
||||
|
||||
@@ -41,6 +41,10 @@ public class Preference implements Serializable {
|
||||
LIKE,INDIFFERENT,DISLIKE,CONFLICT
|
||||
}
|
||||
|
||||
public Preference(){
|
||||
|
||||
}
|
||||
|
||||
private PreferenceType preferenceType;
|
||||
|
||||
/**
|
||||
@@ -75,7 +79,7 @@ public class Preference implements Serializable {
|
||||
public void setArticle(Article article) {
|
||||
this.article = article;
|
||||
}
|
||||
public PreferenceType getPreference() {
|
||||
public PreferenceType getPreferenceType() {
|
||||
return preferenceType;
|
||||
}
|
||||
public void setPreferenceType(PreferenceType preferenceType) {
|
||||
|
||||
@@ -80,8 +80,6 @@ public class Criterion implements Serializable {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return the name of this criterion
|
||||
*/
|
||||
@@ -96,32 +94,19 @@ public class Criterion implements Serializable {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the minimum value for this criterion
|
||||
*/
|
||||
public Integer getMin() {
|
||||
|
||||
public Integer getMin_rating() {
|
||||
return min_rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param min the minimum value for this criterion
|
||||
*/
|
||||
public void setMin(Integer min) {
|
||||
this.min_rating = min;
|
||||
public void setMin_rating(Integer min_rating) {
|
||||
this.min_rating = min_rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the maximum value for this criterion
|
||||
*/
|
||||
public Integer getMax() {
|
||||
public Integer getMax_rating() {
|
||||
return max_rating;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param max the maximum value for this criterion
|
||||
*/
|
||||
public void setMax(Integer max) {
|
||||
this.max_rating = max;
|
||||
public void setMax_rating(Integer max_rating) {
|
||||
this.max_rating = max_rating;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ public class EvaluationManagerBean implements IEvaluationManager {
|
||||
cm = getConferenceManager();
|
||||
Criterion crit = new Criterion();
|
||||
crit.setName(name);
|
||||
crit.setMin(min_rating);
|
||||
crit.setMax(max_rating);
|
||||
crit.setMin_rating(min_rating);
|
||||
crit.setMax_rating(max_rating);
|
||||
crit.setConference(cm.getConference(confId));
|
||||
em.persist(crit);
|
||||
em.flush();
|
||||
@@ -165,4 +165,33 @@ public class EvaluationManagerBean implements IEvaluationManager {
|
||||
return q.getResultList();
|
||||
}
|
||||
|
||||
/*
|
||||
* rating methods
|
||||
*/
|
||||
|
||||
public Rating addRating(Integer value, Criterion criterion, Report report) {
|
||||
Rating rating = new Rating(value,criterion,report);
|
||||
em.persist(rating);
|
||||
em.flush();
|
||||
return rating;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public List<Rating> getRatingForReport(Integer reportId){
|
||||
Query q = em.createQuery("select r.ratings from Report r where r.id=?");
|
||||
q.setParameter(1, reportId);
|
||||
return q.getResultList();
|
||||
}
|
||||
public void removeRating(Criterion criterion, Report report) {
|
||||
Rating rating = em.find(Rating.class, new RatingPK(criterion,report));
|
||||
em.remove(rating);
|
||||
em.flush();
|
||||
}
|
||||
|
||||
public Rating updateRating(Rating rating) {
|
||||
em.merge(rating);
|
||||
em.flush();
|
||||
return rating;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -30,4 +30,9 @@ public interface IEvaluationManager {
|
||||
public Report getReportforArticleAndReferee(int articleId, String refereeLogin);
|
||||
public List<Report> getReportsForArticle(int articleId);
|
||||
public List<Report> getReportsForReferee(String refereeLogin);
|
||||
|
||||
public Rating addRating(Integer value,Criterion criterion,Report report);
|
||||
public void removeRating(Criterion criterion,Report report);
|
||||
public Rating updateRating(Rating rating);
|
||||
public List<Rating> getRatingForReport(Integer reportId);
|
||||
}
|
||||
|
||||
@@ -6,49 +6,49 @@ package org.yacos.core.evaluation;
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.IdClass;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
|
||||
/**
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@IdClass(RatingPK.class)
|
||||
public class Rating implements Serializable
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.AUTO)
|
||||
private Integer id;
|
||||
|
||||
private Integer value;
|
||||
@ManyToOne(targetEntity=Criterion.class,fetch=FetchType.EAGER)
|
||||
@Id
|
||||
@ManyToOne(targetEntity=Criterion.class)//,fetch=FetchType.EAGER)
|
||||
@JoinColumn(name="criterion_id",nullable=false)
|
||||
private Criterion criterion;
|
||||
|
||||
@Id
|
||||
@ManyToOne(targetEntity=Report.class)
|
||||
@JoinColumn(name="report_id",nullable=false)
|
||||
private Report report;
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
public Integer getId() {
|
||||
return id;
|
||||
private Integer value;
|
||||
|
||||
public Rating(){
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id the id to set
|
||||
*/
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
public Rating(Integer value, Criterion criterion, Report report) {
|
||||
super();
|
||||
this.value = value;
|
||||
this.criterion = criterion;
|
||||
this.report = report;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
@@ -95,4 +95,6 @@ public class Rating implements Serializable
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
45
YACOSCore/ejbModule/org/yacos/core/evaluation/RatingPK.java
Normal file
45
YACOSCore/ejbModule/org/yacos/core/evaluation/RatingPK.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package org.yacos.core.evaluation;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.ManyToOne;
|
||||
|
||||
public class RatingPK implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ManyToOne(targetEntity=Criterion.class)//,fetch=FetchType.EAGER)
|
||||
@JoinColumn(name="criterion_id",nullable=false)
|
||||
private Criterion criterion;
|
||||
|
||||
@ManyToOne(targetEntity=Report.class)
|
||||
@JoinColumn(name="report_id",nullable=false)
|
||||
private Report report;
|
||||
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (! (obj instanceof RatingPK) ) {
|
||||
return false;
|
||||
}
|
||||
RatingPK other = (RatingPK) obj;
|
||||
return this.criterion.getId().equals(other.criterion.getId()) &&
|
||||
this.report.getId() == other.report.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return this.criterion.getId().hashCode() ^ this.report.getId();
|
||||
}
|
||||
|
||||
public RatingPK(){
|
||||
super();
|
||||
}
|
||||
|
||||
public RatingPK(Criterion criterion, Report report) {
|
||||
super();
|
||||
this.criterion = criterion;
|
||||
this.report = report;
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,9 @@
|
||||
package org.yacos.core.evaluation;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -38,8 +38,8 @@ public class Report implements Serializable
|
||||
private String commentPCMember;
|
||||
private String commentAuthor;
|
||||
|
||||
@OneToMany(targetEntity=Rating.class,mappedBy="report",fetch=FetchType.EAGER)
|
||||
private Collection<Rating> ratings;
|
||||
@OneToMany(targetEntity=Rating.class,mappedBy="report")//, cascade=CascadeType.ALL, fetch=FetchType.EAGER)
|
||||
private List<Rating> ratings;
|
||||
|
||||
@ManyToOne(targetEntity=User.class)
|
||||
@JoinColumn(name="referee_id",nullable=false)
|
||||
@@ -58,7 +58,7 @@ public class Report implements Serializable
|
||||
}
|
||||
|
||||
public Report(String commentPCMember, String commentAuthor,
|
||||
Collection<Rating> ratings, User referee, Article article) {
|
||||
List<Rating> ratings, User referee, Article article) {
|
||||
super();
|
||||
this.commentPCMember = commentPCMember;
|
||||
this.commentAuthor = commentAuthor;
|
||||
@@ -140,15 +140,12 @@ public class Report implements Serializable
|
||||
this.article = article;
|
||||
}
|
||||
|
||||
public void addRating(Rating rating){
|
||||
ratings.add(rating);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the ratings
|
||||
*/
|
||||
@OneToMany(targetEntity=Rating.class,mappedBy="report")
|
||||
public Collection<Rating> getRatings() {
|
||||
public List<Rating> getRatings() {
|
||||
return ratings;
|
||||
}
|
||||
/**
|
||||
@@ -158,4 +155,6 @@ public class Report implements Serializable
|
||||
public void setRatings(List<Rating> ratings) {
|
||||
this.ratings = ratings;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,13 +28,8 @@ public class Role implements Serializable {
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Dummy field to make the composite PK work despite the ManyToOne relationship
|
||||
*/
|
||||
/*@Id
|
||||
@Column(name="user_id",insertable=false,updatable=false)
|
||||
private String user_id;
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* User for which this role is defined
|
||||
* Primary Key
|
||||
@@ -44,13 +39,7 @@ public class Role implements Serializable {
|
||||
@ManyToOne(targetEntity=User.class,optional=false)
|
||||
@JoinColumn(name="user_id",nullable=false)
|
||||
private User user;
|
||||
/**
|
||||
* Dummy field to make the composite PK work despite the ManyToOne relationship
|
||||
*/
|
||||
/*@Id
|
||||
@Column(name="conference_id",insertable=false,updatable=false)
|
||||
private Integer conference_id;
|
||||
*/
|
||||
|
||||
/**
|
||||
* Conference for which this role is defined
|
||||
* Primary Key
|
||||
@@ -91,7 +80,6 @@ public class Role implements Serializable {
|
||||
@JoinColumn(name="user_id",nullable=false)
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
//this.user_id = user.getLogin();
|
||||
}
|
||||
|
||||
@ManyToOne(targetEntity=Conference.class,optional=false)
|
||||
@@ -105,9 +93,8 @@ public class Role implements Serializable {
|
||||
@JoinColumn(name="conference_id",nullable=false)
|
||||
public void setConference(Conference conference) {
|
||||
this.conference = conference;
|
||||
//this.conference_id = conference.getId();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the type of this role
|
||||
|
||||
@@ -113,12 +113,9 @@ public class UserManagerBean implements IUserManager{
|
||||
@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
|
||||
//Query query = em.createQuery("select members from Article a join a.pcMembers members WHERE a.id = ?");
|
||||
//query.setParameter(1, articleId);
|
||||
//return query.getResultList();
|
||||
Article article = em.find(Article.class, articleId);
|
||||
return (List)article.getPCMembers();
|
||||
|
||||
Query query = em.createQuery("select a.pcMembers from Article a where a.id=?");
|
||||
query.setParameter(1, articleId);
|
||||
return query.getResultList();
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user