Java method returning two or more generic types

There are a lot of questions regarding Java methods returning generic types, but none of them helped me out so far.

So here’s my code:

interface DAO<K, T> {
   void    insert(T t);
   void    update(K k, T t);
   void    delete(K k);
   void    delete();
   T       select(K k);
   List<T> select();

public class CourseDAO implements DAO<String, Course> {
   public void         insert(Course t) {}
   public void         update(String k, Course t) {}
   public void         delete(String k) {}
   public void         delete() {}
   public Course       select(String k) {}
   public List<Course> select() {}

public class StudentDAO implements DAO<Long, Student> {
   public void          insert(Student t) {}
   public void          update(Long k, Student t) {}
   public void          delete(Long k) {}
   public void          delete() {}
   public Student       select(Long k) {}
   public List<Student> select() {}

public enum EntityType { COURSE, STUDENT }

Now I want a factory method which accepts an EntityType parameter and return an instance of CourseDAO or StudentDAO depending on the parameter value.

I tried the code below without success:

public <K,T> DAO<K,T> createDAOFactory(EntityType type) {
   switch (type) {
      case COURSE  : return (K,T) new CourseDAO();  break;
      case STUDENT : return (K,T) new StudentDAO(); break;
   return null;

Could anyone help me in writing and invoking this method???


Java method returning two or more generic types