backend/buisnesslogic/src/main/java/com/plannaplan/services/LecturerService.java

29 lines
711 B
Java
Raw Normal View History

2020-07-25 10:21:42 +02:00
package com.plannaplan.services;
2020-07-28 18:04:38 +02:00
import com.plannaplan.entities.Lecturer;
2020-07-25 10:21:42 +02:00
import com.plannaplan.repositories.LecturerRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class LecturerService {
@Autowired
2020-07-25 10:56:11 +02:00
private LecturerRepository repo;
2020-07-28 18:04:38 +02:00
2020-08-04 18:15:00 +02:00
public Lecturer getLecturer(String title, String name, String surname) {
return repo.find(title, name, surname);
}
2020-07-28 18:04:38 +02:00
public void save(Lecturer lecturer) {
repo.save(lecturer);
}
2020-09-04 16:24:00 +02:00
public void delete(Lecturer lecturer) {
repo.delete(lecturer);
}
2020-09-04 16:24:00 +02:00
public int getLecturersAmmount(){
return (int)this.repo.count();
}
2020-07-25 10:21:42 +02:00
}