I have a big table with ~20 fields. Can I return a List elements based on a query with let's say id, created_on, temperature without creating constructors in class T for every possible combination of fields?
Let's say something like this:
Query q = em.createQuery("SELECT id, created_on, temperature FROM Table");
result = (List<T>) q.setMaxResults(300).getResultList();
Does it work if I don't have a constructor for this specific case? Do I get a list of T objects?