I want to create a generic database connection class which handles all the incoming database query for different types of classes.
I've wrote a generic interface
public interface IDBConnection<T> {
public void createOrUpdate(T t);
public void delete(T t);
public void initConnection();
public void closeConnection();
}
and implemented it into the database connection class
public class GenericDBCon implements IDBConnection {
private static JdbcConnectionSource con;
@Override
public void createOrUpdate(Object t) {
}
@Override
public void delete(Object t) {
}
@Override
public void initConnection() {
}
@Override
public void closeConnection() {
}
}
I don't understand why the implementation of, lets say the createOrUpdate-function has an "Object t" as parameter instead of "T t" like in definition of the interface?