Skip to content

Commit bfd527d

Browse files
committed
Student service done ✅
1 parent 4f9f39a commit bfd527d

File tree

3 files changed

+53
-6
lines changed

3 files changed

+53
-6
lines changed

src/main/java/com/gdsc/springbootworkshop/entites/Student.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
package com.gdsc.springbootworkshop.entites;
22

3-
import org.springframework.data.annotation.Id;
43

54
import javax.persistence.*;
65

76
@Entity
87
public class Student {
9-
@javax.persistence.Id
10-
@GeneratedValue(strategy = GenerationType.AUTO)
11-
private Long id;
8+
129

1310
@Id
1411
@GeneratedValue(strategy = GenerationType.AUTO)
@@ -23,11 +20,11 @@ public class Student {
2320
private GENDER gender;
2421

2522
public Long getId() {
26-
return id;
23+
return idStudent;
2724
}
2825

2926
public void setId(Long id) {
30-
this.id = id;
27+
this.idStudent = id;
3128
}
3229

3330
public Student() {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.gdsc.springbootworkshop.services;
2+
3+
import com.gdsc.springbootworkshop.entites.Student;
4+
5+
import java.util.List;
6+
7+
public interface IStudentService {
8+
9+
List<Student> getAllStudents();
10+
Student addStudent(Student student);
11+
Student updateStudent(Long id,Student student);
12+
void deleteStudent(Long id);
13+
Student findById(Long id);
14+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package com.gdsc.springbootworkshop.services;
2+
3+
import com.gdsc.springbootworkshop.entites.Student;
4+
import org.springframework.stereotype.Service;
5+
6+
import java.util.List;
7+
8+
@Service
9+
public class StudentService implements IStudentService {
10+
11+
12+
@Override
13+
public List<Student> getAllStudents() {
14+
return null;
15+
}
16+
17+
@Override
18+
public Student addStudent(Student student) {
19+
return null;
20+
}
21+
22+
@Override
23+
public Student updateStudent(Long id, Student student) {
24+
return null;
25+
}
26+
27+
@Override
28+
public void deleteStudent(Long id) {
29+
30+
}
31+
32+
@Override
33+
public Student findById(Long id) {
34+
return null;
35+
}
36+
}

0 commit comments

Comments
 (0)