Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update dependency com.github.pagehelper:pagehelper to v6.1.0 - abandoned #111

Closed
wants to merge 2 commits into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 16, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
com.github.pagehelper:pagehelper 6.0.0 -> 6.1.0 age adoption passing confidence

Release Notes

pagehelper/Mybatis-PageHelper (com.github.pagehelper:pagehelper)

v6.1.0: - 2023-12-16

  • 发布6.1.0,PageHelper 提供 jsqlparser直接依赖都是中间接口,可以通过SPI替换默认实现
  • 升级jsqlparser版本4.7,重新实现order by,分页,count查询
  • 简化pom.xml配置,去掉shade内嵌jsqlparser方式,改为通过外部依赖选择不同的jsqlparser版本,允许自己SPI扩展
  • jsqlparser解析不使用线程池,支持SPI扩展覆盖SqlParser实现
  • SqlServer分页改为SqlServerSqlParser接口,添加参数 sqlServerSqlParser 覆盖默认值
  • OrderByParser提取OrderBySqlParser接口,增加 orderBySqlParser 参数,可以覆盖默认实现
  • OrderByParser静态方法改为普通方法,为后续改接口做准备
  • jdk8+后不再需要JSqlParser接口,移除该接口,文档标记该参数(该参数早期用于支持sqlserver特殊配置
    兼容jsqlparser4.7版本 Rui 2023/12/3 15:15
  • maven-compiler-plugin固定版本以去除警告,并增加构建稳定性 qxo
  • gitignore .vscode for vscode ide qxo
  • 修改bug https://github.com/pagehelper/Mybatis-PageHelper/issues/779 chenyuehui

为了兼容 jsqlparser 4.5 和 4.7,以及后续可能存在的其他版本,新建了一个 pagehelper-sqlparser 项目,目前提供了 4.5 和 4.7 两个实现,
使用时从 pagehelper 排除 jsqlparser,然后选择一个 jsqlparser 实现即可,当前版本默认使用的 4.7 版本的代码,
因此如果想换 4.5 的实现,可以按照下面方式进行配置:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>6.1.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.github.jsqlparser</groupId>
            <artifactId>jsqlparser</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>sqlparser4.5</artifactId>
    <version>6.1.0</version>
</dependency>

SPI 替换默认值的优先级低于 sqlServerSqlParser,orderBySqlParser,countSqlParser 参数指定的实现,不指定时如果存在SPI实现,即可生效,
SPI 可以参考 pagehelper-sqlsource 模块代码。

JSqlParser 默认解析 SQL 会使用临时创建的 Executors.newSingleThreadExecutor(),这里通过 API 跳过了线程池:

CCJSqlParser parser = CCJSqlParserUtil.newParser(statementReader);
parser.withSquareBracketQuotation(true);
return parser.Statement();

JSqlParser 使用线程池的目的是为了防止解析超时,因此如果你遇到过超时的情况,可以引入下面的依赖(通过SPI覆盖了默认实现,超时时间10秒):

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>sqlparser-timeout</artifactId>
    <version>6.1.0</version>
</dependency>

  • Released version 6.1.0, PageHelper provides direct dependency on jsqlparser as intermediate interfaces, allowing default implementation replacement through SPI.
  • Upgraded jsqlparser version to 4.7, re-implemented order by, pagination, and count queries.
  • Simplified pom.xml configuration, removed shade-embedded jsqlparser approach, and switched to selecting different jsqlparser versions through external dependencies, allowing self-SPI extension.
  • jsqlparser parsing no longer uses a thread pool, supporting SPI extension to override SqlParser implementation.
  • Changed SqlServer pagination to SqlServerSqlParser interface, added parameter sqlServerSqlParser to override the default value.
  • Extracted OrderByParser to OrderBySqlParser interface, added orderBySqlParser parameter to override the default implementation.
  • Changed static methods of OrderByParser to regular methods, preparing for future interface changes.
  • JSqlParser interface is no longer needed after JDK 8+, removed the interface, and marked the parameter in the documentation (This parameter was used in the early stages to support special configuration for SQL Server).
    Compatible with jsqlparser 4.7 version. Rui 2023/12/3 15:15.
  • Fixed maven-compiler-plugin version to remove warnings and improve build stability. qxo
  • Added .vscode to .gitignore for vscode IDE. qxo
  • Fixed bug https://github.com/pagehelper/Mybatis-PageHelper/issues/779. chenyuehui

To ensure compatibility with jsqlparser 4.5, 4.7, and possible future versions,
a new project called pagehelper-sqlparser has been created.
Currently, it provides two implementations: 4.5 and 4.7.
To use it, exclude jsqlparser from pagehelper and select one jsqlparser implementation.
The current version defaults to using the code from version 4.7.
If you want to switch to the 4.5 implementation, follow the configuration steps below:

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper</artifactId>
    <version>6.1.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.github.jsqlparser</groupId>
            <artifactId>jsqlparser</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>sqlparser4.5</artifactId>
    <version>6.1.0</version>
</dependency>

The priority of replacing default values with SPI is lower than the implementations specified by the sqlServerSqlParser, orderBySqlParser, and countSqlParser parameters.
If no specific implementation is specified, the SPI implementation will take effect if available.
You can refer to the code in the pagehelper-sqlsource module for SPI implementation examples.

By default, JSqlParser uses a temporarily created Executors.newSingleThreadExecutor() for parsing SQL.
Here, the thread pool is bypassed through the API:

CCJSqlParser parser = CCJSqlParserUtil.newParser(statementReader);
parser.withSquareBracketQuotation(true);
return parser.Statement();

The purpose of using a thread pool in JSqlParser is to prevent parsing timeouts. Therefore, if you have encountered timeout situations,
you can introduce the following dependency (which overrides the default implementation through SPI with a timeout of 10 seconds):

<dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>sqlparser-timeout</artifactId>
    <version>6.1.0</version>
</dependency>

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link
Contributor Author

renovate bot commented Dec 17, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@renovate renovate bot changed the title fix(deps): update dependency com.github.pagehelper:pagehelper to v6.1.0 fix(deps): update dependency com.github.pagehelper:pagehelper to v6.1.0 - abandoned Dec 17, 2023
Copy link
Contributor Author

renovate bot commented Dec 17, 2023

Autoclosing Skipped

This PR has been flagged for autoclosing. However, it is being skipped due to the branch being already modified. Please close/delete it manually or report a bug if you think this is in error.

@livk-cloud livk-cloud closed this Dec 17, 2023
@livk-cloud livk-cloud deleted the renovate/pagehelper branch December 18, 2023 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant