Commit bf55bb36 authored by Ghitha Dinan's avatar Ghitha Dinan

pagination fixing

parent d4b46a55
......@@ -106,6 +106,8 @@ open class BaseRepositoryNative<T>(_class: Class<T>?) {
query.setParameter(it.field, it.value)
}
val size: Long = query.resultList.size.toLong()
if (req.enablePage == true) {
query.firstResult = req.page!! * req.size!!
query.maxResults = req.size!!
......@@ -122,7 +124,7 @@ open class BaseRepositoryNative<T>(_class: Class<T>?) {
list,
pageable
) {
list.size.toLong()
size
}
} catch (e: Exception) {
throw e
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment