package de.dhbw.humbuch.guice;

import com.google.inject.TypeLiteral;
import com.google.inject.persist.jpa.JpaPersistModule;
import com.google.inject.servlet.ServletModule;

import de.dhbw.humbuch.model.DAO;
import de.dhbw.humbuch.model.DAOImpl;
import de.dhbw.humbuch.model.entity.BorrowedMaterial;
import de.dhbw.humbuch.model.entity.Category;
import de.dhbw.humbuch.model.entity.Grade;
import de.dhbw.humbuch.model.entity.Parent;
import de.dhbw.humbuch.model.entity.Student;
import de.dhbw.humbuch.model.entity.TeachingMaterial;
import de.dhbw.humbuch.model.entity.User;

public class TestModule extends ServletModule {

	@Override
	protected void configureServlets() {
		install(new JpaPersistModule("testPersistModule"));
		
		bind(new TypeLiteral<DAO<BorrowedMaterial>>() {}).to(new TypeLiteral<DAOImpl<BorrowedMaterial>>() {});
		bind(new TypeLiteral<DAO<Category>>() {}).to(new TypeLiteral<DAOImpl<Category>>() {});
		bind(new TypeLiteral<DAO<Grade>>() {}).to(new TypeLiteral<DAOImpl<Grade>>() {});
		bind(new TypeLiteral<DAO<Parent>>() {}).to(new TypeLiteral<DAOImpl<Parent>>() {});
		bind(new TypeLiteral<DAO<Student>>() {}).to(new TypeLiteral<DAOImpl<Student>>() {});
		bind(new TypeLiteral<DAO<TeachingMaterial>>() {}).to(new TypeLiteral<DAOImpl<TeachingMaterial>>() {});
		bind(new TypeLiteral<DAO<User>>() {}).to(new TypeLiteral<DAOImpl<User>>() {});
	}
}

@@ -21,24 +21,65 @@
 uch.guice;%0A%0A
+import com.google.inject.AbstractModule;%0A
 import com.g
@@ -162,56 +162,8 @@
 ule;
-%0Aimport com.google.inject.servlet.ServletModule;
 %0A%0Aim
@@ -332,16 +332,61 @@
 tegory;%0A
+import de.dhbw.humbuch.model.entity.Dunning;%0A
 import d
@@ -460,24 +460,72 @@
 ity.Parent;%0A
+import de.dhbw.humbuch.model.entity.SchoolYear;%0A
 import de.dh
@@ -686,22 +686,23 @@
 extends 
-Servle
+Abstrac
 tModule 
@@ -703,16 +703,17 @@
 odule %7B%0A
+%09
 %0A%09@Overr
@@ -745,16 +745,8 @@
 gure
-Servlets
 () %7B
@@ -989,32 +989,119 @@
 tegory%3E%3E() %7B%7D);%0A
+%09%09bind(new TypeLiteral%3CDAO%3CDunning%3E%3E() %7B%7D).to(new TypeLiteral%3CDAOImpl%3CDunning%3E%3E() %7B%7D);%0A
 %09%09bind(new TypeL
@@ -1244,32 +1244,125 @@
 Parent%3E%3E() %7B%7D);%0A
+%09%09bind(new TypeLiteral%3CDAO%3CSchoolYear%3E%3E() %7B%7D).to(new TypeLiteral%3CDAOImpl%3CSchoolYear%3E%3E() %7B%7D);%0A
 %09%09bind(new TypeL

add bindings for further DAOs