-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathServiceImplementation.java
More file actions
42 lines (28 loc) · 921 Bytes
/
ServiceImplementation.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
package com.StudentManagementSystem.ServiceImpl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.StudentManagementSystem.Entity.Student;
import com.StudentManagementSystem.Repository.StudentRepository;
import com.StudentManagementSystem.Service.StudentService;
@Service
public class ServiceImplementation implements StudentService{
@Autowired
StudentRepository studentRepository;
@Override
public List<Student> getAllStudents() {
return studentRepository.findAll();
}
@Override
public Student saveStudent(Student student) {
return studentRepository.save(student);
}
@Override
public Student getById(int id) {
return studentRepository.findById(id).get();
}
@Override
public void deleteById(int id) {
studentRepository.deleteById(id);
}
}