using generics for select query type