backend/buisnesslogic/src/main/java/com/plannaplan/services/LecturerService.java
Marcin Woźniak 1cff3ceb74 Added delete method into LecturerService
Signed-off-by: Marcin Woźniak <y0rune@aol.com>
2020-09-16 17:35:39 +02:00

29 lines
711 B
Java

package com.plannaplan.services;
import com.plannaplan.entities.Lecturer;
import com.plannaplan.repositories.LecturerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class LecturerService {
@Autowired
private LecturerRepository repo;
public Lecturer getLecturer(String title, String name, String surname) {
return repo.find(title, name, surname);
}
public void save(Lecturer lecturer) {
repo.save(lecturer);
}
public void delete(Lecturer lecturer) {
repo.delete(lecturer);
}
public int getLecturersAmmount(){
return (int)this.repo.count();
}
}