您的位置:首页 > 其它

jpa 本地查询 获取部分字段值

2016-11-22 15:35 681 查看
query = entityManager.createNativeQuery("select studentType,stata from SchoolStructure where unitid = :unitID");
query.setParameter("unitID",unitId);
List list = query.getResultList();
String stuType = "";
String stuState = "";
if(list.size()>0){
Object[] objects = (Object[])list.get(0);
stuType = objects[0].toString();
stuState = objects[1].toString();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jpa select 部分字段