package at.ac.tuwien.inso.service;

import at.ac.tuwien.inso.entity.Course;
import at.ac.tuwien.inso.entity.Semester;
import at.ac.tuwien.inso.repository.CourseRepository;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoursesService {

    @Autowired
    private SemesterService semesterService;

    @Autowired
    private CourseRepository courseRepository;

    public List<Course> findForCurrentSemester() {
        Semester semester = semesterService.getCurrentSemester();
        return courseRepository.findAllBySemester(semester);
    }

}

@@ -301,16 +301,62 @@
 .List;%0A%0A
+import javax.validation.constraints.NotNull;%0A%0A
 @Service
@@ -511,16 +511,17 @@
 itory;%0A%0A
+%0A
     publ
@@ -540,16 +540,22 @@
 se%3E find
+Course
 ForCurre
@@ -564,17 +564,45 @@
 Semester
-(
+WithName(@NotNull String name
 ) %7B%0A    
@@ -716,17 +716,63 @@
 ster
-(semester
+AndSubjectNameLikeIgnoreCase(semester, %22%25%22 + name + %22%25%22
 );%0A 

Add filter for name, combine with get all