|
1 | 1 | ## Changelog |
2 | 2 |
|
| 3 | +- Released version 6.1.0, PageHelper provides direct dependency on jsqlparser as intermediate interfaces, allowing |
| 4 | + default implementation replacement through SPI. |
| 5 | +- Upgraded jsqlparser version to 4.7, re-implemented order by, pagination, and count queries. |
| 6 | +- Simplified pom.xml configuration, removed shade-embedded jsqlparser approach, and switched to selecting different |
| 7 | + jsqlparser versions through external dependencies, allowing self-SPI extension. |
| 8 | +- jsqlparser parsing no longer uses a thread pool, supporting SPI extension to override SqlParser implementation. |
| 9 | +- Changed SqlServer pagination to SqlServerSqlParser interface, added parameter sqlServerSqlParser to override the |
| 10 | + default value. |
| 11 | +- Extracted OrderByParser to OrderBySqlParser interface, added orderBySqlParser parameter to override the default |
| 12 | + implementation. |
| 13 | +- Changed static methods of OrderByParser to regular methods, preparing for future interface changes. |
| 14 | +- JSqlParser interface is no longer needed after JDK 8+, removed the interface, and marked the parameter in the |
| 15 | + documentation (_This parameter was used in the early stages to support special configuration for SQL Server_). |
| 16 | + Compatible with jsqlparser 4.7 version. Rui 2023/12/3 15:15. |
| 17 | +- Fixed maven-compiler-plugin version to remove warnings and improve build stability. qxo |
| 18 | +- Added .vscode to .gitignore for vscode IDE. qxo |
| 19 | +- Fixed bug https://github.com/pagehelper/Mybatis-PageHelper/issues/779. chenyuehui |
| 20 | + |
| 21 | +To ensure compatibility with jsqlparser 4.5, 4.7, and possible future versions, |
| 22 | +a new project called pagehelper-sqlparser has been created. |
| 23 | +Currently, it provides two implementations: 4.5 and 4.7. |
| 24 | +To use it, exclude jsqlparser from pagehelper and select one jsqlparser implementation. |
| 25 | +The current version defaults to using the code from version 4.7. |
| 26 | +If you want to switch to the 4.5 implementation, follow the configuration steps below: |
| 27 | + |
| 28 | +```xml |
| 29 | +<dependency> |
| 30 | + <groupId>com.github.pagehelper</groupId> |
| 31 | + <artifactId>pagehelper</artifactId> |
| 32 | + <version>6.1.0</version> |
| 33 | + <exclusions> |
| 34 | + <exclusion> |
| 35 | + <groupId>com.github.jsqlparser</groupId> |
| 36 | + <artifactId>jsqlparser</artifactId> |
| 37 | + </exclusion> |
| 38 | + </exclusions> |
| 39 | +</dependency> |
| 40 | +<dependency> |
| 41 | + <groupId>com.github.pagehelper</groupId> |
| 42 | + <artifactId>sqlparser4.5</artifactId> |
| 43 | + <version>6.1.0</version> |
| 44 | +</dependency> |
| 45 | +``` |
| 46 | + |
| 47 | +The priority of replacing default values with SPI is lower than the implementations specified by the sqlServerSqlParser, |
| 48 | +orderBySqlParser, and countSqlParser parameters. |
| 49 | +If no specific implementation is specified, the SPI implementation will take effect if available. |
| 50 | +You can refer to the code in the pagehelper-sqlsource module for SPI implementation examples. |
| 51 | + |
| 52 | +By default, JSqlParser uses a temporarily created `Executors.newSingleThreadExecutor()` for parsing SQL. |
| 53 | +Here, the thread pool is bypassed through the API: |
| 54 | + |
| 55 | +```java |
| 56 | +CCJSqlParser parser = CCJSqlParserUtil.newParser(statementReader); |
| 57 | +parser. |
| 58 | + |
| 59 | +withSquareBracketQuotation(true); |
| 60 | +return parser. |
| 61 | + |
| 62 | +Statement(); |
| 63 | +``` |
| 64 | + |
| 65 | +The purpose of using a thread pool in JSqlParser is to prevent parsing timeouts. Therefore, if you have encountered |
| 66 | +timeout situations, |
| 67 | +you can introduce the following dependency (which overrides the default implementation through SPI with a timeout of 10 |
| 68 | +seconds): |
| 69 | + |
| 70 | +```xml |
| 71 | +<dependency> |
| 72 | + <groupId>com.github.pagehelper</groupId> |
| 73 | + <artifactId>sqlparser-timeout</artifactId> |
| 74 | + <version>6.1.0</version> |
| 75 | +</dependency> |
| 76 | +``` |
| 77 | + |
3 | 78 | ### 6.0.0 - 2023-11-05 |
4 | 79 |
|
5 | 80 | - Based on JDK 8 adaptation, JDK 6 and 7 are not supported from 6.0 onwards, and 5.x versions can be used if necessary |
|
0 commit comments