jpa - 如何解决这个简单但未解决的 JPA 分页问题?
问题描述
我正在尝试在我的 spring boot 应用程序中使用 native query 和 pagination 进行查询。
@Query(value = "select * from user pg ",
countQuery = "select count(*) from user pg " ,
nativeQuery = true)
Page<User> pesquisar( Pageable page);
抛出的异常就像Caused by: org.postgresql.util.PSQLException: ERROR: column pg.id does not exist Position: XX.
The Class user , of sure , has the id field . but I try to search about this error and I didn't find then I switch for order by #{#page} and order codes similar but the error continues, changed but persists with another name.
更新 :
让我们拿一个用户类样本:
Class User {
@id
UUID id ;
@Column
String nome;
etc //
}
解决方案
推荐阅读
- vb.net - 如何阻止 MDIchild 表单在不同位置打开
- bash - 如何使用awk根据前两个字段找出第三个字段的最小值
- c - C 中的链表实现失败
- windows - 从命令行设置任务计划程序“配置为”参数
- python - 如何使用 Python 在列表中存储不同的元组?
- flutter - 在 Flutter Web 中上传多个文件(图像)
- python - 为什么我在此代码中收到 python 列表索引错误?
- time - Leetcode 二和问题。我的代码的时间复杂度是 O(n^2)。我怎样才能让它更简单
- python - 键盘模块的Python .write()函数问题
- mysql - MySQl如何使两个合并两个表的结果与联合全部或任何替代