package com.casic.PgInterface.patroler.domain;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * Created by yxw on 2018/3/30.
 */
@Entity
@Table(name = "PG_AUTHORITY")
@SequenceGenerator(name = "SEQ_PG_AUTHORITY_ID", sequenceName = "SEQ_PG_AUTHORITY_ID",allocationSize=1,initialValue=1)
public class PgAuthority implements Serializable {
    private static final long serialVersionUID = 1L;
    private long id;
    private String authority;
    private String concent;
    private int active;
    private List<PgRole> pgRoles;

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_PG_AUTHORITY_ID")
    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    @Column(name = "AUTHORITY")
    public String getAuthority() {
        return authority;
    }

    public void setAuthority(String authority) {
        this.authority = authority;
    }

    @Column(name = "CONCENT")
    public String getConcent() {
        return concent;
    }

    public void setConcent(String concent) {
        this.concent = concent;
    }

    @Column(name = "ACTIVE")
    public int getActive() {
        return active;
    }

    public void setActive(int active) {
        this.active = active;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "pgAuthorityId")
    public List<PgRole> getPgRoles() {
        return pgRoles;
    }

    public void setPgRoles(List<PgRole> pgRoles) {
        this.pgRoles = pgRoles;
    }

}
