@Entity
@Table(name = "user")
public class User extends BaseEntity<String> {
@Id
@Column(name = "id", nullable = false, updatable = false)
private String isid;
@Column(name = "first_name")
private String firstName;
@Column(name = "last_name")
private String lastName;
@Size(min = 1, max = 2)
@ManyToMany
@JoinTable(name = "user_roles",
joinColumns = @JoinColumn(name = "id", referencedColumnName = "user_id",
nullable = false, insertable = false, updatable = false),
inverseJoinColumns = {
@JoinColumn(name = "id", referencedColumnName = "role_id",
nullable = false, insertable = false, updatable = false),
@JoinColumn(name = "role_type_id", referencedColumnName = "role_type_id",
nullable = false, insertable = false, updatable = false)
}
)
@WhereJoinTable(clause = "role_type_id = 7")
private List<Role> sevenRoles;