If you call addScalar(alias) only once, you get a List<T> where T is the inferred type of the single column being selected.

If you call addScalar(alias) multiple times, you get a List<Object[]> instead.

You got the ClassCastException because you are in the first situation.

There are many other issues with your approach:

- It looks like you are using a custom-made pagination query building instead of the Hibernate-based one- It looks like you want a Tuple result which is simpler than your approach or a ResultTransformer- Don't use e.printStackTrace() because you are going to write to the System.out stream. Use a Logging framework to pass the exception.- You don't use explicit transactions, and that's almost always a bad idea.