All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.feingto.cloud.domain.account.UserRole Maven / Gradle / Ivy

There is a newer version: 2.3.5.RELEASE
Show newest version
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