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 | |
---|
1 | package project.educatum.service.impl;
|
---|
2 |
|
---|
3 | import org.springframework.stereotype.Service;
|
---|
4 | import project.educatum.model.relations.TeacherSubjectRelation;
|
---|
5 | import project.educatum.model.primarykeys.TeacherSubjectRelationID;
|
---|
6 | import project.educatum.repository.TeacherSubjectRepository;
|
---|
7 | import project.educatum.service.TeacherSubjectService;
|
---|
8 |
|
---|
9 | @Service
|
---|
10 | public 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.