Method, system, terminal device, storage medium and product for upgrading and migrating j2ee technology stack

CN116501352BActive Publication Date: 2026-09-22CHINA CONSTRUCTION BANK +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310540782.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2026-09-22
Estimated Expiration
2043-05-15

AI Technical Summary

Benefits of technology

[0025]本发明的有益效果:本发明在可靠背景下为J2EE技术栈升级提供稳定解决方案,开发团队可以最大程度规避技术风险,并灵活选择发布策略,实现架构治理目标平滑过渡,同时整个过程实现了持久层统一访问,屏蔽不同实现差异,对外暴露统一抽象接口,同时也将Mybatis进一步封装为数据访问代理组件。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116501352B_ABST
    Figure CN116501352B_ABST
Patent Text Reader

Abstract

The application provides a J2EE technology stack upgrade method, system, terminal equipment, storage medium and product, and relates to the field of computer systems.The application can reduce the test problem interaction time through the shared knowledge system established by the technical management department, and the developer can perform manual troubleshooting in advance for the known risks of technology stack upgrade, including the influence of new version API of open source components such as Spring5 and Log4j2 on application behavior.The application provides a stable solution for J2EE technology stack upgrade under a reliable background, the development team can avoid technical risks to the greatest extent, and can flexibly select a release strategy to realize smooth transition of the architecture management target, meanwhile, the whole process realizes unified access of the persistent layer, shields different implementation differences, exposes a unified abstract interface, and further encapsulates Mybatis as a data access agent component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer systems, and more specifically, to a method, system, terminal device, storage medium, and product for upgrading and migrating a J2EE technology stack. Background Technology

[0002] J2EE is an enterprise-level distributed application development specification that remains the mainstream solution for enterprise applications today. It features excellent cross-platform compatibility, scalability, and extensive open-source support.

[0003] Commercial banks currently have high requirements for autonomy and control. At the same time, in order to ensure the frequency of technology iteration, they generally adopt a technology stack that combines self-developed frameworks and open-source components. Through risk assessment and iteration plans, they achieve a smooth transition in the process of technology evolution.

[0004] Given the core role of relational databases in platform architecture, the ORM framework, serving as the application layer access point, is crucial for system robustness and even its overall lifecycle. The previously widely used iBatis (a persistence layer framework based on SQL mapping supporting Java and .NET) component has become increasingly unsuitable for large-scale scalable systems due to its inherent deadlock defects and maintenance difficulties. Mybatis, as an alternative, can effectively solve these problems. To achieve unified access to the persistence layer, shield differences between implementations, and expose a unified abstract interface, Mybatis is further encapsulated as a data access proxy component. This is an important aspect of architecture governance and one of the effective solutions for significantly optimizing the enterprise J2EE platform technology stack. Summary of the Invention

[0005] In response to the needs mentioned in the background technology above, embodiments of the present invention provide a method, system, terminal device, storage medium and product for upgrading and migrating the J2EE technology stack, aiming to upgrade the technology stack and transform iBatis into a Mybatis-based encapsulation, with the data encapsulated in Mybatis serving as the main content of the access proxy.

[0006] A method for upgrading and migrating a J2EE technology stack, comprising the following steps:

[0007] Step 1: Remove iBatis-related packages from the project;

[0008] Step 2: Add the relevant Mybatis packages and dependencies to the project:

[0009] Step 3: Remove iBatis-related configurations and files from the project;

[0010] Step 4: Add the relevant Mybatis configuration and files to the project, and add Mybatis-config.xml to the project resource root directory. Create a new mapper directory to store SQL mapping files.

[0011] Step 5: Create the MyBatis SQL mapping file; simultaneously define the configuration file for the SQL mapping file and set configuration parameters for it; then load the configuration file and obtain the configuration parameters; determine whether the configuration file is automatically loaded based on the configuration parameters. If it is automatically loaded, start a refresh Java thread periodically according to the configuration parameters to scan and refresh the SQL mapping file at the frequency or interval set in the configuration parameters, and define a global variable beforeTime to record the last refresh time. Upon receiving the above instructions, call the refresh method to scan the files that need to be refreshed, and obtain the last modification time S of the SQL mapping file. Calculate the difference between the last modification time S and the last refresh time beforeTime to determine whether the SQL mapping file has been modified between the last refresh and the current refresh. If it is determined that there has been a modification, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded, and the last refresh time beforeTime remains unchanged; when the last refreshed SQL mapping file is reloaded into the MyBatis framework, the last refresh time beforeTime is reset to the current refresh time refreshTime.

[0012] Step 6: Delete the DAO implementation class and configuration. Use MapperScannerConfigurer to scan and load the DAO. After the equivalent upgrade of the DAO is completed, delete the DAO implementation class.

[0013] Furthermore: If the project also uses the Spring integration package in step one, then remove it as well.

[0014] Furthermore: The SQL mapping file for Mybatis is copied from the original SQL mapping file for iBatis. Specific modifications include changing sqlMap to mapper, placing the typeAlias ​​tag in the typeAliases tag of the public configuration file, and changing the attribute class in the resultMap tag to type.

[0015] Furthermore: In step six, if the interface has multiple parameters, then convert the interface parameters to a map or apply annotations to the parameters.

[0016] Furthermore: A J2EE technology stack upgrade and migration system, which includes several functional modules for moving related packages into and out of the project. The related packages include iBatis related packages and Mybatis related packages.

[0017] The functional modules include a plugin set, a plugin parsing module, a basic file injection plugin module, and a style parsing plugin;

[0018] The plugin set includes several plugins, each of which is used to identify, call, and load the iBatis and Mybatis technology stack-related configurations and files.

[0019] The plugin parsing module is used to parse configuration files in the iBatis and Mybatis technology stacks. It also creates Mybatis SQL mapping files, defines configuration files for these files, and sets configuration parameters. Based on these parameters, it determines whether the configuration file is automatically loaded. If so, it periodically starts a Java thread to refresh the SQL mapping file at the frequency or interval specified in the configuration parameters. Finally, it records the difference between the last modification time and the last refresh time of the SQL mapping file, and uses this difference to determine if the SQL mapping file has been modified. If it is determined that a modification has occurred, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded. The plugin parsing module is also used to periodically start a Java thread to refresh the configuration file. The system executes the scanning and refreshing of SQL mapping files at a set frequency or interval, and defines a global variable `beforeTime` to record the last refresh time. Upon receiving the above instructions, it calls the refresh method to scan the files that need to be refreshed and obtains the last modification time `S` of the SQL mapping files. It calculates the difference between the last modification time `S` and the last refresh time `beforeTime` to determine whether the SQL mapping files have been modified between the last refresh and the current refresh. If modifications are found, it proves that there are SQL mapping files that need to be reloaded; otherwise, it proves that there are no SQL mapping files that need to be reloaded, and the last refresh time `beforeTime` remains unchanged. When the last refreshed SQL mapping files are reloaded into the MyBatis framework, the last refresh time `beforeTime` is reset to the current refresh time `refrehTime`.

[0020] The basic file injection plugin module is used to add Mybatis-related configurations and files to the project, and also add Mybatis-config.xml to the project resource root directory;

[0021] The style parsing plugin is used to delete the implementation classes and configurations of the DAO. It uses MapperScannerConfigurer to scan and load the DAO, and after the equivalent upgrade of the DAO, it deletes the DAO implementation classes.

[0022] Furthermore, the terminal device may include a processor, a storage medium, and a bus. The storage medium stores machine-readable instructions that can be executed by the processor. When the terminal device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the deep learning model training method as described in the foregoing embodiments.

[0023] Further: a storage medium storing a computer program, which, when executed by a processor, performs the steps of the method described above.

[0024] Further: A computer program product includes a computer program that is executed by a processor using the methods described above.

[0025] The beneficial effects of this invention are as follows: This invention provides a stable solution for upgrading the J2EE technology stack under a reliable background. The development team can avoid technical risks to the greatest extent and flexibly choose release strategies to achieve a smooth transition of architecture governance goals. At the same time, the whole process realizes unified access to the persistence layer, shields the differences between different implementations, exposes a unified abstract interface to the outside world, and further encapsulates Mybatis as a data access proxy component. Attached Figure Description

[0026] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 This illustrates different scenarios of internet connectivity between entities.

[0028] Figure 2 A schematic diagram of the system of the present invention is shown.

[0029] Figure 3 A schematic diagram of the components of the terminal device of the present invention is shown. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the accompanying drawings in the present invention are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of the present invention. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this invention illustrate operations implemented according to some embodiments of the present invention. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this invention, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.

[0031] Furthermore, the embodiments described herein are merely some, not all, of the embodiments of the invention. The components of the embodiments of the invention described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0032] It should be noted that the term "comprising" will be used in the embodiments of the present invention to indicate the presence of a feature subsequently declared, but does not preclude the addition of other features. It should also be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In the description of the present invention, it should also be noted that the terms "first," "second," "third," etc., are used only for distinguishing descriptions and should not be construed as indicating or implying relative importance.

[0033] The following is a detailed description of this case, in conjunction with the relevant accompanying drawings in the instruction manual.

[0034] Figure 1 The process of upgrading iBatis to Mybatis in the method of this invention is illustrated.

[0035] Specifically, the above method includes the following steps:

[0036] Step 1: Remove the iBatis-related packages from the project. There is actually only one iBatis-related package: iBatis-sqlmap-xxxjar, which may vary depending on the project version. If the project also uses the Spring integration package spring-orm-xxxjar, remove it as well.

[0037] Step 2: Add the relevant Mybatis packages and dependencies to the project:

[0038] There is actually only one package related to Mybatis, namely: Mybatis-xxxjar. However, we usually integrate Mybatis with Spring to make it easier to use the transaction management features provided by Spring. Therefore, we also need to import Mybatis-spring-xxxjar.

[0039] Step 3: Remove iBatis-related configurations and files from the project;

[0040] For example, the iBatis configuration includes <properties>The `<property>` element is used to use standard Java property files (name=value) in configuration files.

[0041] Properties defined in the properties file can be referenced as variables in the SQL Map configuration file and all its contained SQL Map mapping files, or they can reference a specific file. For example, `maxRequests` represents the maximum number of threads that can execute SQL statements concurrently. Threads exceeding this value will be blocked until another thread completes execution. Different DBMSs have different limits, but all databases have these limitations. Typically, this value should be at least 10 times `maxTransactions` and always greater than `maxSessions` and `maxTransactions`. Decreasing this parameter value usually improves performance. For example: `maxRequests = "256"` (default: 512). `maxSessions` represents the maximum number of sessions active simultaneously. A session can be an explicit session requested by code or a session automatically obtained when a thread uses a `SqlMapClient` instance (i.e., executes a statement). It should always be greater than or equal to `maxTransactions` and less than `maxRequests`. Decreasing this parameter value usually reduces memory usage. For example: `maxSessions = "64"` (default: 128). `maxTransactions` represents the maximum number of threads that can simultaneously enter `SqlMapClient.startTransaction()`. Threads exceeding this value will be blocked until another thread exits. Different DBMSs have different limits, but all databases have these limitations.

[0042] This parameter value should always be less than or equal to maxSessions and always much less than maxRequests. Decreasing this parameter value usually improves performance.

[0043] For example: maxTransactions="16" Default value: 32 cacheModelsEnabled Globally enables or disables all cached models of SqlMapClient.

[0044] Used when debugging programs. For example: cacheModelsEnabled="true" Default value: true (enabled) lazyLoadingEnabled Globally enables or disables all lazy loading of SqlMapClient.

[0045] Used when debugging programs. Example: lazyLoadingEnabled="true" Default value: true (enabled) enhancementEnabled Globally enables or disables runtime bytecode enhancement.

[0046] This optimizes the performance of accessing Java Bean properties, as well as lazy loading. Example: `enhancementEnabled="true"` Default: `false` (disabled).

[0047] If the useStatementNamespaces property is enabled, the fully qualified name must be used to reference the mapped statement. The fully qualified name of the mapped statement is composed of the name of the sql-map and the name of the mapped-statement.

[0048] Step 4: Add the relevant Mybatis configuration and files to the project, and add Mybatis-config.xml to the project resource root directory. Create a new mapper directory to store SQL mapping files.

[0049] The SQL mapping XML file is where all SQL statements are placed. Unlike JDBC connection methods, which require a constructor and statements to call specific SQL statements, you only need to write all SQL statements in the configuration file, and these statements can be called directly in the class based on different IDs.

[0050] Additionally, the file needs to define a workspace, typically the path to the corresponding interface class. The written SQL mapping file also needs to be referenced within the `<mapper>` tag of the Mybatis main configuration file.

[0051] Step 5: Create the Mybatis SQL mapping file. This file can be copied from the original iBatis SQL mapping file. Specific modifications include changing `sqlMap` to `mapper`, and replacing the `typeAlias` tag (which is no longer supported in Mybatis) with the `typeAliases` tag in the common configuration file. The `resultMap` tag's attribute changes from `class` to `type`, and the `jdbcType` value (which is not supported in Mybatis) changes from `LONG` to `BIGIN`. Simultaneously, define the configuration file for the SQL mapping file and set its configuration parameters. Then, load the configuration file and retrieve the configuration parameters. Use the configuration parameters to determine if the configuration file is automatically loaded. If so, start a Java thread to refresh it periodically according to the configuration parameters. The configuration parameters specify the frequency or interval for scanning and refreshing the SQL mapping file. A global variable `beforeTime` is defined to record the last refresh time. Upon receiving the above instructions, the refresh method is called to scan the files to be refreshed. Simultaneously, the last modification time `S` of the SQL mapping file is obtained. The difference between the last modification time `S` and the last refresh time `beforeTime` is calculated to determine whether the SQL mapping file has been modified between the last refresh and the current refresh. If it is determined that there is a modification, it proves that there is an SQL mapping file that needs to be reloaded. Otherwise, it proves that there is no SQL mapping file that needs to be reloaded, and the last refresh time `beforeTime` remains unchanged. When the last refreshed SQL mapping file is reloaded into the MyBatis framework, the last refresh time `beforeTime` is reset to the current refresh time `refrehTime`.

[0052] Step Six: Delete the DAO implementation class and its configuration. After upgrading Mybatis, the DAO implementation class is no longer needed. Use MapperScannerConfigurer to scan and load the DAO (see the configuration in Step Four). After the equivalent upgrade of the DAO, delete the DAO implementation class. Note: Method overloading is not supported in the DAO interface. After the equivalent upgrade of the DAO, pay attention to the DAO parameters. If the interface has multiple parameters, you can convert the interface parameters to a map or use annotations on the parameters.

[0053] During the upgrade from iBatis to Mybatis, most differences between the two frameworks can be automatically converted using the Ant tool. However, special cases such as passing parameters to Lists / arrays and dynamic tag concatenation still require manual modification. On the other hand, the impact of the introduction of new features in Mybatis on application logic cannot be ignored. Typical features include:

[0054] Caching: While improving query speed, it carries the risk of duplicate hits for the same transaction;

[0055] This has a significant impact on OracleSequence use cases;

[0056] The `returnInstanceForEmptyRow` configuration option: may return null if it defaults to false.

[0057] The `callSettersOnNulls` configuration option: when true, forces the caller method to be invoked.

[0058] In addition, the upgraded technology stack also includes new versions of open-source software such as Spring 5 and Log4j2, which may bring other new risks while optimizing applications.

[0059] In common technology stack migration solutions in the industry, strategies such as blue-green deployment, A / B testing, and canary deployment, combined with customized routing in the registry center or containerized infrastructure, can reduce migration risks to a reasonable level. Take blue-green deployment as an example:

[0060] (1) First, prepare two sets of production environments (blue and green);

[0061] (2) Deploy stable versions of applications in the Blue Environment, including all real-time traffic;

[0062] (3) Publish the new version of the application to a green environment with no traffic;

[0063] (4) Once IT personnel confirm that the green environment has taken effect, all traffic will be routed to the green environment;

[0064] (5) When a risk is detected during the trial operation of the green environment, the traffic will be directly routed back to the blue environment.

[0065] The aforementioned blue-green deployments typically require high resource supply, while more complex deployment schemes require applications and registration centers to support traffic segmentation. These objective conditions are not easily met in reality. From another perspective, commercial banks have high reliability requirements for application platforms to eliminate any risks in the online environment. Therefore, canary deployments can only be used as a fallback solution, and the waterfall model remains the preferred approach for the development and management of new application versions.

[0066] Taking the common Git version control tool as an example, new application code and rollback code are managed independently through branches A and B, with only differences in the technology stack between them. For large systems where the testing cycle exceeds two versions, branches A and B need to be kept synchronized and merged.

[0067] Specific production and rollback branches are built through different CI / CD pipelines. After testing, code changes are reviewed on the development branches and the most recently produced branches. For infrastructure upgrades (such as middleware), baseline management needs to be carried out simultaneously.

[0068] The iBatis upgrade, being the most significant change in the new technology stack in this solution, affects all Java application database access. Therefore, the main goal of the testing activities is to ensure that all DO / PO execution results meet expectations, organized from the following three dimensions:

[0069] (1) Developer dimension: Unit test coverage;

[0070] (2) Business dimension: Functional test regression;

[0071] (3) Operation and maintenance monitoring dimension: Non-functional testing of typical high-frequency trading combinations.

[0072] To prevent blind spots in testing, known risks associated with technology stack upgrades, including the impact of new API versions of open-source components like Spring 5 and Log4j2 on application behavior, can be proactively investigated manually by developers through a shared knowledge system established by the technical management department, reducing interaction time for testing issues. Furthermore, given the wide-ranging impact of technology stack upgrades, architects and developers also need to continuously monitor the technical characteristics of application components, such as logging, monitoring, and JVM garbage collection. Because all J2EE systems adhere to unified architectural governance requirements, once the first system has been upgraded, all common code or configuration changes can, in principle, be extracted and directly reused in other systems.

[0073] During the subsequent deployment and release process, the release strategies for different systems are closely related to the enterprise's operation and maintenance standards, infrastructure status, and resource supply. Typical classifications are as follows:

[0074] (1) Turnaround upgrade: For changes in system hardware architecture, or simultaneous upgrades of basic software such as operating system, database, and middleware, which involve replacing servers, blue-green deployment should be adopted, and the registration center should make preparations for switching in advance; if data cannot be synchronized in near real time, the necessary downtime should also be applied for.

[0075] (2) In-situ upgrade: Only apply version changes (such as WAR package deployment), and maintain gray-scale switching by starting each node in the cluster in turn through canary release mode.

[0076] For upgrades involving only middleware and JDK, but with limited resources, a lightweight Tomcat + ActiveMQ architecture can be used for agile local updates as a transitional solution.

[0077] like Figure 2 As shown, the J2EE technology stack upgrade and migration system of the present invention includes several functional modules. These functional modules are used to move related packages into the project and remove related packages from the project. The related packages include iBatis related packages and Mybatis related packages.

[0078] The functional modules include a plugin set, a plugin parsing module, a basic file injection plugin module, and a style parsing plugin;

[0079] The plugin set includes several plugins, each of which is used to identify, call, and load the iBatis and Mybatis technology stack-related configurations and files.

[0080] The plugin parsing module is used to parse configuration files in the iBatis and Mybatis technology stacks. It also creates Mybatis SQL mapping files, defines configuration files for these files, and sets configuration parameters. Based on these parameters, it determines whether the configuration file is automatically loaded. If so, it periodically starts a Java thread to refresh the SQL mapping file at the frequency or interval specified in the configuration parameters. Finally, it records the difference between the last modification time and the last refresh time of the SQL mapping file, and uses this difference to determine if the SQL mapping file has been modified. If it is determined that a modification has occurred, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded. The plugin parsing module is also used to periodically start a Java thread to refresh the configuration file. The system executes the scanning and refreshing of SQL mapping files at a set frequency or interval, and defines a global variable `beforeTime` to record the last refresh time. Upon receiving the above instructions, it calls the refresh method to scan the files that need to be refreshed and obtains the last modification time `S` of the SQL mapping files. It calculates the difference between the last modification time `S` and the last refresh time `beforeTime` to determine whether the SQL mapping files have been modified between the last refresh and the current refresh. If modifications are found, it proves that there are SQL mapping files that need to be reloaded; otherwise, it proves that there are no SQL mapping files that need to be reloaded, and the last refresh time `beforeTime` remains unchanged. When the last refreshed SQL mapping files are reloaded into the MyBatis framework, the last refresh time `beforeTime` is reset to the current refresh time `refrehTime`.

[0081] The basic file injection plugin module is used to add Mybatis-related configurations and files to the project, and also add Mybatis-config.xml to the project resource root directory;

[0082] The style parsing plugin is used to delete the implementation classes and configurations of the DAO. It uses MapperScannerConfigurer to scan and load the DAO, and after the equivalent upgrade of the DAO, it deletes the DAO implementation classes.

[0083] like Figure 3 As shown, the terminal device 6 may include a processor 601, a storage medium 602, and a bus 603. The storage medium 602 stores machine-readable instructions executable by the processor 601. When the terminal device is running, the processor 601 communicates with the storage medium 602 via the bus 603. The processor 601 executes the machine-readable instructions to perform the steps of the deep learning model training method described in the foregoing embodiments. The specific implementation and technical effects are similar and will not be repeated here.

[0084] For ease of explanation, only one processor is described in the terminal device described above. However, it should be noted that in some embodiments, the terminal device of the present invention may also include multiple processors, and therefore the steps performed by one processor described in the present invention may also be performed jointly by multiple processors or individually.

[0085] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.< / properties>

Claims

1. A method for upgrading and migrating a J2EE technology stack, characterized in that, The specific steps include: Step 1: Remove iBatis-related packages from the project; Step 2: Add the relevant Mybatis packages and dependencies to the project; Step 3: Remove iBatis-related configurations and files from the project; Step 4: Add the relevant Mybatis configuration and files to the project, and add Mybatis-config.xml to the project resource root directory. Create a new mapper directory to store SQL mapping files. Step 5: Create the Mybatis SQL mapping file and define its configuration file, setting configuration parameters. Then, use these parameters to determine if the configuration file is set to autoload. If it is, start a refresh Java thread periodically and scan and refresh the SQL mapping file at the frequency or interval specified in the configuration parameters. Finally, record the difference between the last modification time and the last refresh time of the SQL mapping file. Based on this difference, determine if the SQL mapping file has been modified. If it is determined that a modification has occurred, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded. Step Six: Delete the implementation classes and configurations of the project's DAO, and then use... MapperScannerConfigurer scans and loads the DAO, then after the equivalent upgrade of the DAO is completed, the DAO implementation class is deleted.

2. The method according to claim 1, characterized in that, In step one, if the project also uses the Spring integration package, then remove it as well.

3. The method according to claim 1, characterized in that, In step five, the Mybatis SQL mapping file is copied from the original iBatis SQL mapping file. This also includes changing sqlMap to mapper, placing the typeAlias ​​tag in the typeAliases tag of the public configuration file, and changing the attribute class in the resultMap tag to type.

4. The method according to claim 1, characterized in that, In step six, if the interface has multiple parameters, the interface parameters are converted to a map or annotations are applied to the parameters.

5. The method according to claim 1, characterized in that, A Java thread is started periodically to scan and refresh the SQL mapping file at the frequency or interval specified in the configuration parameters. A global variable `beforeTime` is defined to record the last refresh time. Upon receiving the above instructions, the refresh method is called to scan the files that need to be refreshed and obtain the last modification time `S` of the SQL mapping file. The difference between the last modification time `S` and the last refresh time `beforeTime` is calculated to determine whether the SQL mapping file has been modified between the last refresh and the current refresh. If it is determined that it has been modified, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded, and the last refresh time `beforeTime` remains unchanged. When the last refreshed SQL mapping file is reloaded into the MyBatis framework, the last refresh time `beforeTime` is reset to the current refresh time `refrehTime`.

6. A J2EE technology stack upgrade and migration system, characterized in that, include: It includes several functional modules, which are used to move related packages into and out of the project. The related packages mentioned above include iBatis related packages and Mybatis related packages; The functional modules include a plugin set, a plugin parsing module, a basic file injection plugin module, and a style parsing plugin; The plugin set includes several plugins, each of which is used to identify, call, and load the iBatis and Mybatis technology stack-related configurations and files. The plugin parsing module is used to parse configuration files in the iBatis and Mybatis technology stacks. The plugin parsing module is also used to create Mybatis SQL mapping files, define configuration files for these files, and set configuration parameters. It then uses these parameters to determine if the configuration file is automatically loaded. If it is, a refresh Java thread is started periodically, and the SQL mapping file is scanned and refreshed at the frequency or interval set in the configuration parameters. Finally, the difference between the last modification time and the last refresh time of the SQL mapping file is recorded. Based on this difference, it is determined whether the SQL mapping file has been modified. If it is determined that a modification has occurred, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded. The basic file injection plugin module is used to add Mybatis-related configurations and files to the project, and also add Mybatis-config.xml to the project resource root directory; The style parsing plugin is used to delete the implementation classes and configurations of the DAO. It uses MapperScannerConfigurer to scan and load the DAO, and after the equivalent upgrade of the DAO, it deletes the DAO implementation classes.

7. In the system according to claim 6, the plugin parsing module is further configured to periodically start a refresh Java thread to perform scanning and refreshing of the SQL mapping file at the frequency or interval set in the configuration parameters, and define a global variable beforeTime to record the last refresh time. Upon receiving the aforementioned instructions, the module calls the refresh method to scan the file to be refreshed, and simultaneously obtains the last modification time S of the SQL mapping file. It calculates the difference between the last modification time S and the last refresh time beforeTime to determine whether the SQL mapping file has been modified between the last refresh and the current refresh. If it is determined that there is a modification, it proves that there is an SQL mapping file that needs to be reloaded; otherwise, it proves that there is no SQL mapping file that needs to be reloaded, and the last refresh time beforeTime remains unchanged. When the last refreshed SQL mapping file is reloaded into the MyBatis framework, the last refresh time beforeTime is reset to the current refresh time rerefhTime.

8. A terminal device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the terminal device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 5.

9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, performs the steps of the method as described in any one of claims 1 to 5.

10. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Monad-based persistent layer composite condition query method and storage medium

    CN111125440A

  • J2EE-based data access method, device and equipment and storage medium

    CN113515564A