Untitled
unknown
plain_text
8 months ago
1.1 kB
1
Indexable
Never
package com.edu_manage.education_management.entity; import java.util.Set; import java.util.UUID; import org.springframework.data.annotation.Id; import org.springframework.stereotype.Component; import jakarta.persistence.Column; import jakarta.persistence.EmbeddedId; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.JoinColumn; import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToMany; import jakarta.persistence.OneToOne; import jakarta.persistence.Table; import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; @Entity @Table(name = "teacher") @Data @NoArgsConstructor @AllArgsConstructor public class Teacher{ @Id @Column(name = "user_id") private UUID userId; @OneToOne @JoinColumn(name = "user_id", referencedColumnName = "user_id") private EMSUser user; private String facultyName; private String designation; // Relationships @OneToMany(mappedBy = "advisor") private Set<Student> advisees; }
Leave a Comment