Commit 86557fdf authored by Michael Schimpelsberger's avatar Michael Schimpelsberger
Browse files

Abstract Daos hinzugefügt

parent 1689b628
package university.at.jku.ce.dao;
import java.util.ArrayList;
import java.util.List;
import university.at.jku.ce.model.Study;
public abstract class AbstractStudyDao {
abstract List<Study> getAllStudies();
abstract Study getStudy(Long id);
abstract Study addStudy(Study study);
abstract Study updateStudy(Study study);
abstract Study removeStudy(long studyId);
}
package university.at.jku.ce.dao;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import university.at.jku.ce.model.Subject;
public abstract class AbstractSubjectDao {
public abstract List<Subject> getAllSubjects(long studyId);
public abstract Subject getSubject(long studyId, long id);
public abstract Subject addSubject (long studyId, Subject subject);
public abstract Subject updateSubject (long studyId, Subject subject);
public abstract Subject removeSubject (long studyId, long id);
}
...@@ -4,8 +4,6 @@ import java.util.ArrayList; ...@@ -4,8 +4,6 @@ import java.util.ArrayList;
import university.at.jku.ce.Database; import university.at.jku.ce.Database;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import university.at.jku.ce.model.Student;
import university.at.jku.ce.model.Study; import university.at.jku.ce.model.Study;
import university.at.jku.ce.model.Subject; import university.at.jku.ce.model.Subject;
...@@ -15,7 +13,7 @@ import university.at.jku.ce.model.Subject; ...@@ -15,7 +13,7 @@ import university.at.jku.ce.model.Subject;
public class SubjectService { public class SubjectService {
private Map <Long, Study> studies=Database.getStudies(); private Map <Long, Study> studies=Database.getStudies();
//SubjectDao mit zugriff auf tabelle subjects und studyToSubjects
public List<Subject> getAllSubjects(long studyId){ public List<Subject> getAllSubjects(long studyId){
Map<Long,Subject> subjects=studies.get(studyId).getSubjects(); Map<Long,Subject> subjects=studies.get(studyId).getSubjects();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment