This commit is contained in:
Maxime Dagnicourt
2008-01-17 13:34:54 +00:00
parent 035322d75f
commit d05bc72f56
2 changed files with 21 additions and 3 deletions

View File

@@ -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);
}

View File

@@ -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();
@@ -160,4 +165,14 @@ public class User implements Serializable{
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;
}
}