public String addStudyProgram(){
Optional<StudyProgram> program = studyProgramRepository.findById(1);
Student student = new Student();
student.setStudentName("Mushashi");
student.setProgram(program); // error The method setProgram(StudyProgram) in the type Student is not applicable for the arguments (Optional<StudyProgram>)
return "Done";
}
student and program are DTO , if i change setProgram(StudyProgram) method to setProgram(Optional) then it interfere with database scheme. what will be the solution ?