source: src/main/java/project/educatum/service/impl/TeacherSubjectServiceImpl.java

Last change on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago

Initial commit

  • Property mode set to 100644
File size: 1006 bytes
Line 
1package project.educatum.service.impl;
2
3import org.springframework.stereotype.Service;
4import project.educatum.model.relations.TeacherSubjectRelation;
5import project.educatum.model.primarykeys.TeacherSubjectRelationID;
6import project.educatum.repository.TeacherSubjectRepository;
7import project.educatum.service.TeacherSubjectService;
8
9@Service
10public class TeacherSubjectServiceImpl implements TeacherSubjectService {
11
12 private final TeacherSubjectRepository teacherSubjectRepository;
13
14 public TeacherSubjectServiceImpl(TeacherSubjectRepository teacherSubjectRepository) {
15 this.teacherSubjectRepository = teacherSubjectRepository;
16 }
17
18 @Override
19 public void addSubject(Integer teacherID, Integer subjectID, String desc) {
20 TeacherSubjectRelationID teacherSubjectRelationID = new TeacherSubjectRelationID(teacherID, subjectID);
21 TeacherSubjectRelation t = new TeacherSubjectRelation(teacherSubjectRelationID, desc);
22 teacherSubjectRepository.save(t);
23
24 }
25
26}
Note: See TracBrowser for help on using the repository browser.