hibernate class cast exception from object to ...

http://stackoverflow.com/questions/22548325/java-lang-classcastexception-cannot-be-cast-to-java-lang-integer

When you select specific columns from DB, the result you get is not the entity object, but an Object[], with each element of array holding different column values. So, what you're getting from query.list() method is: List<Object[]>. So, certainly when you cast list.get(0), to App1User, that will result in ClassCastException.

posted @ 2016-01-15 17:53  IamThat  阅读(227)  评论(0编辑  收藏  举报