码迷,mamicode.com
首页 > Web开发 > 详细

hibernate class cast exception from object to ...

时间:2016-01-15 19:58:06      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:

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.

hibernate class cast exception from object to ...

标签:

原文地址:http://www.cnblogs.com/IamThat/p/5133938.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!