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;
|
package org.yacos.core.users;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.OneToMany;
|
||||||
|
|
||||||
import org.yacos.core.conferences.Conference;
|
import org.yacos.core.conferences.Conference;
|
||||||
|
|
||||||
|
|
||||||
@@ -12,11 +17,13 @@ import org.yacos.core.conferences.Conference;
|
|||||||
* @author christiancorsano
|
* @author christiancorsano
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Entity
|
||||||
public class User {
|
public class User {
|
||||||
/**
|
/**
|
||||||
* Unique login of the user
|
* Unique login of the user
|
||||||
* Is used to identify the user, should be unique and can't be modified
|
* Is used to identify the user, should be unique and can't be modified
|
||||||
*/
|
*/
|
||||||
|
@Id
|
||||||
private String login;
|
private String login;
|
||||||
/**
|
/**
|
||||||
* Password : used for authentication purpose only, is only writable
|
* 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
|
* Active email (has to be used frequently) of the user
|
||||||
*/
|
*/
|
||||||
private String email;
|
private String email;
|
||||||
|
/**
|
||||||
|
* Roles for this user
|
||||||
|
*/
|
||||||
|
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||||
|
private Collection<Role> roles;
|
||||||
|
|
||||||
public User() {
|
public User() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Id
|
||||||
public String getLogin() {
|
public String getLogin() {
|
||||||
return login;
|
return login;
|
||||||
}
|
}
|
||||||
@@ -99,9 +112,33 @@ public class User {
|
|||||||
// TODO
|
// TODO
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<Role> getRoles(){
|
@OneToMany(targetEntity=Role.class,mappedBy="user")
|
||||||
|
public Collection<Role> getRoles(){
|
||||||
// TODO
|
// TODO
|
||||||
return null;
|
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