package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

@Entity
@Table(name = "tsm_role_menu")
@NamedQuery(name = "TsmRoleMenu.findAll", query="SELECT t FROM TsmRoleMenu t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of= {"id"})
@ApiModel(description = "角色对于菜单表")
public class TsmRoleMenu  implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name = "tsm_role_menu_id_seq", sequenceName = "tsm_role_menu_id_seq", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "tsm_role_menu_id_seq")
	@Column(name = "id")
	@ApiModelProperty(value = "主键")
	private int id;

	@Column(name = "role_id")
	@ApiModelProperty(value = "角色id")
	private int roleId;

	@Column(name = "menu_code")
	@ApiModelProperty(value = "菜单编码")
	private String menuCode;

}
