您的位置:首页 > 移动开发 > Objective-C

hibernate class cast exception from object to ...

2016-01-15 17:53 483 查看
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
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: