- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServiceImplementation.java
More file actions
Latest commit
42 lines (28 loc) · 921 Bytes
/
Copy pathServiceImplementation.java
File metadata and controls
42 lines (28 loc) · 921 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
packagecom.StudentManagementSystem.ServiceImpl;
importjava.util.List;
importorg.springframework.beans.factory.annotation.Autowired;
importorg.springframework.stereotype.Service;
importcom.StudentManagementSystem.Entity.Student;
importcom.StudentManagementSystem.Repository.StudentRepository;
importcom.StudentManagementSystem.Service.StudentService;
@Service
publicclassServiceImplementationimplementsStudentService{
@Autowired
StudentRepositorystudentRepository;
@Override
publicList<Student> getAllStudents() {
returnstudentRepository.findAll();
}
@Override
publicStudentsaveStudent(Studentstudent) {
returnstudentRepository.save(student);
}
@Override
publicStudentgetById(intid) {
returnstudentRepository.findById(id).get();
}
@Override
publicvoiddeleteById(intid) {
studentRepository.deleteById(id);
}
}