Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
Mybatis Jpa Extra
提交
38edf6e7
M
Mybatis Jpa Extra
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
Mybatis Jpa Extra
8 个月 前同步成功
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
Mybatis Jpa Extra
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
38edf6e7
编写于
3月 23, 2019
作者:
MaxKey单点登录官方
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
new package
上级
84852be4
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
40 addition
and
23 deletion
+40
-23
RemoteSystemsTempFiles/.project
RemoteSystemsTempFiles/.project
+12
-0
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/JpaBaseDomain.java
...ava/org/apache/mybatis/jpa/persistence/JpaBaseDomain.java
+2
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/JpaBaseService.java
...va/org/apache/mybatis/jpa/persistence/JpaBaseService.java
+7
-10
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/JpaPageResults.java
...va/org/apache/mybatis/jpa/persistence/JpaPageResults.java
+9
-9
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/JpaPagination.java
...ava/org/apache/mybatis/jpa/persistence/JpaPagination.java
+2
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/package-info.java
...java/org/apache/mybatis/jpa/persistence/package-info.java
+8
-0
未找到文件。
RemoteSystemsTempFiles/.project
0 → 100644
浏览文件 @
38edf6e7
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>
RemoteSystemsTempFiles
</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
<nature>
org.eclipse.rse.ui.remoteSystemsTempNature
</nature>
</natures>
</projectDescription>
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
domain/
BaseDomain.java
→
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
persistence/Jpa
BaseDomain.java
浏览文件 @
38edf6e7
package
org.apache.mybatis.jpa.
domain
;
package
org.apache.mybatis.jpa.
persistence
;
import
java.io.Serializable
;
import
java.util.UUID
;
...
...
@@ -9,7 +9,7 @@ import java.util.UUID;
* @author Crystal.sea
*
*/
public
class
BaseDomain
extends
Pagination
implements
Serializable
{
public
class
JpaBaseDomain
extends
Jpa
Pagination
implements
Serializable
{
/**
*
*/
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
servi
ce/JpaBaseService.java
→
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
persisten
ce/JpaBaseService.java
浏览文件 @
38edf6e7
package
org.apache.mybatis.jpa.
servi
ce
;
package
org.apache.mybatis.jpa.
persisten
ce
;
import
java.lang.reflect.ParameterizedType
;
import
java.lang.reflect.Type
;
...
...
@@ -6,9 +6,6 @@ import java.time.Duration;
import
java.util.List
;
import
org.apache.log4j.Logger
;
import
org.apache.mybatis.jpa.PageResultsSqlCache
;
import
org.apache.mybatis.jpa.domain.BaseDomain
;
import
org.apache.mybatis.jpa.domain.PageResults
;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.apache.mybatis.jpa.util.BeanUtil
;
import
org.apache.mybatis.jpa.util.InstanceUtil
;
import
org.apache.mybatis.jpa.util.WebContext
;
...
...
@@ -23,7 +20,7 @@ import org.ehcache.config.builders.UserManagedCacheBuilder;
*
* @param <T>
*/
public
class
JpaBaseService
<
T
extends
BaseDomain
>
{
public
class
JpaBaseService
<
T
extends
Jpa
BaseDomain
>
{
final
static
Logger
log
=
Logger
.
getLogger
(
JpaBaseService
.
class
);
...
...
@@ -111,7 +108,7 @@ public class JpaBaseService <T extends BaseDomain> {
* @param entity
* @return
*/
public
PageResults
<
T
>
queryPageResults
(
T
entity
)
{
public
Jpa
PageResults
<
T
>
queryPageResults
(
T
entity
)
{
entity
.
setPageResultSelectUUID
(
entity
.
generateId
());
entity
.
setStartRow
(
calculateStartRow
(
entity
.
getPage
()
,
entity
.
getPageResults
()));
...
...
@@ -127,7 +124,7 @@ public class JpaBaseService <T extends BaseDomain> {
totalCount
=
parseCount
(
getMapper
().
queryPageResultsCount
(
entity
));
}
return
new
PageResults
<
T
>(
entity
.
getPage
(),
entity
.
getPageResults
(),
totalPage
,
totalCount
,
resultslist
);
return
new
Jpa
PageResults
<
T
>(
entity
.
getPage
(),
entity
.
getPageResults
(),
totalPage
,
totalCount
,
resultslist
);
}
...
...
@@ -139,7 +136,7 @@ public class JpaBaseService <T extends BaseDomain> {
* @return
*/
@SuppressWarnings
(
"unchecked"
)
public
PageResults
<
T
>
queryPageResults
(
String
mapperId
,
T
entity
)
{
public
Jpa
PageResults
<
T
>
queryPageResults
(
String
mapperId
,
T
entity
)
{
entity
.
setPageResultSelectUUID
(
entity
.
generateId
());
entity
.
setStartRow
(
calculateStartRow
(
entity
.
getPage
()
,
entity
.
getPageResults
()));
...
...
@@ -161,7 +158,7 @@ public class JpaBaseService <T extends BaseDomain> {
totalCount
=
parseCount
(
getMapper
().
queryPageResultsCount
(
entity
));
}
return
new
PageResults
<
T
>(
entity
.
getPage
(),
entity
.
getPageResults
(),
totalPage
,
totalCount
,
resultslist
);
return
new
Jpa
PageResults
<
T
>(
entity
.
getPage
(),
entity
.
getPageResults
(),
totalPage
,
totalCount
,
resultslist
);
}
/**
...
...
@@ -382,7 +379,7 @@ public class JpaBaseService <T extends BaseDomain> {
* @param totalCount
* @return
*/
public
Integer
calculateTotalPage
(
BaseDomain
entity
,
Integer
totalCount
){
public
Integer
calculateTotalPage
(
Jpa
BaseDomain
entity
,
Integer
totalCount
){
return
(
totalCount
+
entity
.
getPageResults
()
-
1
)
/
entity
.
getPageResults
();
}
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
domain/
PageResults.java
→
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
persistence/Jpa
PageResults.java
浏览文件 @
38edf6e7
package
org.apache.mybatis.jpa.
domain
;
package
org.apache.mybatis.jpa.
persistence
;
import
java.util.List
;
...
...
@@ -17,8 +17,8 @@ import org.slf4j.LoggerFactory;
*
* @param <T>
*/
public
class
PageResults
<
T
>{
private
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
PageResults
.
class
);
public
class
Jpa
PageResults
<
T
>{
private
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
Jpa
PageResults
.
class
);
private
int
page
=
0
;
//当前页
...
...
@@ -33,7 +33,7 @@ public class PageResults <T>{
/**
*
*/
public
PageResults
()
{
public
Jpa
PageResults
()
{
_logger
.
debug
(
"Grid."
);
}
...
...
@@ -42,7 +42,7 @@ public class PageResults <T>{
* @param pageResults
* @param recordsCount
*/
public
PageResults
(
int
currentPage
,
int
pageResults
,
Long
recordsCount
)
{
public
Jpa
PageResults
(
int
currentPage
,
int
pageResults
,
Long
recordsCount
)
{
pageCount
(
currentPage
,
pageResults
,
recordsCount
);
_logger
.
debug
(
"Grid page : "
+
page
+
" , records : "
+
records
+
" , total : "
+
total
);
}
...
...
@@ -53,7 +53,7 @@ public class PageResults <T>{
* @param recordsCount
* @param rows
*/
public
PageResults
(
int
currentPage
,
int
pageResults
,
Long
recordsCount
,
List
<
T
>
rows
)
{
public
Jpa
PageResults
(
int
currentPage
,
int
pageResults
,
Long
recordsCount
,
List
<
T
>
rows
)
{
pageCount
(
currentPage
,
pageResults
,
recordsCount
);
this
.
rows
=
rows
;
}
...
...
@@ -65,7 +65,7 @@ public class PageResults <T>{
* @param recordsCount
* @param rows
*/
public
PageResults
(
int
currentPage
,
int
pageResults
,
Integer
recordsCount
,
List
<
T
>
rows
)
{
public
Jpa
PageResults
(
int
currentPage
,
int
pageResults
,
Integer
recordsCount
,
List
<
T
>
rows
)
{
pageCount
(
currentPage
,
pageResults
,
recordsCount
);
this
.
rows
=
rows
;
}
...
...
@@ -78,7 +78,7 @@ public class PageResults <T>{
* @param recordsCount
* @param rows
*/
public
PageResults
(
int
currentPage
,
int
pageResults
,
int
totalPage
,
Long
recordsCount
,
List
<
T
>
rows
)
{
public
Jpa
PageResults
(
int
currentPage
,
int
pageResults
,
int
totalPage
,
Long
recordsCount
,
List
<
T
>
rows
)
{
pageCount
(
currentPage
,
pageResults
,
recordsCount
);
this
.
rows
=
rows
;
this
.
totalPage
=
totalPage
;
...
...
@@ -92,7 +92,7 @@ public class PageResults <T>{
* @param recordsCount
* @param rows
*/
public
PageResults
(
int
currentPage
,
int
pageResults
,
int
totalPage
,
Integer
recordsCount
,
List
<
T
>
rows
)
{
public
Jpa
PageResults
(
int
currentPage
,
int
pageResults
,
int
totalPage
,
Integer
recordsCount
,
List
<
T
>
rows
)
{
pageCount
(
currentPage
,
pageResults
,
recordsCount
);
this
.
rows
=
rows
;
this
.
totalPage
=
totalPage
;
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
domain/
Pagination.java
→
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
persistence/Jpa
Pagination.java
浏览文件 @
38edf6e7
/**
*
*/
package
org.apache.mybatis.jpa.
domain
;
package
org.apache.mybatis.jpa.
persistence
;
import
org.codehaus.jackson.annotate.JsonIgnore
;
...
...
@@ -10,7 +10,7 @@ import org.codehaus.jackson.annotate.JsonIgnore;
* @author Crystal.Sea
*
*/
public
class
Pagination
{
public
class
Jpa
Pagination
{
@JsonIgnore
protected
int
rows
;
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
domain
/package-info.java
→
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/
persistence
/package-info.java
浏览文件 @
38edf6e7
...
...
@@ -5,4 +5,4 @@
* @author user
*
*/
package
org.apache.mybatis.jpa.domain
;
\ No newline at end of file
package
org.apache.mybatis.jpa.persistence
;
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录