package com.gkhy.labRiskManage.domain.account.entity; import lombok.Data; import org.hibernate.annotations.Fetch; import org.hibernate.annotations.FetchMode; import javax.persistence.*; /** * @email 1603559716@qq.com * @author: zf * @date: 2023/3/9 * @time: 15:43 */ @Data @Entity @Table(name = "sys_user_role_bind") public class SysUserRoleBind { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private Long userId; private Long roleId; @OneToOne(targetEntity = Role.class,fetch = FetchType.EAGER) @JoinColumn(name = "roleId",referencedColumnName = "id",insertable =false ,updatable = false) private Role role; }