com.feingto.cloud.domain.account.UserRole Maven / Gradle / Ivy
package com.feingto.cloud.domain.account;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.feingto.cloud.data.jpa.entity.IdEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Where;
import javax.persistence.*;
/**
* 用户角色关系
*
* @author longfei
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Entity
@DynamicUpdate
@Table(name = "sy_user_role")
public class UserRole extends IdEntity {
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
private User user;
@JsonIgnoreProperties(value = {"userRoles", "resources"}, allowSetters = true)
@ManyToOne
@JoinColumn(nullable = false)
@Where(clause = "enabled = True")
private Role role;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy