This commit is contained in:
@@ -4,13 +4,14 @@ import java.util.List;
|
||||
|
||||
import javax.ejb.Remote;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
import org.yacos.core.exceptions.PKAlreadyUsedException;
|
||||
|
||||
@Remote
|
||||
public interface IUserManager {
|
||||
|
||||
//crud methode
|
||||
public List<User> getUsers();
|
||||
|
||||
public User addUser(String login, String password, String firstName,
|
||||
String lastName, String organization, String email) throws PKAlreadyUsedException;
|
||||
public void removeUser(User user);
|
||||
@@ -18,8 +19,10 @@ public interface IUserManager {
|
||||
public void UpdateUser(User user);
|
||||
public Boolean exists(String login);
|
||||
|
||||
//role methode
|
||||
public List<Role> getRoles();
|
||||
// methodes lister
|
||||
public List<User> getUsers();
|
||||
public List<User> getUsers(Conference conf);
|
||||
public List<User> getUsers(Role.RoleType type);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
|
||||
import org.yacos.core.article.Article;
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
|
||||
@@ -52,12 +53,16 @@ public class User implements Serializable{
|
||||
* Active email (has to be used frequently) of the user
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* Roles for this user
|
||||
*/
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||
private List<Role> roles;
|
||||
|
||||
@OneToMany(targetEntity=Article.class,mappedBy="mainAuthor")
|
||||
private List<Article> articles;
|
||||
|
||||
public User(String login, String password, String firstName,
|
||||
String lastName, String organization, String email) {
|
||||
this();
|
||||
@@ -159,5 +164,15 @@ public class User implements Serializable{
|
||||
public void setRoles(List<Role> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
@OneToMany(targetEntity=Article.class,mappedBy="mainAuthor")
|
||||
public List<Article> getArticles() {
|
||||
return articles;
|
||||
}
|
||||
|
||||
@OneToMany(targetEntity=Article.class,mappedBy="mainAuthor")
|
||||
public void setArticles(List<Article> articles) {
|
||||
this.articles = articles;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user