Major refactor of reading from excel to db
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
import com.plannaplan.entities.Lecturer;
|
||||
import com.plannaplan.repositories.LecturerRepository;
|
||||
|
||||
@ -11,19 +13,20 @@ public class LecturerService {
|
||||
@Autowired
|
||||
private LecturerRepository repo;
|
||||
|
||||
public Lecturer getLecturer(String title, String name, String surname) {
|
||||
public Optional<Lecturer> getLecturer(String title, String name, String surname) {
|
||||
return repo.find(title, name, surname);
|
||||
}
|
||||
|
||||
public void save(Lecturer lecturer) {
|
||||
public Lecturer save(Lecturer lecturer) {
|
||||
repo.save(lecturer);
|
||||
return lecturer;
|
||||
}
|
||||
|
||||
public void delete(Lecturer lecturer) {
|
||||
repo.delete(lecturer);
|
||||
}
|
||||
|
||||
public int getLecturersAmmount(){
|
||||
return (int)this.repo.count();
|
||||
public int getLecturersAmmount() {
|
||||
return (int) this.repo.count();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user