我有上面的结果列表。我需要从该列表中获取一个元素或值。如何实现这一点。public List<OriginTransactionsVM> findTransactionsOfOrigin(String origin_id) { List result=null; try { Query query = getSession().createSQLQuery("CALL getOriginTransactions(:string_acc_no)") .setParameter("string_acc_no", origin_id); result= query.list(); // String rep = (String) result.get(0); need to achieve this result.get(0)[0] something like this } catch (Exception ex) { throw ex; } return result;}
2 回答
不负相思意
TA贡献1777条经验 获得超10个赞
这应该可以帮助您:
Object[] resultArray = (Object[]) result.get(0); String rep = (String) resultArray[0];
添加回答
举报
0/150
提交
取消