You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
835 B
51 lines
835 B
package org.ros.chatto.model;
|
|
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.JoinColumn;
|
|
import javax.persistence.ManyToOne;
|
|
import javax.persistence.Table;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonManagedReference;
|
|
|
|
@Entity
|
|
@Table(name = "users_roles")
|
|
public class UserRole {
|
|
@Id
|
|
private int id;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "user_id")
|
|
@JsonManagedReference
|
|
private ChatUser user;
|
|
|
|
@ManyToOne
|
|
@JoinColumn(name = "role_id")
|
|
@JsonManagedReference
|
|
private Role role;
|
|
|
|
public int getId() {
|
|
return id;
|
|
}
|
|
|
|
public void setId(int id) {
|
|
this.id = id;
|
|
}
|
|
|
|
public ChatUser getUser() {
|
|
return user;
|
|
}
|
|
|
|
public void setUser(ChatUser user) {
|
|
this.user = user;
|
|
}
|
|
|
|
public Role getRole() {
|
|
return role;
|
|
}
|
|
|
|
public void setRole(Role role) {
|
|
this.role = role;
|
|
}
|
|
|
|
}
|