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(); }
相关文章推荐
- Spring data jpa高级查询,部分字段查询,过滤查询,空字符过滤
- spring-data-jpa只查询实体部分字段
- json数组本地获取,以及根据字段排序【部分摘录】
- Java JPA 查询实体部分字段
- Jpa 查询部分字段并分页疑惑
- JPA使用本地查询实现联表查询,同一结果集中返回多个实体,多个字段
- Spring data jpa查询多个部分字段的方法
- 【SpringBoot学习笔记】SpringBoot_03_SpringData—JpaRepository部分字段查询功能
- [Entity Framework]获取部分字段的查询
- JPA 本地查询,结果数据获取错误
- JPA查询实体部分字段
- [Entity Framework]获取部分字段的查询
- JPA的本地查询(native query)转
- Hibernate中用hql查询部分字段
- Hibernate中用hql查询部分字段
- hibernate hql 查询指定字段并获取结果集
- ActiveRecord返回部分字段的查询
- Hibernate中用hql查询部分字段
- Hibernate - 查询部分字段
- Sqlite 数据库插入标示字段 获取新Id 及利用索引优化查询