Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MaxKey单点登录官方(MaxKeyTop)
Mybatis Jpa Extra
提交
4d9224bf
M
Mybatis Jpa Extra
项目概览
MaxKey单点登录官方(MaxKeyTop)
/
Mybatis Jpa Extra
9 个月 前同步成功
通知
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 搜索 >>
提交
4d9224bf
编写于
3月 13, 2023
作者:
M
MaxKey
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化
上级
20c573be
变更
33
隐藏空白更改
内联
并排
Showing
33 changed file
with
62 addition
and
136 deletion
+62
-136
mybatis-jpa-extra-3.0.jar
mybatis-jpa-extra-3.0.jar
+0
-0
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/AbstractStatementHandlerInterceptor.java
...ache/mybatis/jpa/AbstractStatementHandlerInterceptor.java
+0
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/AllStatementHandlerInterceptor.java
...rg/apache/mybatis/jpa/AllStatementHandlerInterceptor.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/MyBatisSessionFactoryBean.java
...ava/org/apache/mybatis/jpa/MyBatisSessionFactoryBean.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/StatementHandlerInterceptor.java
...a/org/apache/mybatis/jpa/StatementHandlerInterceptor.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/DB2Dialect.java
.../main/java/org/apache/mybatis/jpa/dialect/DB2Dialect.java
+0
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/DerbyDialect.java
...ain/java/org/apache/mybatis/jpa/dialect/DerbyDialect.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/Dialect.java
...src/main/java/org/apache/mybatis/jpa/dialect/Dialect.java
+0
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/HighgoDialect.java
...in/java/org/apache/mybatis/jpa/dialect/HighgoDialect.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/MySQLDialect.java
...ain/java/org/apache/mybatis/jpa/dialect/MySQLDialect.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/OracleDialect.java
...in/java/org/apache/mybatis/jpa/dialect/OracleDialect.java
+0
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/PostgreSQLDialect.java
...ava/org/apache/mybatis/jpa/dialect/PostgreSQLDialect.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/SQLServerDialect.java
...java/org/apache/mybatis/jpa/dialect/SQLServerDialect.java
+0
-2
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/id/SerialGenerator.java
.../main/java/org/apache/mybatis/jpa/id/SerialGenerator.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/id/package-info.java
...src/main/java/org/apache/mybatis/jpa/id/package-info.java
+0
-8
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/MapperMetadata.java
...va/org/apache/mybatis/jpa/persistence/MapperMetadata.java
+0
-1
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/package-info.java
...java/org/apache/mybatis/jpa/persistence/package-info.java
+0
-8
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/provider/SqlSyntax.java
...rg/apache/mybatis/jpa/persistence/provider/SqlSyntax.java
+0
-3
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/util/MybatisJpaContext.java
...n/java/org/apache/mybatis/jpa/util/MybatisJpaContext.java
+44
-10
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/util/package-info.java
...c/main/java/org/apache/mybatis/jpa/util/package-info.java
+0
-8
mybatis-jpa-extra-spring-boot-starter-3.0.jar
mybatis-jpa-extra-spring-boot-starter-3.0.jar
+0
-0
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/apache/mybatis/jpa/test/MybatisJpaApplication.java
...va/org/apache/mybatis/jpa/test/MybatisJpaApplication.java
+1
-1
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/apache/mybatis/jpa/test/MybatisJpaApplicationTest.java
...rg/apache/mybatis/jpa/test/MybatisJpaApplicationTest.java
+1
-7
mybatis-jpa-extra-spring-boot-starter/src/main/java/org/apache/mybatis/jpa/starter/MybatisAutoConfiguration.java
.../apache/mybatis/jpa/starter/MybatisAutoConfiguration.java
+1
-0
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/dao/persistence/StudentsMapper.java
...ache/mybatis/jpa/test/dao/persistence/StudentsMapper.java
+1
-3
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/dao/service/StudentsService.java
.../apache/mybatis/jpa/test/dao/service/StudentsService.java
+4
-6
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/entity/Students.java
...ain/java/org/apache/mybatis/jpa/test/entity/Students.java
+7
-34
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/CurdTestRunner.java
...test/java/org/apache/mybatis/jpa/test/CurdTestRunner.java
+0
-4
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/InitContext.java
...rc/test/java/org/apache/mybatis/jpa/test/InitContext.java
+2
-2
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/PageResultsTestRunner.java
...va/org/apache/mybatis/jpa/test/PageResultsTestRunner.java
+0
-5
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/SerialGeneratorTest.java
...java/org/apache/mybatis/jpa/test/SerialGeneratorTest.java
+0
-1
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/SnowFlakeIdGeneratorTest.java
...org/apache/mybatis/jpa/test/SnowFlakeIdGeneratorTest.java
+1
-1
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/copyright.txt
...t/src/test/java/org/apache/mybatis/jpa/test/copyright.txt
+0
-16
未找到文件。
mybatis-jpa-extra-3.0.jar
浏览文件 @
4d9224bf
无法预览此类型文件
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/AbstractStatementHandlerInterceptor.java
浏览文件 @
4d9224bf
...
...
@@ -29,8 +29,6 @@ import org.apache.mybatis.jpa.dialect.Dialect;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
abstract
class
AbstractStatementHandlerInterceptor
implements
Interceptor
{
protected
Logger
_logger
=
LoggerFactory
.
getLogger
(
getClass
());
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/AllStatementHandlerInterceptor.java
浏览文件 @
4d9224bf
...
...
@@ -41,7 +41,6 @@ import org.apache.mybatis.jpa.persistence.JpaBaseEntity;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
@Intercepts
({
@Signature
(
type
=
StatementHandler
.
class
,
method
=
"prepare"
,
args
=
{
Connection
.
class
,
Integer
.
class
}),
@Signature
(
type
=
StatementHandler
.
class
,
method
=
"parameterize"
,
args
=
{
Statement
.
class
}),
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/MyBatisSessionFactoryBean.java
浏览文件 @
4d9224bf
...
...
@@ -27,7 +27,6 @@ import org.mybatis.spring.SqlSessionFactoryBean;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
MyBatisSessionFactoryBean
extends
SqlSessionFactoryBean
{
protected
Logger
_logger
=
LoggerFactory
.
getLogger
(
MyBatisSessionFactoryBean
.
class
);
private
List
<
Interceptor
>
interceptors
=
Collections
.
emptyList
();
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/StatementHandlerInterceptor.java
浏览文件 @
4d9224bf
...
...
@@ -36,7 +36,6 @@ import org.apache.mybatis.jpa.persistence.JpaPagination;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
@Intercepts
(
{
@Signature
(
type
=
StatementHandler
.
class
,
method
=
"prepare"
,
args
=
{
Connection
.
class
,
Integer
.
class
})})
public
class
StatementHandlerInterceptor
extends
AbstractStatementHandlerInterceptor
implements
Interceptor
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/DB2Dialect.java
浏览文件 @
4d9224bf
...
...
@@ -21,8 +21,6 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
DB2Dialect
extends
Dialect
{
public
DB2Dialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/DerbyDialect.java
浏览文件 @
4d9224bf
...
...
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
DerbyDialect
extends
Dialect
{
public
DerbyDialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/Dialect.java
浏览文件 @
4d9224bf
...
...
@@ -24,8 +24,6 @@ import org.apache.mybatis.jpa.persistence.JpaPagination;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
/**
* DB Access Dialect,inspiration from hibernate
*
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/HighgoDialect.java
浏览文件 @
4d9224bf
...
...
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
HighgoDialect
extends
Dialect
{
public
HighgoDialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/MySQLDialect.java
浏览文件 @
4d9224bf
...
...
@@ -22,7 +22,6 @@ import java.sql.SQLException;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
MySQLDialect
extends
Dialect
{
public
MySQLDialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/OracleDialect.java
浏览文件 @
4d9224bf
...
...
@@ -21,8 +21,6 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
OracleDialect
extends
Dialect
{
public
OracleDialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/PostgreSQLDialect.java
浏览文件 @
4d9224bf
...
...
@@ -21,7 +21,6 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
PostgreSQLDialect
extends
Dialect
{
public
PostgreSQLDialect
()
{
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/dialect/SQLServerDialect.java
浏览文件 @
4d9224bf
...
...
@@ -22,12 +22,10 @@ import java.sql.PreparedStatement;
import
java.sql.SQLException
;
import
org.apache.mybatis.jpa.persistence.JpaPagination
;
public
class
SQLServerDialect
extends
Dialect
{
public
SQLServerDialect
()
{
super
();
}
@Override
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/id/SerialGenerator.java
浏览文件 @
4d9224bf
...
...
@@ -124,5 +124,4 @@ public class SerialGenerator implements IdentifierGenerator{
getNodeNumber
();
}
}
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/id/package-info.java
浏览文件 @
4d9224bf
...
...
@@ -14,12 +14,4 @@
* limitations under the License.
*/
/**
*
*/
/**
* @author Administrator
*
*/
package
org.apache.mybatis.jpa.id
;
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/MapperMetadata.java
浏览文件 @
4d9224bf
...
...
@@ -43,7 +43,6 @@ import jakarta.persistence.Transient;
* @author Crystal.Sea
*
*/
public
class
MapperMetadata
<
T
extends
JpaBaseEntity
>{
private
static
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
MapperMetadata
.
class
);
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/package-info.java
浏览文件 @
4d9224bf
...
...
@@ -13,13 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
/**
* @author user
*
*/
package
org.apache.mybatis.jpa.persistence
;
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/persistence/provider/SqlSyntax.java
浏览文件 @
4d9224bf
...
...
@@ -21,7 +21,4 @@ public class SqlSyntax {
public
static
final
String
COUNT_ONE
=
"count(1)"
;
}
}
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/util/MybatisJpaContext.java
浏览文件 @
4d9224bf
...
...
@@ -19,8 +19,11 @@ package org.apache.mybatis.jpa.util;
import
org.apache.commons.lang.SystemUtils
;
import
org.joda.time.DateTime
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeansException
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.support.PropertySourcesPlaceholderConfigurer
;
import
org.springframework.core.env.StandardEnvironment
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
...
...
@@ -29,21 +32,44 @@ import org.springframework.web.context.support.WebApplicationContextUtils;
import
jakarta.servlet.http.HttpServletRequest
;
import
jakarta.servlet.http.HttpSession
;
/**
*
Application
Context
*
Mybatis Jpa
Context
*
* @author Crystal.Sea
* @since
1.6
* @since
3.0
*/
public
final
class
MybatisJpaContext
{
private
static
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
MybatisJpaContext
.
class
);
private
static
String
VERSION
=
null
;
p
ublic
static
StandardEnvironment
properties
;
p
rivate
static
StandardEnvironment
properties
;
public
static
ApplicationContext
applicationContext
=
null
;
private
static
ApplicationContext
mybatisJpaContext
=
null
;
/**
* init mybatisJpaContext and properties
*
* @param applicationContext
*/
public
static
void
init
(
ApplicationContext
applicationContext
)
{
mybatisJpaContext
=
applicationContext
;
if
(
mybatisJpaContext
.
containsBean
(
"propertySourcesPlaceholderConfigurer"
))
{
_logger
.
trace
(
"init MybatisJpaContext properties"
);
PropertySourcesPlaceholderConfigurer
propertySourcesPlaceholderConfigurer
=
((
PropertySourcesPlaceholderConfigurer
)
applicationContext
.
getBean
(
"propertySourcesPlaceholderConfigurer"
));
properties
=
(
StandardEnvironment
)
propertySourcesPlaceholderConfigurer
.
getAppliedPropertySources
()
.
get
(
PropertySourcesPlaceholderConfigurer
.
ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME
)
.
getSource
();
}
}
/**
* get ApplicationContext from web ServletContext configuration
...
...
@@ -59,18 +85,18 @@ public final class MybatisJpaContext {
* @return Object
*/
public
static
Object
getBean
(
String
id
){
if
(
application
Context
==
null
)
{
if
(
mybatisJpa
Context
==
null
)
{
return
getApplicationContext
().
getBean
(
id
);
}
else
{
return
application
Context
.
getBean
(
id
);
return
mybatisJpa
Context
.
getBean
(
id
);
}
}
public
static
<
T
>
T
getBean
(
String
name
,
Class
<
T
>
requiredType
)
throws
BeansException
{
if
(
application
Context
==
null
)
{
if
(
mybatisJpa
Context
==
null
)
{
return
getApplicationContext
().
getBean
(
name
,
requiredType
);
}
else
{
return
application
Context
.
getBean
(
name
,
requiredType
);
return
mybatisJpa
Context
.
getBean
(
name
,
requiredType
);
}
};
...
...
@@ -91,6 +117,14 @@ public final class MybatisJpaContext {
return
getRequest
().
getSession
();
}
public
static
StandardEnvironment
getProperties
()
{
return
properties
;
}
public
static
ApplicationContext
getMybatisJpaContext
()
{
return
mybatisJpaContext
;
}
public
static
String
version
()
{
if
(
VERSION
==
null
)
{
StringBuffer
version
=
...
...
mybatis-jpa-extra-core/src/main/java/org/apache/mybatis/jpa/util/package-info.java
浏览文件 @
4d9224bf
...
...
@@ -13,13 +13,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
/**
* @author user
*
*/
package
org.apache.mybatis.jpa.util
;
mybatis-jpa-extra-spring-boot-starter-3.0.jar
浏览文件 @
4d9224bf
无法预览此类型文件
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/apache/mybatis/jpa/test/MybatisJpaApplication.java
浏览文件 @
4d9224bf
...
...
@@ -60,7 +60,7 @@ public class MybatisJpaApplication implements ApplicationRunner{
@Override
public
void
run
(
ApplicationArguments
args
)
throws
Exception
{
MybatisJpaContext
.
applicationContext
=
applicationContext
;
MybatisJpaContext
.
init
(
applicationContext
)
;
_logger
.
info
(
"queryPageResults by mapperId..."
);
Students
student
=
new
Students
();
...
...
mybatis-jpa-extra-spring-boot-starter-test/src/test/java/org/apache/mybatis/jpa/test/MybatisJpaApplicationTest.java
浏览文件 @
4d9224bf
...
...
@@ -43,11 +43,10 @@ public class MybatisJpaApplicationTest{
@Autowired
private
ApplicationContext
applicationContext
;
@BeforeEach
public
void
before
()
{
_logger
.
info
(
"---------------- before"
);
MybatisJpaContext
.
applicationContext
=
applicationContext
;
MybatisJpaContext
.
init
(
applicationContext
)
;
}
...
...
@@ -78,7 +77,6 @@ public class MybatisJpaApplicationTest{
}
@Test
public
void
remove
()
throws
Exception
{
...
...
@@ -105,9 +103,7 @@ public class MybatisJpaApplicationTest{
_logger
.
info
(
"queryPageResults..."
);
Students
student
=
new
Students
();
//student.setId("af04d610-6092-481e-9558-30bd63ef783c");
student
.
setStdGender
(
"M"
);
//student.setStdMajor(政治");
student
.
setPageSize
(
10
);
student
.
setPageNumber
(
2
);
List
<
Students
>
allListStudents
=
...
...
@@ -123,7 +119,6 @@ public class MybatisJpaApplicationTest{
_logger
.
info
(
"queryPageResults by mapperId..."
);
Students
student
=
new
Students
();
student
.
setStdGender
(
"M"
);
//student.setStdMajor(政治");
student
.
setPageSize
(
10
);
student
.
setPageNumber
(
2
);
...
...
@@ -145,6 +140,5 @@ public class MybatisJpaApplicationTest{
_logger
.
info
(
"Students "
+
s
);
}
}
}
mybatis-jpa-extra-spring-boot-starter/src/main/java/org/apache/mybatis/jpa/starter/MybatisAutoConfiguration.java
浏览文件 @
4d9224bf
...
...
@@ -83,6 +83,7 @@ import org.springframework.util.StringUtils;
* @author Josh Long
* @author Kazuki Shimizu
* @author Eduardo Macarrón
* @author Crystal.Sea
*/
@org
.
springframework
.
context
.
annotation
.
Configuration
(
proxyBeanMethods
=
false
)
@ConditionalOnClass
({
SqlSessionFactory
.
class
,
SqlSessionFactoryBean
.
class
})
...
...
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/dao/persistence/StudentsMapper.java
浏览文件 @
4d9224bf
...
...
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
...
...
@@ -25,12 +24,11 @@ import java.util.List;
import
org.apache.mybatis.jpa.persistence.IJpaBaseMapper
;
import
org.apache.mybatis.jpa.test.entity.Students
;
/**
* @author Crystal.Sea
*
*/
public
interface
StudentsMapper
extends
IJpaBaseMapper
<
Students
>
{
public
interface
StudentsMapper
extends
IJpaBaseMapper
<
Students
>
{
public
List
<
Students
>
queryPageResults1
(
Students
entity
);
}
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/dao/service/StudentsService.java
浏览文件 @
4d9224bf
...
...
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.mybatis.jpa.test.dao.service
;
...
...
@@ -22,7 +21,6 @@ import org.apache.mybatis.jpa.test.dao.persistence.StudentsMapper;
import
org.apache.mybatis.jpa.test.entity.Students
;
import
org.springframework.stereotype.Service
;
@Service
public
class
StudentsService
extends
JpaBaseService
<
Students
>
{
...
...
@@ -31,14 +29,14 @@ public class StudentsService extends JpaBaseService<Students> {
}
/* (non-Javadoc)
/*
* (non-Javadoc)
*
* @see com.connsec.db.service.BaseService#getMapper()
*/
@Override
public
StudentsMapper
getMapper
()
{
return
(
StudentsMapper
)
super
.
getMapper
();
return
(
StudentsMapper
)
super
.
getMapper
();
}
}
mybatis-jpa-extra-test/src/main/java/org/apache/mybatis/jpa/test/entity/Students.java
浏览文件 @
4d9224bf
...
...
@@ -13,13 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.mybatis.jpa.test.entity
;
import
java.io.Serializable
;
import
org.apache.mybatis.jpa.persistence.JpaBaseEntity
;
import
jakarta.persistence.Column
;
...
...
@@ -29,8 +26,6 @@ import jakarta.persistence.GenerationType;
import
jakarta.persistence.Id
;
import
jakarta.persistence.Table
;
/*
ID varchar(40) not null,
NAME varchar(60) not null,
...
...
@@ -46,18 +41,18 @@ import jakarta.persistence.Table;
*
*/
@Entity
@Table
(
name
=
"STUDENTS"
)
public
class
Students
extends
JpaBaseEntity
implements
Serializable
{
@Table
(
name
=
"STUDENTS"
)
public
class
Students
extends
JpaBaseEntity
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
-
6928570405840778151L
;
@Id
@Column
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
,
generator
=
"snowflakeid"
)
//@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ_MYBATIS_STUD")
//@GeneratedValue(strategy=GenerationType.IDENTITY,generator="SEQ_MYBATIS_STUD")
@GeneratedValue
(
strategy
=
GenerationType
.
AUTO
,
generator
=
"snowflakeid"
)
//
@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ_MYBATIS_STUD")
//
@GeneratedValue(strategy=GenerationType.IDENTITY,generator="SEQ_MYBATIS_STUD")
private
String
id
;
@Column
private
String
stdNo
;
...
...
@@ -71,11 +66,9 @@ public class Students extends JpaBaseEntity implements Serializable{
private
String
stdMajor
;
@Column
private
String
stdClass
;
@Column
private
byte
[]
images
;
public
Students
()
{
super
();
}
...
...
@@ -88,90 +81,70 @@ public class Students extends JpaBaseEntity implements Serializable{
return
stdNo
;
}
public
void
setStdNo
(
String
stdNo
)
{
this
.
stdNo
=
stdNo
;
}
public
String
getStdName
()
{
return
stdName
;
}
public
void
setStdName
(
String
stdName
)
{
this
.
stdName
=
stdName
;
}
public
String
getStdGender
()
{
return
stdGender
;
}
public
void
setStdGender
(
String
stdGender
)
{
this
.
stdGender
=
stdGender
;
}
public
int
getStdAge
()
{
return
stdAge
;
}
public
void
setStdAge
(
int
stdAge
)
{
this
.
stdAge
=
stdAge
;
}
public
String
getStdMajor
()
{
return
stdMajor
;
}
public
void
setStdMajor
(
String
stdMajor
)
{
this
.
stdMajor
=
stdMajor
;
}
public
String
getStdClass
()
{
return
stdClass
;
}
public
void
setStdClass
(
String
stdClass
)
{
this
.
stdClass
=
stdClass
;
}
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
byte
[]
getImages
()
{
return
images
;
}
public
void
setImages
(
byte
[]
images
)
{
this
.
images
=
images
;
}
@Override
public
String
toString
()
{
return
"Students [id="
+
id
+
", stdNo="
+
stdNo
+
", stdName="
+
stdName
+
", stdGender="
+
stdGender
+
", stdAge="
+
stdAge
+
", stdMajor="
+
stdMajor
+
", stdClass="
+
stdClass
+
"]"
;
}
}
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/CurdTestRunner.java
浏览文件 @
4d9224bf
...
...
@@ -35,7 +35,6 @@ public class CurdTestRunner {
public
void
insert
()
throws
Exception
{
_logger
.
info
(
"insert..."
);
Students
student
=
new
Students
();
//student.setId("10024");
student
.
setStdNo
(
"10024"
);
student
.
setStdGender
(
"M"
);
student
.
setStdName
(
"司马昭"
);
...
...
@@ -46,14 +45,12 @@ public class CurdTestRunner {
Thread
.
sleep
(
1000
);
_logger
.
info
(
"insert id "
+
student
.
getId
());
//service.remove(student.getId());
}
@Test
public
void
merge
()
throws
Exception
{
_logger
.
info
(
"merge..."
);
Students
student
=
new
Students
();
//student.setId("10024");
student
.
setStdNo
(
"10024"
);
student
.
setStdGender
(
"M"
);
student
.
setStdName
(
"司马昭"
);
...
...
@@ -64,7 +61,6 @@ public class CurdTestRunner {
Thread
.
sleep
(
1000
);
_logger
.
info
(
"insert id "
+
student
.
getId
());
//service.remove(student.getId());
}
...
...
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/InitContext.java
浏览文件 @
4d9224bf
...
...
@@ -22,8 +22,8 @@ public class InitContext {
_logger
.
info
(
"-- --Init Start at {}"
,
startTime
);
_logger
.
info
(
"Application dir "
+
System
.
getProperty
(
"user.dir"
));
context
=
new
ClassPathXmlApplicationContext
(
new
String
[]
{
"spring/applicationContext.xml"
});
MybatisJpaContext
.
applicationContext
=
context
;
MybatisJpaContext
.
init
(
context
)
;
StudentsService
service
=(
StudentsService
)
MybatisJpaContext
.
getBean
(
"studentsService"
);
return
service
;
}
...
...
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/PageResultsTestRunner.java
浏览文件 @
4d9224bf
...
...
@@ -27,7 +27,6 @@ import org.junit.jupiter.api.Test;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
public
class
PageResultsTestRunner
{
private
static
final
Logger
_logger
=
LoggerFactory
.
getLogger
(
PageResultsTestRunner
.
class
);
public
static
StudentsService
service
;
...
...
@@ -37,10 +36,7 @@ public class PageResultsTestRunner {
_logger
.
info
(
"queryPageResults..."
);
Students
student
=
new
Students
();
//student.setStdGender("M");
//student.setStdMajor(政治");
student
.
setPageSize
(
10
);
//student.setPageNumber(2);
student
.
calculate
(
21
);
JpaPageResults
<
Students
>
results
=
service
.
queryPageResults
(
student
);
List
<
Students
>
rowsStudents
=
results
.
getRows
();
...
...
@@ -84,6 +80,5 @@ public class PageResultsTestRunner {
if
(
InitContext
.
context
!=
null
)
return
;
service
=
new
InitContext
().
init
();
}
}
\ No newline at end of file
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/SerialGeneratorTest.java
浏览文件 @
4d9224bf
...
...
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.apache.mybatis.jpa.test
;
...
...
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/SnowFlakeIdGeneratorTest.java
浏览文件 @
4d9224bf
...
...
@@ -33,4 +33,4 @@ public class SnowFlakeIdGeneratorTest {
_logger
.
info
(
"length {}"
,
conditionString
.
length
());
}
}
}
\ No newline at end of file
mybatis-jpa-extra-test/src/test/java/org/apache/mybatis/jpa/test/copyright.txt
已删除
100644 → 0
浏览文件 @
20c573be
/*
* Copyright [2022] [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.
*/
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录