I have a common HQL for multiple classes
Query query = session.createQuery("select id, name from " + hibernateClass.getClass().getName());
query.list();
returns a List<Object[]>
. Now the output of the query has the same structure i.e. a Long id
and a String name
. So is it possible to put this content in a class, so that when I call query.list()
everything gets copied into a list and I don't have to create a new List
object and populate it.