Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jh-boot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jan Hrabal
jh-boot
Commits
318d6e38
Commit
318d6e38
authored
Sep 20, 2019
by
jhrabal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
page
parent
d441551c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
pom.xml
pom.xml
+0
-2
AbstractHibernateRepository.java
...ain/java/com/jh/boot/jpa/AbstractHibernateRepository.java
+1
-1
Page.java
src/main/java/com/jh/boot/web/list/Page.java
+23
-0
No files found.
pom.xml
View file @
318d6e38
...
...
@@ -172,7 +172,6 @@
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-release-plugin
</artifactId>
<version>
2.4.1
</version>
</plugin>
<plugin>
...
...
@@ -188,7 +187,6 @@
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.8.0
</version>
<!--$NO-MVN-MAN-VER$-->
<configuration>
<release>
${java.version}
</release>
<source>
${java.version}
</source>
<target>
${java.version}
</target>
<encoding>
${project.build.sourceEncoding}
</encoding>
...
...
src/main/java/com/jh/boot/jpa/AbstractHibernateRepository.java
View file @
318d6e38
...
...
@@ -149,7 +149,7 @@ public abstract class AbstractHibernateRepository {
sortedCriteria
(
c
,
pagingInfo
);
return
new
Page
<>(
pagingInfo
.
getPage
(),
pagesCount
,
c
.
list
(),
pagingInfo
.
getField
(),
pagingInfo
.
getTrend
());
return
new
Page
<>(
pagingInfo
.
getPage
(),
pagesCount
,
c
ount
,
c
.
list
(),
pagingInfo
.
getField
(),
pagingInfo
.
getTrend
());
}
...
...
src/main/java/com/jh/boot/web/list/Page.java
View file @
318d6e38
...
...
@@ -7,6 +7,8 @@ package com.jh.boot.web.list;
import
java.util.Collections
;
import
java.util.List
;
import
com.jh.tsk.model.Contractor
;
/**
* TODO.
*
...
...
@@ -30,6 +32,8 @@ public class Page<T> {
/** The trend. */
private
SortTrend
trend
;
private
int
totalElements
;
/**
* Instantiates a new page.
*
...
...
@@ -70,6 +74,16 @@ public class Page<T> {
this
.
trend
=
trend
;
}
public
Page
(
int
page
,
int
pagesCount
,
int
totalElementsCount
,
List
<
T
>
content
,
String
sortBy
,
SortTrend
trend
)
{
super
();
this
.
content
=
content
;
this
.
pagesCount
=
pagesCount
;
this
.
totalElements
=
totalElementsCount
;
this
.
page
=
page
;
this
.
sortBy
=
sortBy
;
this
.
trend
=
trend
;
}
/**
* Gets the content.
*
...
...
@@ -123,4 +137,13 @@ public class Page<T> {
public
boolean
isSorted
()
{
return
sortBy
!=
null
&&
trend
!=
null
;
}
public
int
getTotalElements
()
{
return
totalElements
;
}
public
static
<
T
>
Page
<
T
>
empty
()
{
return
new
Page
<
T
>(
0
,
0
,
Collections
.
emptyList
());
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment