Closed chenmu5241 closed 4 years ago
不太懂你的意思,你可以用 List 接收,也可以用 Set 接收,分页的话,就用 Page 去接收,查询出单个数据,就单个对象数据去接收就行。
多谢你能回复,是这样的,
这是我的repository代码
@QueryFenix(nativeQuery = true)
List<Map<String,Object>> queryListByNativeSql(@Param("ids") String[] ids);这个list<Map<String,Object>>本来我是想直接得到实体类的list(List
chenmu5241@163.com
发件人: 闪烁之狐 (blinkfox) 发送时间: 2020-05-28 00:14 收件人: blinkfox/fenix 抄送: chenmu5241; Author 主题: Re: [blinkfox/fenix] nativesql查询数据无法直接获取真实实体类型 (#16) 不太懂你的意思,你可以用 List 接收,也可以用 Set 接收,分页的话,就用 Page 去接收,查询出单个数据,就单个对象数据去接收就行。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
@chenmu5241
太感谢了,resultType这个写法我之前没注意到,真好! 再次感谢!
chenmu5241@163.com
发件人: 闪烁之狐 (blinkfox) 发送时间: 2020-05-28 09:37 收件人: blinkfox/fenix 抄送: chenmu5241; Mention 主题: Re: [blinkfox/fenix] nativesql查询数据无法直接获取真实实体类型 (#16) @chenmu5241 如果你查出来的数据,就是单实体表的查询,可以直接返回实体类的集合; 如果你查出来的数据,是多个表连表查询的结果,且字段是多个表都有的字段,可以用 JPA 投影来返回实体。他的投影功能稍微麻烦点儿,如果不用 JPA 的投影,你可以用 Fenix 提供的返回实体 Bean 的功能,也可以用实体接收。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@chenmu5241 今天发现了一个诡异的隐藏 bug,在异步多线程中,去调返回自定义实体的查询方法,jpa 不会释放 JDBC 连接,今晚会再发一版,修复这个问题。你到时候可以再更新一下。
好的,多谢!一定支持!
chenmu5241@163.com
发件人: 闪烁之狐 (blinkfox) 发送时间: 2020-05-28 20:27 收件人: blinkfox/fenix 抄送: chenmu5241; Mention 主题: Re: [blinkfox/fenix] nativesql查询数据无法直接获取真实实体类型 (#16) @chenmu5241 今天发现了一个诡异的隐藏 bug,在异步多线程中,去调返回自定义实体的查询方法,jpa 不会释放 JDBC 连接,今晚会再发一版,修复这个问题。你到时候可以再更新一下。 — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@chenmu5241 使用最新的 v2.3.2
版本。
支持springboot2.3.1吗?
@niejianjun 支持的。
新版本应该没问题,springboot2.2以上版本,我用的3.0版本对应2.1x
chenmu5241@163.com
发件人: niejianjun 发送时间: 2020-08-14 16:06 收件人: blinkfox/fenix 抄送: chenmu5241; Mention 主题: Re: [blinkfox/fenix] nativesql查询数据无法直接获取真实实体类型 (#16) 支持springboot2.3.1吗? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
nativesql查询出的list数据只能List《Object》或者List《Map》接收,这个好像是jpa的问题,不知道fenix中是否有办法直接获取到真实的List《Entity》