CN117667195A - Agile development method for database table and related equipment - Google Patents
Agile development method for database table and related equipment Download PDFInfo
- Publication number
- CN117667195A CN117667195A CN202311163865.5A CN202311163865A CN117667195A CN 117667195 A CN117667195 A CN 117667195A CN 202311163865 A CN202311163865 A CN 202311163865A CN 117667195 A CN117667195 A CN 117667195A
- Authority
- CN
- China
- Prior art keywords
- code
- basic
- preset
- templates
- database table
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000011161 development Methods 0.000 title claims abstract description 22
- 238000013507 mapping Methods 0.000 claims abstract description 25
- 230000015654 memory Effects 0.000 claims description 23
- 238000012545 processing Methods 0.000 claims description 11
- 230000002085 persistent effect Effects 0.000 claims description 3
- 230000006403 short-term memory Effects 0.000 claims description 2
- 238000007792 addition Methods 0.000 description 8
- 238000012217 deletion Methods 0.000 description 8
- 230000037430 deletion Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 238000012986 modification Methods 0.000 description 5
- 230000004048 modification Effects 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000012795 verification Methods 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004590 computer program Methods 0.000 description 2
- 238000010276 construction Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000014509 gene expression Effects 0.000 description 2
- 239000012141 concentrate Substances 0.000 description 1
- 238000012937 correction Methods 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010606 normalization Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
Landscapes
- Stored Programmes (AREA)
Abstract
The embodiment of the application discloses an agile development method and related equipment for a database table, which are used for improving development efficiency. The method comprises the following steps: acquiring basic information of a target operation and a database table; running a preset Java file based on the target operation and the basic information; acquiring at least two part of preset code templates corresponding to the target operation from an ORM mapping template; acquiring connection information of the database table from a Java file based on the basic information; and filling the connection information into the preset code templates of the corresponding parts, and obtaining and storing basic codes corresponding to the preset code templates of each part.
Description
Technical Field
The embodiment of the application relates to the field of databases, in particular to a agile development method for database tables and related equipment.
Background
In the development process of a system based on the JavaEE technology, basic addition, deletion and correction of database tables are involved in most cases, and SpringMVC, spring, mybatis or similar frameworks are mainly adopted to assist in development.
The open source framework of the third party has the modularization of components, flexibility and reusability, simplifies the development of web application programs, but lacks a general technology to finish the basic addition, deletion and modification functions. In the process of database operation, performing an add-delete-check operation on a database table belongs to a common operation. Typically, a developer writes the base code according to operations that need to be performed on the database tables, and by running the base code, the corresponding operations can be performed on the corresponding database tables.
However, in the prior art, the efficiency of writing the basic code by the developer is low, and when the adding, deleting and checking operation is required to be performed frequently, the developer needs to spend a great deal of time to write the basic code, so that the development efficiency is low.
Disclosure of Invention
The embodiment of the application provides a quick development method and related equipment for a database table, which are used for improving development efficiency.
An embodiment of the present application provides a agile development method for a database table, including:
acquiring basic information of a target operation and a database table;
running a preset Java file based on the target operation and the basic information;
acquiring at least two part of preset code templates corresponding to the target operation from an ORM mapping template;
acquiring connection information of the database table from a Java file based on the basic information;
and filling the connection information into the preset code templates of the corresponding parts, and obtaining and storing basic codes corresponding to the preset code templates of each part.
In some specific implementations, the filling the connection information into the preset code templates of the corresponding parts to obtain the basic codes corresponding to the preset code templates of each part includes:
filling the connection information into the preset code templates of the corresponding parts to obtain initial codes corresponding to the preset code templates of each part;
and calling a NamingStrategy interface to perform standardization processing on the initial codes, and obtaining the basic codes corresponding to each section of the initial codes.
In some specific implementations, storing the basic code corresponding to each part of the preset code template includes:
code configuration information corresponding to each section of basic code is obtained from a Java file, wherein the code configuration information comprises a first storage address of the basic code;
and storing each basic code according to the first storage address.
In some embodiments, after said storing said each piece of base code at said first storage address, said method further comprises:
acquiring each basic code from the first storage address;
determining a preset code template corresponding to each basic code;
determining a second storage address corresponding to each basic code from the Java text according to a preset code template corresponding to each basic code;
and storing each basic code to a corresponding second storage address.
In some specific implementations, storing the each piece of base code to a corresponding second storage address includes:
determining the code package name corresponding to each section of basic code from the Java text according to the preset code template corresponding to each section of basic code;
generating code files comprising the basic codes of each section respectively, wherein the file name of each code text is the code package name corresponding to the basic code contained in each code file;
each code file is stored in a second storage address corresponding to the contained basic code.
In some embodiments, the connection information of the database table includes a link address of the database table, an access user name of the database table, an access password of the database table, a drive class of the database table, and a type converter of the database table.
In some specific implementations, the ORM mapping templates include an entity class preset code template, a database class preset code template, a service class preset code template, and a view layer class preset code template, where the preset code templates include the entity class preset code template, the database class preset code template, the service class preset code template, and/or the view layer class preset code template.
A second aspect of embodiments of the present application provides a computer device, comprising:
the acquisition unit is used for acquiring the target operation and the basic information of the database table;
the running unit is used for running a preset Java file based on the target operation and the basic information;
the acquisition unit is used for acquiring at least two parts of preset code templates corresponding to the target operation from the ORM mapping template;
the acquisition unit is further used for acquiring the connection information of the database table from the Java file based on the basic information;
and the generating unit is used for filling the connection information into the preset code templates of the corresponding parts to obtain and store the basic codes corresponding to the preset code templates of each part.
In some specific implementations, the generating unit is specifically configured to fill the connection information into a preset code template of a corresponding portion, and obtain an initial code corresponding to the preset code template of each portion;
and calling a NamingStrategy interface to perform standardization processing on the initial codes, and obtaining the basic codes corresponding to each section of the initial codes.
In some specific implementations, the generating unit is specifically configured to obtain code configuration information corresponding to each section of base code from a Java file, where the code configuration information includes a first storage address of the base code;
and storing each basic code according to the first storage address.
In some embodiments, after said storing said each piece of base code at said first storage address, said apparatus further comprises: a determination unit and a storage unit;
the acquisition unit is further used for acquiring each section of basic code from the first storage address;
the determining unit is used for determining a preset code template corresponding to each basic code;
the determining unit is further configured to determine, according to the preset code template corresponding to each piece of base code, a second storage address corresponding to each piece of base code from the Java text;
and the storage unit is used for storing each section of basic code to a corresponding second storage address.
In some specific implementations, the storage unit is specifically configured to determine, from the Java text, a code package name corresponding to each piece of base code according to a preset code template corresponding to each piece of base code;
generating code files comprising the basic codes of each section respectively, wherein the file name of each code text is the code package name corresponding to the basic code contained in each code file;
each code file is stored in a second storage address corresponding to the contained basic code.
In some embodiments, the connection information of the database table includes a link address of the database table, an access user name of the database table, an access password of the database table, a drive class of the database table, and a type converter of the database table.
In some specific implementations, the ORM mapping templates include an entity class preset code template, a database class preset code template, a service class preset code template, and a view layer class preset code template, where the preset code templates include the entity class preset code template, the database class preset code template, the service class preset code template, and/or the view layer class preset code template.
A third aspect of the embodiments of the present application provides a computer device, including:
a central processing unit, a memory and an input/output interface;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method of the first aspect.
A fourth aspect of the embodiments provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method according to the first aspect.
A fifth aspect of the embodiments of the present application provides a computer storage medium having instructions stored therein, which when executed on a computer, cause the computer to perform the method according to the first aspect.
From the above technical solutions, the embodiments of the present application have the following advantages: the basic addition, deletion and examination code file is generated, only one Java file and ORM mapping template are needed, and the Java file and ORM mapping template are put into a software system of computer equipment, so that the basic (addition, deletion and examination) code can be automatically generated to a designated file directory position (namely a second storage address) by directly running the Java file, web application service does not need to be constructed, front-end resource pages do not need to be developed, back-end access interface resources do not need to be developed, secondary copying and uploading are not needed, and quick development of the basic code can be realized.
Drawings
FIG. 1 is a system architecture diagram of a method of agile development for database tables disclosed in embodiments of the present application;
FIG. 2 is a schematic diagram of a computer device according to an embodiment of the present application;
fig. 3 is another schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The embodiment of the application provides a quick development method and related equipment for a database table, which are used for improving development efficiency.
Referring to fig. 1, an embodiment of the present application provides a agile development method for a database table, including the following steps:
101. and obtaining the basic information of the target operation and the database table.
To generate base code that performs any base operations on the database tables, the operations that need to be performed (i.e., target operations) should be obtained. In order to accurately execute the target operation on the data table, basic information of the database table is also required to be acquired so as to accurately find the database table.
102. And running a preset Java file based on the target operation and the basic information.
According to the embodiment of the application, only one Java file and ORM mapping template are needed to be stored in the terminal of the developer, so that the base code can be generated through the running of the Java file. However, since basic codes required for performing different operations on different databases are different, it is necessary to run a preset Java file based on a target operation and basic information.
The Java file is composed of various classes, specifically at least comprises an AutoGenerator class, and the connection information of the database table can be encapsulated by creating the class.
103. And acquiring at least two parts of preset code templates corresponding to the target operation from the ORM mapping template.
In short, performing a target operation on a database table requires not only a simple modification of the database table (implemented by a database class), but also a modification of the corresponding stored data (implemented by an entity class). The normal basic code for performing the addition and deletion verification is divided into four parts: an entity class (i.e., entity class), a mapper class (i.e., database class), a service class (i.e., service class), and a controller class (i.e., view layer class). Therefore, in practical application, the ORM mapping templates include entity class preset code templates, database class preset code templates, service class preset code templates, and view layer class preset code templates. Generally, only preset code templates of the entity class and the service class are required to be respectively configured.
That is, since the modification steps (or modification contents) of the different operations are different, the number of preset code templates corresponding to the target operation may include, but is not limited to, entity class preset code templates, database class preset code templates, service class preset code templates, and/or view layer class preset code templates
104. And acquiring the connection information of the database table from the Java file based on the basic information.
The precondition for modifying the database table is that the database table is provided with the right to be accessed. In general, a server storing a database table is different from a computing device running Java software, and thus, a precondition for modifying the database table is to determine a link address of the server storing the database table, i.e., the database table. Therefore, the Java file should include connection information of the database table in addition to the autocreator class.
Specifically, the developer may input the basic information of the database table, and then search the connection information of the database table in the connection information of at least one database table pre-configured in the Java file through the basic information of the database table of the user data, so as to access the database table. The basic information may be any information such as a database table name or a database table identifier, which may identify the uniqueness of the database table, and is not limited herein. The DataSourceConfig class in the Java file may be the connection information of the database table.
In practical applications, in order to improve the storage security of the database table, access to the object is generally limited, and thus, the connection information of the database table may further include, but is not limited to: an access user name of the database table, an access password of the database table (corresponding to the access user name), a drive class of the database table, and/or a type converter of the database table, etc.
105. And filling the connection information into the preset code templates of the corresponding parts, and obtaining and storing basic codes corresponding to the preset code templates of each part.
Finally, after the connection information is filled in the preset code template corresponding to each part, the basic code capable of executing the target operation on the database table can be obtained. It should be noted that in the embodiment of the present application, the construction of the base code is implemented through Java files. The whole basic code construction process can be automatically realized through the operation of Java codes, connection information is filled into preset code templates, and basic codes corresponding to each part of the preset code templates are obtained.
In other implementations, the foregoing step 105 may be specifically implemented in the following manner: filling the connection information into the preset code templates of the corresponding parts to obtain initial codes corresponding to the preset code templates of each part; and calling a NamingStrategy interface to perform standardization processing on the initial codes, and obtaining the basic codes corresponding to each section of initial codes.
It should be noted that, in order to ensure that the base code can operate normally, a NamingStrategy method (or a NamingStrategy interface) in the Java mechanism may be called to perform code normalization processing on the initialization code, so as to ensure that the base code corresponding to each section of the initialization code can be accurately obtained.
Further, the basic codes corresponding to the preset code templates of each part can be stored by the following steps: code configuration information corresponding to each section of basic code is obtained from the Java file, wherein the code configuration information comprises a first storage address of the basic code; each piece of base code is stored according to the first memory address.
Specifically, the Java file may further include a GlobalConfig class, where the GlobalConfig class encapsulates code configuration information, and by creating the class, a first storage address of a generated code (for example, a file directory address, i.e., a file directory address located when the base code is generated, is used as an example, where a notepad is newly built in a desktop folder), and the first storage address of the notepad is a desktop). In addition, code author notes, code name suffix information, primary key policy configuration, etc. may also be packaged, without limitation.
On the basis of the foregoing embodiments, in some specific implementations, after storing each piece of base code according to the first storage address, the method according to the embodiments of the present application further includes: acquiring each basic code from a first storage address; determining a preset code template corresponding to each section of basic code; determining a second storage address corresponding to each section of basic code from Java text according to a preset code template corresponding to each section of basic code; each piece of basic code is stored to a corresponding second storage address.
Specifically, after the multiple sections of base codes are generated, because each section of base code is used for modifying different contents, the base codes corresponding to different (category) modified contents can be stored under different file directories respectively so as to accurately distinguish the base codes corresponding to different categories. In practical applications, the Java file may further include: packageConfig class, which encapsulates the correspondence of different types of base codes, and can store the different types of base codes to file directory addresses (i.e. second storage addresses corresponding to different types) corresponding to different types.
Further, the step of storing each piece of the basic code to the corresponding second storage address specifically includes: determining the code package name corresponding to each section of basic code from Java text according to a preset code template corresponding to each section of basic code; code files comprising each section of basic code are respectively generated, and the file name of each code text is the code package name corresponding to the basic code contained in each code file; each code file is stored in a second memory address corresponding to the contained base code, respectively.
Specifically, the PackageConfig class of the Java file may further include a code package name corresponding to each type (i.e., the preset code template has multiple types, and corresponding types of each section of basic code obtained according to the preset code template are the same).
The foregoing describes various implementations of the embodiments of the present application, and the following describes the basic code generation method of the embodiments of the present application in a specific scenario.
According to the method and the device for generating the basic addition, deletion and verification code file, only one Java file and ORM mapping template are needed, and the Java file and ORM mapping template are placed in a software system of computer equipment, so that the automatic generation basic (addition, deletion and verification) code of the Java file can be directly operated to a designated file directory position (namely a second storage address), web application service does not need to be constructed, front-end resource pages and rear-end access interface resources do not need to be developed, and secondary copying and uploading are not needed.
Specifically, the new technology requires a Java file and ORM mapping template to be added to the Java ee system project, relying on JVM (Java virtual machine) environment, template engine, mybaits-plus framework resources, etc.
First, a Java file is composed of the following classes: autogenerator class, dataSourcConfig class, global Config class, packageConfig class, strategyConfig class, injectionConfig class, and FileOutConfig class. The AutoGenerator class is a core, and the connection information, the code configuration information, the code package name, the code strategy configuration, the ORM mapping conversion information, the template engine information (set by a setTemplateEngine () method) and the like of a database table are packaged by creating the class, and finally, a basic (add-delete-check) code is generated by an execute () method of the class.
Wherein the StrategyConfig class encapsulates whether the code name is hump naming setting, parent class setting of the code (setsuperserviceslass () method), setting of personalized notes; the InjectionConfig class encapsulates the ORM mapping conversion information, and the ORM mapping is completed through the FileOutConfig field encapsulation of the class; the FileOutConfig class calls the outputFile () method by reading the configured ORM mapping template information, and generates a code file by normalizing the code name by the removePrefix () method of the NamingStrategy class.
Secondly, the ORM mapping template is configured as follows:
taking a freemaker template engine as an example, in an entity class template file entity.java.ftl, $ { entity name } (code name), <#list table > <#list > (field information changed in a loop), $ { field property name }, etc. are dynamically configured by EL expressions. These field variable names are set to correspond by the setTempleteEngine () method of the AutoGenerator class. In the service class template file service.java.ftl, the $ { superserviceslass } parent class information is dynamically inherited by the EL expression (setsuperserviceslass () method of the StrategyConfig class sets the generic add-drop-check parent class information).
That is, when the developer needs to generate the basic addition/deletion/verification code, only one Java file needs to be created, and the ORM mapping template needs to be configured. Specifically, relevant basic configuration (JVM (Java virtual machine) environment, template engine, mybaits-plus framework resource and the like) is introduced, a Java file is created, an AutoGenerator class is created in the Java file, and relevant configuration information is written (refer to the foregoing); and then writing database connection information, type conversion information, strategy configuration information, configuration ORM mapping templates and the like according to the database table structure. And finally, through running Java files, agile development of the basic codes can be realized.
In the embodiment of the application, 1, code standardization is improved: a Java file, two template files; the core code is concentrated, the code pollution is reduced, and a developer only needs to know how to use the technology, so that the technology can be multiplexed to similar business scenes, and communication between members of a project group are facilitated. 2. The development efficiency of the system is improved: in a daily Java system, the most common operation is to add, delete and examine data, and the operations are realized with little code quantity and workload by the technology, so that development efficiency of projects is improved, and developers can concentrate on realizing service codes.
Referring to fig. 2, an embodiment of the present application provides a computer device, including:
an acquisition unit 201 for acquiring a target operation and basic information of a database table;
an operation unit 202 for operating a preset Java file based on the target operation and the basic information;
an obtaining unit 201, configured to obtain at least two part preset code templates corresponding to the target operation from the ORM mapping template;
an obtaining unit 201, configured to obtain connection information of the database table from the Java file based on the basic information;
and the generating unit 203 is configured to fill the connection information into the preset code templates of the corresponding parts, and obtain and store the basic codes corresponding to the preset code templates of each part.
In some specific implementations, the generating unit 203 is specifically configured to fill the connection information into a preset code template of a corresponding portion, and obtain an initial code corresponding to the preset code template of each portion;
and calling a NamingStrategy interface to perform standardization processing on the initial codes, and obtaining the basic codes corresponding to each section of initial codes.
In some specific implementations, the generating unit 203 is specifically configured to obtain code configuration information corresponding to each piece of base code from a Java file, where the code configuration information includes a first storage address of the base code;
each piece of base code is stored according to the first memory address.
In some implementations, after storing each piece of base code at the first storage address, the apparatus further includes: a determination unit and a storage unit;
an obtaining unit 201, configured to obtain each piece of basic code from the first storage address;
the determining unit is used for determining a preset code template corresponding to each section of basic code;
the determining unit is further used for determining a second storage address corresponding to each section of basic code from the Java text according to a preset code template corresponding to each section of basic code;
and the storage unit is used for storing each section of basic code to the corresponding second storage address.
In some specific implementations, the storage unit is specifically configured to determine, from the Java text, a code package name corresponding to each section of base code according to a preset code template corresponding to each section of base code;
code files comprising each section of basic code are respectively generated, and the file name of each code text is the code package name corresponding to the basic code contained in each code file;
each code file is stored in a second memory address corresponding to the contained base code, respectively.
In some implementations, the connection information of the database table includes a link address of the database table, an access username of the database table, an access password of the database table, a drive class of the database table, and a type converter of the database table.
In some embodiments, the ORM mapping templates include entity class preset code templates, database class preset code templates, service class preset code templates, and view layer class preset code templates, and the preset code templates include entity class preset code templates, database class preset code templates, service class preset code templates, and/or view layer class preset code templates.
Fig. 3 is a schematic structural diagram of a computer device provided in an embodiment of the present application, where the computer device 300 may include one or more central processing units (central processing units, CPU) 301 and a memory 305, and the memory 305 stores one or more application programs or data.
Wherein the memory 305 may be volatile storage or persistent storage. The program stored in memory 305 may include one or more modules, each of which may include a series of instruction operations in a computer device. Still further, the central processor 301 may be arranged to communicate with the memory 305 and execute a series of instruction operations in the memory 305 on the computer device 300.
The computer device 300 may also include one or more power supplies 302, one or more wired or wireless network interfaces 303, one or more input/output interfaces 304, and/or one or more operating systems, such as Windows ServerTM, mac OS XTM, unixTM, linuxTM, freeBSDTM, etc.
The cpu 301 may perform the operations performed by the computer device in the embodiments shown in fig. 1 to 2, and will not be described in detail herein.
It should be noted that, although the steps in the flowcharts of the embodiments are drawn sequentially as indicated by arrows, the steps are not strictly limited to the order in which the steps are executed unless explicitly stated in the present disclosure. Moreover, at least some of the steps in the flowcharts in accordance with the embodiments may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of the steps or stages is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of the steps or stages in other steps or other steps.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (RAM, random access memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The embodiments also provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the agile development method for database tables as described above.
Claims (10)
1. An agile development method for a database table, comprising:
acquiring basic information of a target operation and a database table;
running a preset Java file based on the target operation and the basic information;
acquiring at least two part of preset code templates corresponding to the target operation from an ORM mapping template;
acquiring connection information of the database table from a Java file based on the basic information;
and filling the connection information into the preset code templates of the corresponding parts, and obtaining and storing basic codes corresponding to the preset code templates of each part.
2. The method according to claim 1, wherein the filling the connection information into the preset code templates of the corresponding parts to obtain the basic codes corresponding to the preset code templates of each part includes:
filling the connection information into the preset code templates of the corresponding parts to obtain initial codes corresponding to the preset code templates of each part;
and calling a NamingStrategy interface to perform standardization processing on the initial codes, and obtaining the basic codes corresponding to each section of the initial codes.
3. The method according to claim 1 or 2, wherein storing the base code corresponding to each part of the preset code template comprises:
code configuration information corresponding to each section of basic code is obtained from a Java file, wherein the code configuration information comprises a first storage address of the basic code;
and storing each basic code according to the first storage address.
4. A method according to claim 3, wherein after said storing said each piece of base code in said first memory address, said method further comprises:
acquiring each basic code from the first storage address;
determining a preset code template corresponding to each basic code;
determining a second storage address corresponding to each basic code from the Java text according to a preset code template corresponding to each basic code;
and storing each basic code to a corresponding second storage address.
5. The method of claim 4, wherein storing each piece of base code to a corresponding second memory address comprises:
determining the code package name corresponding to each section of basic code from the Java text according to the preset code template corresponding to each section of basic code;
generating code files comprising the basic codes of each section respectively, wherein the file name of each code text is the code package name corresponding to the basic code contained in each code file;
each code file is stored in a second storage address corresponding to the contained basic code.
6. The method of claim 1, wherein the connection information of the database table includes a link address of the database table, an access user name of the database table, an access password of the database table, a driving class of the database table, and a type converter of the database table.
7. The method according to claim 1, wherein the ORM mapping templates comprise entity class preset code templates, database class preset code templates, service class preset code templates, and view layer class preset code templates, the preset code templates comprising the entity class preset code templates, the database class preset code templates, the service class preset code templates, and/or the view layer class preset code templates.
8. A computer device, comprising:
the acquisition unit is used for acquiring the target operation and the basic information of the database table;
the running unit is used for running a preset Java file based on the target operation and the basic information;
the acquisition unit is used for acquiring at least two parts of preset code templates corresponding to the target operation from the ORM mapping template;
the acquisition unit is further used for acquiring the connection information of the database table from the Java file based on the basic information;
and the generating unit is used for filling the connection information into the preset code templates of the corresponding parts to obtain and store the basic codes corresponding to the preset code templates of each part.
9. A computer device, comprising:
a central processing unit, a memory and an input/output interface;
the memory is a short-term memory or a persistent memory;
the central processor is configured to communicate with the memory and to execute instruction operations in the memory to perform the method of any of claims 1 to 7.
10. A computer storage medium having instructions stored therein, which when executed on a computer, cause the computer to perform the method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311163865.5A CN117667195A (en) | 2023-09-11 | 2023-09-11 | Agile development method for database table and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311163865.5A CN117667195A (en) | 2023-09-11 | 2023-09-11 | Agile development method for database table and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117667195A true CN117667195A (en) | 2024-03-08 |
Family
ID=90067073
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311163865.5A Pending CN117667195A (en) | 2023-09-11 | 2023-09-11 | Agile development method for database table and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117667195A (en) |
-
2023
- 2023-09-11 CN CN202311163865.5A patent/CN117667195A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10324909B2 (en) | Omega names: name generation and derivation utilizing nested three or more attributes | |
EP2340481B1 (en) | Caching runtime generated code | |
US7386609B2 (en) | Method, system, and program for managing devices in a network | |
US10635420B2 (en) | Overriding a migrated method in an updated type | |
JP2000047874A (en) | Device and method for footprint reduction of preloaded class | |
US9483508B1 (en) | Omega names: name generation and derivation | |
CN110019111B (en) | Data processing method, data processing device, storage medium and processor | |
CN112769706B (en) | Componentized routing method and system | |
CN113918635A (en) | Interface data format conversion method and device | |
US6901591B1 (en) | Frameworks for invoking methods in virtual machines | |
CN113821194A (en) | Micro front-end system | |
US20210036944A1 (en) | Ranking service implementations for a service interface | |
CN110633162B (en) | Remote call implementation method and device, computer equipment and storage medium | |
CN117667195A (en) | Agile development method for database table and related equipment | |
US7181724B2 (en) | Representation of Java® data types in virtual machines | |
CN111666095A (en) | Method, system, equipment and storage medium for realizing Java decompilation | |
CN111881220A (en) | Data operation method and device under list storage, electronic equipment and storage medium | |
CN116700841B (en) | Method and device for calling native API (application program interface) | |
CN116700840B (en) | File execution method, device, electronic equipment and readable storage medium | |
CN116974653B (en) | Class loading method and system | |
CN117273025A (en) | Service object translation method and related equipment | |
CN117251234B (en) | Function calling method and device based on patches | |
JP2003186674A (en) | Presentation of java data types in virtual machine | |
CN117493195A (en) | Testing method and device based on data processing, storage medium and electronic equipment | |
CN115629764A (en) | Static compiling method and device for Java program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |