eqv2 Upgrade to v3🔥
eqv2 version has completed the development of all major core functions. Users who do not want to upgrade can continue to use v2, and bugs will still be fixed
For better and more stable development of the framework, as well as source code readability and maintainability, the author plans to make major changes to the v2 version (previously development was prioritized with functionality first, after all, the author also needs to use it). On one hand, due to historical reasons, easy-query's api4j module and api4kt module occupied a large number of categories, forcing entity classes to use other class names. On the other hand, too many API choices not only distracted the author's energy but also caused more confusion and choice difficulties for users. Therefore, upgrading from v2 to v3 has the following break changes
BreakChange
Configuration Default Value Changes
| Configuration Item | v2 Default | v3 Default |
|---|---|---|
| propertyMode | FIRST_LOWER | SAME_AS_ENTITY |
| mappingStrategy | COLUMN_ONLY | PROPERTY_FIRST |
| sharding | - | false |
3.0.3 Breaking Changes
New properties
| Configuration Item | v2 Default | v3 Default |
|---|---|---|
| sharding | - | false |
EntityExpressionExecutor default implementation DefaultEntityExpressionExecutor no longer supports sharding. If sharding is needed, please replace the implementation with ShardingEntityExpressionExecutor
and optimize the internal logic of DefaultEntityExpressionExecutor
Default Removal of keepNativeStyle
The framework uses keepStyle by default to change single quotes in native SQL fragments to double single quotes. If not needed, you can use the messageFormat function to disable it
Remove api4j
v3 version focuses on entity mode, so the User::getName method is no longer recommended. Therefore, the api4j package is directly removed. So if users want to use api4j and upgrade to v3, they can independently pull sql-api4j from the v2 source code and then separately introduce the v3 sql-core package for relevant adaptation
Remove api4kt
Same reason as above
Remove Deprecated APIs
Remove deprecated APIs marked with @Deprecated. Users can migrate to the new version API according to the source code prompts before upgrading
GroupKeys.TABLE1.....NQueryStrategy,ProxyEntityOnDuplicateKeyUpdate,SQLOnDuplicateKeyIgnoreinterfacesqueryLargeColumnmethodlargeattribute under@Columnexistschanged totable.expression().existsnotExistschanged totable.expression().notExistsvalueOrDefault,fetchBy,selectSum,selectAvg,selectMax,selectMin,trimStart,trimEnd,plus+TimeUnit,duration+DateTimeDurationEnum,sqlTypeSQLParameter,SQLConstantExpression,join,sqlType,sqlType,sqlType,sqlType,sqlTypefetchBy,keepNativeStyle
Startup Class Error
Must select a database in the configuration file, cannot leave it unselected
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'easyQueryClient' defined in class path resource [com/easy/query/sql/starter/EasyQueryStarterBuildAutoConfiguration.class]: Failed to instantiate [com.easy.query.core.api.client.EasyQueryClient]: Factory method 'easyQueryClient' threw exception with message: Please select the correct database dialect. For Spring-related configuration, set it in the yml file, for example:[easy-query.database: mysql]Class and Interface Changes
| v2 | v3 |
|---|---|
| SQLExpression1....11 | SQLActionExpression1....11 |
| ColumnFunctionCompareComparableStringChainExpression | StringTypeExpression |
| ColumnFunctionCompareComparableNumberChainExpression | NumberTypeExpression |
| ColumnFunctionCompareComparableDateTimeChainExpression | DateTimeTypeExpression |
| ColumnFunctionCompareComparableBooleanChainExpression | BooleanTypeExpression |
| ColumnFunctionCompareComparableAnyChainExpression | AnyTypeExpression |
| ColumnFunctionCompareComparablePartitionByChainExpression | PartitionByTypeExpression |
| ColumnFunctionCompareComparableJsonMapChainExpression | JsonMapTypeExpression |