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

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

There is a newer version: 2.3.8.RELEASE
Show newest version
package com.feingto.cloud.domain.account;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.feingto.cloud.domain.IdEntity;
import lombok.*;
import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 菜单按钮
 *
 * @author longfei
 */
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
@DynamicUpdate
@Table(name = "sy_res_btn")
public class ResourceButton extends IdEntity {
    private static final long serialVersionUID = 8260217859770828500L;

    @JsonIgnoreProperties(value = "buttons", allowSetters = true)
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "res_id")
    protected Resource resource;

    @Column
    protected String code;

    @Column
    protected String name;

    @Column
    protected Integer location;

    @Builder.Default
    @JsonIgnoreProperties(value = "button", allowSetters = true)
    @BatchSize(size = 30)
    @Fetch(FetchMode.SELECT)
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "button", cascade = CascadeType.REMOVE, orphanRemoval = true)
    protected List rrbs = new ArrayList<>();

    @Builder
    public ResourceButton(String id, Resource resource, String code, String name, Integer location, List rrbs) {
        super(id);
        this.resource = resource;
        this.code = code;
        this.name = name;
        this.location = location;
        this.rrbs = rrbs;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy