| | |
| | | package com.rongyichuang.judge.entity; |
| | | |
| | | import com.rongyichuang.common.entity.BaseEntity; |
| | | import com.rongyichuang.tag.entity.Tag; |
| | | import jakarta.persistence.*; |
| | | import java.util.List; |
| | | import org.hibernate.annotations.Where; |
| | | import java.util.HashSet; |
| | | import java.util.Set; |
| | | |
| | | @Entity |
| | | @Table(name = "t_judge") |
| | | @Where(clause = "state = 1") |
| | | public class Judge extends BaseEntity { |
| | | |
| | | @Column(name = "name", length = 64, nullable = false) |
| | |
| | | @Column(name = "gender") |
| | | private Integer gender; // 0-女, 1-男 |
| | | |
| | | @Column(name = "state", nullable = false) |
| | | private Integer state = 1; // 状态:1-正常 |
| | | |
| | | @Column(name = "role_id") |
| | | private Long roleId; |
| | | |
| | | @Column(name = "description", length = 255) |
| | | @Column(name = "description") |
| | | private String description; |
| | | |
| | | // 专业标签(多对多关系) |
| | | @ManyToMany |
| | | @Column(name = "title") |
| | | private String title; |
| | | |
| | | @Column(name = "company") |
| | | private String company; |
| | | |
| | | @Column(name = "introduction") |
| | | private String introduction; |
| | | |
| | | /** |
| | | * 状态:1-正常,0-删除 |
| | | */ |
| | | @Column(name = "state", nullable = false) |
| | | private Integer state = 1; |
| | | |
| | | @ManyToMany(fetch = FetchType.LAZY) |
| | | @JoinTable( |
| | | name = "t_judge_tag", |
| | | joinColumns = @JoinColumn(name = "judge_id"), |
| | | inverseJoinColumns = @JoinColumn(name = "tag_id") |
| | | name = "t_judge_tag", |
| | | joinColumns = @JoinColumn(name = "judge_id"), |
| | | inverseJoinColumns = @JoinColumn(name = "tag_id") |
| | | ) |
| | | private List<Tag> specialties; |
| | | private Set<Tag> specialties = new HashSet<>(); |
| | | |
| | | // Getter and Setter methods |
| | | public String getName() { |
| | |
| | | this.description = description; |
| | | } |
| | | |
| | | public List<Tag> getSpecialties() { |
| | | public String getTitle() { |
| | | return title; |
| | | } |
| | | |
| | | public void setTitle(String title) { |
| | | this.title = title; |
| | | } |
| | | |
| | | public String getCompany() { |
| | | return company; |
| | | } |
| | | |
| | | public void setCompany(String company) { |
| | | this.company = company; |
| | | } |
| | | |
| | | public String getIntroduction() { |
| | | return introduction; |
| | | } |
| | | |
| | | public void setIntroduction(String introduction) { |
| | | this.introduction = introduction; |
| | | } |
| | | |
| | | public Set<Tag> getSpecialties() { |
| | | return specialties; |
| | | } |
| | | |
| | | public void setSpecialties(List<Tag> specialties) { |
| | | public void setSpecialties(Set<Tag> specialties) { |
| | | this.specialties = specialties; |
| | | } |
| | | } |