User增加RBAC角色

This commit is contained in:
myh 2023-11-06 18:39:58 +08:00
parent 0c7e5753f4
commit c53eeeef38

View File

@ -1,5 +1,6 @@
package com.example.springdemo.entities;
import com.example.springdemo.entities.RBAC.Roles;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
@ -28,4 +29,9 @@ public class Users {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "user")
@Column(name = "ordersID")
private List<Orders> orders;//订单
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "rolesID", referencedColumnName = "id")
@Column(name = "rolesID")
private Roles roles;//RBAC角色
}