Code generation method and device based on integration of frameworks Spring and MyBatis
A code generation and framework technology, applied in the computer field, can solve problems such as no solution proposed, lack of support for control layer and front-end code automatic generation, and achieve the effect of enhancing the function of generating code and improving the code reuse rate
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0024] Figure 1a A flow chart of a code generation method based on the integration of Spring and MyBatis framework provided by Embodiment 1 of the present invention. This embodiment is applicable to applications based on Spring and MyBatis framework. code generating means, said means are implemented by software and / or hardware, such as Figure 1a As shown, the technical solution provided in this embodiment includes the following steps:
[0025] Step S110, reading the data access object DAO layer configuration file.
[0026] Among them, DAO (Data Access Objects, data access object) is an application programming interface, the DAO layer is the data access layer, its main function is to separate the code related to the persistence layer from the business logic The codes of the access layer to operate the database are all encapsulated in a DAO class. The DAO layer configuration file is read by the DAO layer code generator, and the DAO layer configuration file includes the PDM fi...
Embodiment 2
[0081] Figure 2a A schematic diagram of a DAO layer code generation method based on the integration of Spring and MyBatis framework provided by Embodiment 2 of the present invention. This embodiment provides a preferred embodiment on the basis of the foregoing embodiments. like Figure 2a As shown, the technical side provided by this embodiment has the following steps:
[0082] Step 1. Read the DAO layer configuration file through the DAO layer code generator, wherein the DAO layer configuration file includes the PDM file path in the PDM, the DAO layer package name, and the model data output root path.
[0083] Step 2. Obtain the model data in the PDM according to the above-mentioned DAO layer configuration file, and call the PDM file parser to convert the model data in the PDM into entity classes.
[0084] Step 3. Obtain the DAO layer template file according to Velocity.
[0085] Step 4. Load the entity class and fill it into the DAO layer template file.
[0086] Step 5...
Embodiment 3
[0096] image 3 Shown is a schematic structural diagram of a code generation device based on the integration of Spring and MyBatis framework provided by Embodiment 3 of the present invention. The specific structure of the device is as follows:
[0097] The DAO layer configuration file reading module 310 is configured to read the DAO layer configuration file of the data access object.
[0098] A model data obtaining module 320, configured to obtain model data in the physical data model PDM according to the DAO layer configuration file.
[0099] Exemplarily, the model data acquisition module 320 is specifically used for:
[0100] Find the corresponding model data in the PDM file path according to the DAO layer package name, and output the model data according to the model data output root path.
[0101] Since the metadata captured by PDM is very rich, and it closely maps the database structure, such as tables, columns, primary keys and foreign keys, etc., it solves the problem...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com