Last change
on this file was fdfbdde, checked in by Stojilkova Sara <sara.stojilkova.students.finki.ukim.mk>, 9 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
996 bytes
|
Rev | Line | |
---|
[fdfbdde] | 1 | package com.example.task.entity;
|
---|
| 2 |
|
---|
| 3 | import jakarta.persistence.*;
|
---|
| 4 | import lombok.*;
|
---|
| 5 |
|
---|
| 6 | import java.util.List;
|
---|
| 7 |
|
---|
| 8 | @Entity
|
---|
| 9 | @Table(name = "student", schema = "project")
|
---|
| 10 | @NoArgsConstructor
|
---|
| 11 | @AllArgsConstructor
|
---|
| 12 | @Getter
|
---|
| 13 | @Setter
|
---|
| 14 | public class StudentEntity {
|
---|
| 15 |
|
---|
| 16 | @Id
|
---|
| 17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
| 18 | @Column(name = "student_id")
|
---|
| 19 | private Integer studentId;
|
---|
| 20 |
|
---|
| 21 | @Column(name = "username", nullable = false)
|
---|
| 22 | private String username;
|
---|
| 23 |
|
---|
| 24 | @Column(name = "s_first_name", nullable = false)
|
---|
| 25 | private String firstName;
|
---|
| 26 |
|
---|
| 27 | @Column(name = "s_last_name")
|
---|
| 28 | private String lastName;
|
---|
| 29 |
|
---|
| 30 | @Column(name = "s_password", nullable = false)
|
---|
| 31 | private String password;
|
---|
| 32 |
|
---|
| 33 | @OneToMany(mappedBy = "student")
|
---|
| 34 | private List<TaskEntity> tasks;
|
---|
| 35 |
|
---|
| 36 | public StudentEntity(String username, String firstName, String lastName, String password) {
|
---|
| 37 | this.username = username;
|
---|
| 38 | this.firstName = firstName;
|
---|
| 39 | this.lastName = lastName;
|
---|
| 40 | this.password = password;
|
---|
| 41 | }
|
---|
| 42 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.