Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
Mybatis Jpa Extra
提交
f198470d
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 搜索 >>
提交
f198470d
编写于
7月 17, 2023
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MybatisJpaContext
上级
dfd767aa
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
50 addition
and
48 deletion
+50
-48
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/JpaService.java
...ore/src/main/java/org/dromara/mybatis/jpa/JpaService.java
+1
-1
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/spring/MybatisJpaContext.java
...ava/org/dromara/mybatis/jpa/spring/MybatisJpaContext.java
+34
-27
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/util/package-info.java
.../main/java/org/dromara/mybatis/jpa/util/package-info.java
+0
-17
mybatis-jpa-extra-core/src/test/java/org/dromara/mybatis/jpa/util/JpaSpringContextTest.java
...va/org/dromara/mybatis/jpa/util/JpaSpringContextTest.java
+12
-0
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/dromara/mybatis/jpa/test/MybatisJpaApplication.java
...a/org/dromara/mybatis/jpa/test/MybatisJpaApplication.java
+1
-1
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/dromara/mybatis/jpa/test/MybatisJpaApplicationTest.java
...g/dromara/mybatis/jpa/test/MybatisJpaApplicationTest.java
+1
-1
mybatis-jpa-extra-test/src/test/java/org/dromara/mybatis/jpa/test/InitContext.java
...c/test/java/org/dromara/mybatis/jpa/test/InitContext.java
+1
-1
未找到文件。
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/JpaService.java
浏览文件 @
f198470d
...
...
@@ -26,9 +26,9 @@ import org.dromara.mybatis.jpa.entity.JpaEntity;
import
org.dromara.mybatis.jpa.entity.JpaPageResults
;
import
org.dromara.mybatis.jpa.entity.PageResultsSqlCache
;
import
org.dromara.mybatis.jpa.query.Query
;
import
org.dromara.mybatis.jpa.spring.MybatisJpaContext
;
import
org.dromara.mybatis.jpa.util.BeanUtil
;
import
org.dromara.mybatis.jpa.util.InstanceUtil
;
import
org.dromara.mybatis.jpa.util.MybatisJpaContext
;
import
org.dromara.mybatis.jpa.util.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/
util
/MybatisJpaContext.java
→
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/
spring
/MybatisJpaContext.java
浏览文件 @
f198470d
...
...
@@ -15,10 +15,11 @@
*/
package
org.dromara.mybatis.jpa.util
;
package
org.dromara.mybatis.jpa.spring
;
import
java.time.LocalDateTime
;
import
org.apache.commons.lang.SystemUtils
;
import
org.joda.time.DateTime
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeansException
;
...
...
@@ -106,7 +107,12 @@ public final class MybatisJpaContext {
* @return HttpServletRequest
*/
public
static
HttpServletRequest
getRequest
(){
return
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
ServletRequestAttributes
servletRequestAttributes
=(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
if
(
servletRequestAttributes
!=
null
)
{
return
servletRequestAttributes
.
getRequest
();
}
else
{
return
null
;
}
}
/**
...
...
@@ -127,31 +133,32 @@ public final class MybatisJpaContext {
public
static
String
version
()
{
if
(
VERSION
==
null
)
{
StringBuffer
version
=
new
StringBuffer
(
"---------------------------------------------------------------------------------\n"
);
version
.
append
(
"+ MyBatis JPA Extra \n"
);
version
.
append
(
"+\n"
);
version
.
append
(
String
.
format
(
"+ %sCopyright 2018 - %s https://gitee.com/dromara/mybatis-jpa-extra/\n"
,
(
char
)
0xA9
,
new
DateTime
().
getYear
()
));
version
.
append
(
"+ Licensed under the Apache License, Version 2.0 \n"
);
version
.
append
(
"---------------------------------------------------------------------------------\n"
);
version
.
append
(
"+ JAVA \n"
);
version
.
append
(
String
.
format
(
"+ %s java version %s, class %s\n"
,
SystemUtils
.
JAVA_VENDOR
,
SystemUtils
.
JAVA_VERSION
,
SystemUtils
.
JAVA_CLASS_VERSION
));
version
.
append
(
String
.
format
(
"+ %s (build %s, %s)\n"
,
SystemUtils
.
JAVA_VM_NAME
,
SystemUtils
.
JAVA_VM_VERSION
,
SystemUtils
.
JAVA_VM_INFO
));
version
.
append
(
"---------------------------------------------------------------------------------\n"
);
VERSION
=
version
.
toString
();
return
String
.
format
(
"""
---------------------------------------------------------------------------------
- JAVA
- %s java version %s, class %s
- %s (build %s, %s)
---------------------------------------------------------------------------------
- MyBatis JPA Extra
-
- %sCopyright 2018 - %s https://gitee.com/dromara/mybatis-jpa-extra/
-
- Licensed under the Apache License, Version 2.0
---------------------------------------------------------------------------------
"""
,
SystemUtils
.
JAVA_VENDOR
,
SystemUtils
.
JAVA_VERSION
,
SystemUtils
.
JAVA_CLASS_VERSION
,
SystemUtils
.
JAVA_VM_NAME
,
SystemUtils
.
JAVA_VM_VERSION
,
SystemUtils
.
JAVA_VM_INFO
,
(
char
)
0xA9
,
LocalDateTime
.
now
().
getYear
()
);
}
return
VERSION
;
}
}
mybatis-jpa-extra-core/src/main/java/org/dromara/mybatis/jpa/util/package-info.java
已删除
100644 → 0
浏览文件 @
dfd767aa
/*
* Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.dromara.mybatis.jpa.util
;
mybatis-jpa-extra-core/src/test/java/org/dromara/mybatis/jpa/util/JpaSpringContextTest.java
0 → 100644
浏览文件 @
f198470d
package
org.dromara.mybatis.jpa.util
;
import
org.dromara.mybatis.jpa.spring.MybatisJpaContext
;
import
org.junit.jupiter.api.Test
;
public
class
JpaSpringContextTest
{
@Test
public
void
version
(){
System
.
out
.
println
(
MybatisJpaContext
.
version
());
}
}
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/dromara/mybatis/jpa/test/MybatisJpaApplication.java
浏览文件 @
f198470d
...
...
@@ -19,9 +19,9 @@ package org.dromara.mybatis.jpa.test;
import
org.dromara.mybatis.jpa.entity.JpaPageResults
;
import
org.dromara.mybatis.jpa.id.SerialGenerator
;
import
org.dromara.mybatis.jpa.spring.MybatisJpaContext
;
import
org.dromara.mybatis.jpa.test.dao.service.StudentsService
;
import
org.dromara.mybatis.jpa.test.entity.Students
;
import
org.dromara.mybatis.jpa.util.MybatisJpaContext
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/dromara/mybatis/jpa/test/MybatisJpaApplicationTest.java
浏览文件 @
f198470d
...
...
@@ -20,9 +20,9 @@ package org.dromara.mybatis.jpa.test;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.dromara.mybatis.jpa.spring.MybatisJpaContext
;
import
org.dromara.mybatis.jpa.test.dao.service.StudentsService
;
import
org.dromara.mybatis.jpa.test.entity.Students
;
import
org.dromara.mybatis.jpa.util.MybatisJpaContext
;
import
org.junit.jupiter.api.BeforeEach
;
import
org.junit.jupiter.api.Test
;
import
org.slf4j.Logger
;
...
...
mybatis-jpa-extra-test/src/test/java/org/dromara/mybatis/jpa/test/InitContext.java
浏览文件 @
f198470d
...
...
@@ -3,8 +3,8 @@ package org.dromara.mybatis.jpa.test;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
org.dromara.mybatis.jpa.spring.MybatisJpaContext
;
import
org.dromara.mybatis.jpa.test.dao.service.StudentsService
;
import
org.dromara.mybatis.jpa.util.MybatisJpaContext
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.context.ApplicationContext
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录