Merge gone bad : User too :P (next time I'll get it right)
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
package org.yacos.core.users;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToMany;
|
||||
|
||||
import org.yacos.core.conferences.Conference;
|
||||
|
||||
|
||||
@@ -12,11 +17,13 @@ import org.yacos.core.conferences.Conference;
|
||||
* @author christiancorsano
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
public class User {
|
||||
/**
|
||||
* Unique login of the user
|
||||
* Is used to identify the user, should be unique and can't be modified
|
||||
*/
|
||||
@Id
|
||||
private String login;
|
||||
/**
|
||||
* Password : used for authentication purpose only, is only writable
|
||||
@@ -38,11 +45,17 @@ public class User {
|
||||
* Active email (has to be used frequently) of the user
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* Roles for this user
|
||||
*/
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||
private Collection<Role> roles;
|
||||
|
||||
public User() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Id
|
||||
public String getLogin() {
|
||||
return login;
|
||||
}
|
||||
@@ -99,9 +112,33 @@ public class User {
|
||||
// TODO
|
||||
return false;
|
||||
}
|
||||
|
||||
public Set<Role> getRoles(){
|
||||
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||
public Collection<Role> getRoles(){
|
||||
// TODO
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the password
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param login the login to set
|
||||
*/
|
||||
public void setLogin(String login) {
|
||||
this.login = login;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param roles the roles to set
|
||||
*/
|
||||
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||
public void setRoles(Collection<Role> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user