CN110941423A - Java-based method for quickly generating codes - Google Patents

Java-based method for quickly generating codes Download PDF

Info

Publication number
CN110941423A
CN110941423A CN201911156375.6A CN201911156375A CN110941423A CN 110941423 A CN110941423 A CN 110941423A CN 201911156375 A CN201911156375 A CN 201911156375A CN 110941423 A CN110941423 A CN 110941423A
Authority
CN
China
Prior art keywords
editing
code
template
file
configuring
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
Application number
CN201911156375.6A
Other languages
Chinese (zh)
Inventor
唐合宾
李伟国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hangtong Intelligent Technology Co Ltd
Original Assignee
Shenzhen Hangtong Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Hangtong Intelligent Technology Co Ltd filed Critical Shenzhen Hangtong Intelligent Technology Co Ltd
Priority to CN201911156375.6A priority Critical patent/CN110941423A/en
Publication of CN110941423A publication Critical patent/CN110941423A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms
    • G06F8/315Object-oriented languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/35Creation or generation of source code model driven

Abstract

The invention provides a Java-based method for quickly generating codes, which comprises the following steps: step S1, creating a project in a Java project development environment; step S2, developing a code automatic generation program; step S3, setting a data structure; step S4, configuring a data source corresponding to the generated code; step S5, configuring a database configuration file; step S6, configuring a template of the user interface frame file; step S7, configuring a template of the background control processing layer code file; step S8, configuring modules of background logic processing layer code files; step S9, configuring a template of the background data access layer code file; step S10, configuring a code generation path; step S11, starting the code automatic generation program; step S12, reading the template configuration file and the data structure definition file; step S13, generating a corresponding code file; step S14, code generation is realized. The invention can effectively improve the development efficiency and reduce the error probability.

Description

Java-based method for quickly generating codes
Technical Field
The invention relates to a code generating method, in particular to a Java-based code rapidly generating method.
Background
With the rapid development of information technology, the information system has been applied to various industries, the information industry is prosperous, the development period of the information system is shorter and shorter while the information system is rapidly developed, and the research and development efficiency of the information system needs to be improved; such as to improve the skill level of the practitioner. The traditional method for developing codes at present has two main types: writing codes line by developers; the code of the existing function is copied and then modified on the basis of the copied code. However, the following problems are inevitable with this prior art: firstly, the development efficiency is low, and developers need to deal with a large amount of repeated work; secondly, the error probability is high, and when the code is modified, partial content of the code is frequently missed.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a Java-based method for quickly generating codes, which can improve the development efficiency and reduce the error probability.
In view of the above, the present invention provides a method for quickly generating codes based on Java, which comprises the following steps:
step S1, creating a project in an integrated development environment for Java project development;
step S2, developing a code automatic generation program;
step S3, setting a data structure and creating a data table;
step S4, configuring a data source corresponding to the generated code;
step S5, configuring a database configuration file;
step S6, configuring a template of the user interface frame file;
step S7, configuring a template of the background control processing layer code file;
step S8, configuring modules of background logic processing layer code files;
step S9, configuring a template of the background data access layer code file;
step S10, configuring a code generation path;
step S11, starting the code automatic generation program;
step S12, reading the template configuration file and the data structure definition file;
step S13, generating a corresponding code file;
and step S14, introducing a path from the code to the development project, and realizing code generation.
A further refinement of the invention is that said step S2 comprises the following sub-steps:
step S201, a first text file is newly established under the established project to serve as a data source configuration file;
step S202, a second text file is newly established under the established project to serve as a data structure configuration file;
step S203, creating a package structure under the created project;
step S204, creating a database access class;
step S205, creating a data structure configuration file reading class;
step S206, a code template reading class is established;
step S207, creating a code file class;
step S208, a code parameter replacement class is established;
step S209 is to package the created project program as a code automatic generation program.
In a further improvement of the present invention, in step S3, according to the functional requirement of the code automatic generation program, the data structure is set through the PowerDesigner, and after the setting is successful, the data table is created in the database through the PowerDesigner.
In a further improvement of the present invention, the process of configuring the data source corresponding to the generated code in step S4 includes the following sub-steps:
step S401, writing the drive type of the connection database in the data source configuration file;
step S402, writing database connection addresses, ports and examples in a data source configuration file;
step S403, writing a database login user and a login password in the data source configuration file;
step S404, writing the database connection type in the data source configuration file.
In a further improvement of the present invention, the process of configuring the database configuration file in step S5 includes the following sub-steps:
step S501, writing a path of a reverse code generation tool, wherein the path comprises path addresses of a front end and a back end and a root directory setting for exporting;
step S502, generating and configuring codes of the single table, wherein the codes comprise configuration table names, table main keys and whether the generation codes are started or not;
step S503, generating and configuring codes of multiple tables, wherein table names are separated by commas, and table main keys are also separated by commas; the table name comprises a table head and a table body which are separated by commas, and the table middle keys comprise a table head main key, a table body main key and a table body external key. It is proposed here that generation is only once per time;
step S504, flow table structure configuration, wherein the rule configuration of the flow table includes configuring a multi-table flow configuration main table, a history table, a temporary table and a multi-table flow configuration status field separated by commas.
In a further improvement of the present invention, the step S6 of configuring the template of the user interface frame file includes the following sub-steps:
step S601, editing a query condition template;
step S602, editing a page editing control;
step S603, editing operation button templates for page addition, deletion, modification and search;
step S604, editing a page form template;
step S605, editing a form paging template;
step S606, editing the new and modified page pop-up window template;
step S607, editing the script template of the user interface frame file;
step S608, editing the query script template;
step S609, editing a page-turning script template;
step S610, editing a main form verification rule template;
step S611, editing the operation template of the entity content of the main table
Step S612, editing the template operated from the entity content of the table;
step S613, editing a style template;
step S614, editing public request resources;
step S615, editing service address parameters;
in step S616, the general operation function is edited.
In a further improvement of the present invention, in the step S7, the templates of the configuration backend control processing layer code file include a common class of edit references, an entity class of edit references, a service class of edit references, and an edit common method template.
In step S8, the module for configuring the background logic processing layer code file includes interface configuration and service implementation class configuration, where the interface configuration includes package name to which the editing interface belongs, public class for editing and referencing, entity class for editing and referencing, service class for editing and referencing, and general method template for editing; the service implementation class configuration comprises an edit-quoted public class, an edit-quoted entity class, an edit-quoted service class and an edit universal method template.
The further improvement of the present invention lies in that the template for configuring the background data access layer code file in step S9 is a mapping file configuration template, which includes editing a named control, then opening the secondary cache by editing parameters, editing a general query mapping result, arranging the generated primary key at the first position, then inputting the public field and the common field to be generated, editing a general query result column, and further setting the output file position by editing parameters.
The further improvement of the present invention is that the code generation path configured in step S10 is configured to configure a database object entity template, including editing a package name to which an entity class belongs, editing a referenced public class, editing a primary key column parameter, facilitating a non-primary key column parameter, editing an existing field filling setting, editing an optimistic lock annotation parameter, editing a logic deletion annotation parameter, and editing a general mapper template configuration.
Compared with the prior art, the invention has the beneficial effects that: the working efficiency can be effectively improved, the automatic generation of the codes is realized, and the automatically generated codes can be directly quoted by projects under the condition of no complex business logic, so that developers do not need to carry out additional development; for the condition that the service logic needs to be added, the method can also be used for perfecting and supplementing on the basis of the generated codes, perfecting operation control, and completing function development after the service logic is supplemented, so that the development efficiency is greatly improved and the error probability is reduced; on the basis, the risk of inconsistent interfaces at the front end and the rear end is reduced, and experiments prove that the interfaces called and received by the front end and the rear end of the code generated by the invention are automatically generated, the joint debugging passing rate is 100 percent, and the condition that the interface calling fails in the joint debugging process at the front end and the rear end is basically avoided; in addition, the technical threshold is reduced, so that developers can pay more attention to logic processing and operation control without knowing complex file structure relation and complex system configuration relation; the project is easy to maintain, the generated code style is consistent through the unified interface specification, the coding specification and the variable method definition specification, each developer who knows the specification is easy to read, and the maintenance is convenient.
Drawings
FIG. 1 is a schematic workflow diagram of one embodiment of the present invention.
Detailed Description
Preferred embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
The embodiment provides a method for generating front-end HTML and JAVA background quick codes, which is mainly applied to B/S projects, developers quickly generate functional codes according to configuration database structure files and code template files, and the generated codes can be directly used on the projects, so that the software development efficiency is increased, and the software development period is shortened.
In order to improve the research and development efficiency of an information system, lead developers to concentrate on the aspect of logic processing and reduce the condition of inconsistent interfaces in the research and development process, the invention provides a method for quickly generating codes based on Java, which is applied to the research and development of the information system of a B/S framework.
By generating codes with basic system functions through the embodiment, developers complete business logic on the basis of the basic codes. The code generated by the example comprises front HTML page code, CSS style code, js code, project control layer code, project logic layer code and data access layer code.
In order to achieve the technical advantages, the present embodiment provides the following technical solutions: a method for generating front-end HTML and JAVA background quick codes. The operating environment requirements of the embodiment described in this example are as follows: the hardware environment requires, the PC computer has dual CPUs, the memory is not lower than 4G, and the disk space is not lower than 30G; operating system requirements, windows 7 or windows10 operating system; the JDK version is not lower than 1.7, and 32 bits or 64 bits are selected according to the condition of an operating system and must be consistent with the operating system; the database is a relational database and is not particularly limited; the eclipse version is more than 3.3; HTML refers to hypertext markup language, is an application under standard universal markup language, is also a specification, and is a standard for marking each part of a web page to be displayed by a mark symbol; a WEB interface refers to a software interface that can be seen under a browser.
More specifically, as shown in fig. 1, this example provides a method for quickly generating code based on Java, which includes the following steps:
step S1, creating a project in an integrated development environment for Java project development;
step S2, developing a code automatic generation program;
step S3, setting a data structure and creating a data table;
step S4, configuring a data source corresponding to the generated code;
step S5, configuring a database configuration file;
step S6, configuring a template of the user interface frame file;
step S7, configuring a template of the background control processing layer code file;
step S8, configuring modules of background logic processing layer code files;
step S9, configuring a template of the background data access layer code file;
step S10, configuring a code generation path;
step S11, starting the code automatic generation program;
step S12, reading the template configuration file and the data structure definition file;
step S13, generating a corresponding code file;
and step S14, introducing a path from the code to the development project, and realizing code generation.
Step S1 described in this example is used to create a project name, i.e., create a "code auto-generation" project in a Java project development IDE (integrated development environment); firstly, opening a Java project development IDE (integrated development environment), then selecting a new project, selecting a Java project according to the project type, naming the project name as an AutoCode, and successfully creating the project.
Step S2 in this example includes the following substeps:
step S201, a first text file is newly established under the established project to serve as a data source configuration file, and the data source configuration file is named as DataSourceConfig.properties;
step S202, a second text file is newly established under the established project to serve as a data structure configuration file, and the data structure configuration file is named TableConfig.
Step S203, creating a package structure com.its.autocode under the created project;
step S204, creating a database access class;
step S205, creating a data structure configuration file reading class;
step S206, a code template reading class is established;
step S207, creating a code file class;
step S208, a code parameter replacement class is established;
step S209 is to package the created project program as a code automatic generation program.
In step S3, according to the function requirement of the code automatic generation program, the data structure is set by the PowerDesigner, and after the setting is successful, the data table is created in the database by the PowerDesigner.
In this example, in step S3, the system data structure requiring code generation is designed according to the functional requirement requiring code generation, the design of the data structure of the project may be completed by a tool such as PowerDesigner, and after the design is completed, a data table may be created in the database by the PowerDesigner.
In this example, step S4 opens a configuration file data source config through an IDE tool, and configures a data source corresponding to a generated code, where the process of configuring a data source corresponding to a generated code includes the following sub-steps:
step S401, writing the drive type of the connection database in the data source configuration file;
step S402, writing database connection addresses, ports and examples in a data source configuration file;
step S403, writing a database login user and a login password in the data source configuration file;
step S404, writing the database connection type in the data source configuration file.
Property file is opened by IDE tool in step S5 in this example, the process of configuring database configuration file includes the following sub-steps:
step S501, writing a path of a reverse code generation tool, wherein the path comprises path addresses of a front end and a back end and a derived root directory setting, and the derived root directory setting needs to be configured into a parent directory in a getPackageConfig method under an AutoGeneratorFactory class;
step S502, generating and configuring codes of the single table, wherein the codes comprise configuration table names, table main keys and whether the generation codes are started or not;
step S503, generating and configuring codes of multiple tables, wherein table names are separated by commas, and table main keys are also separated by commas; if the codes of a plurality of tables need to be generated, commas are used for separating the table names according to the rule, and commas are used for separating the table main keys; the table name comprises a table head and a table body which are separated by commas, and the table middle keys comprise a table head main key, a table body main key and a table body external key. It is proposed here that generation is only once per time; it is worth mentioning that step S503 in this embodiment suggests only generating once, so as to avoid data from being too complex or erroneous;
step S504, flow sheet structure configuration, wherein the rule configuration of the flow sheet comprises configuring a multi-sheet flow configuration main sheet, a history sheet, a temporary sheet and a multi-sheet flow configuration state field which are separated by commas; wherein an import goods declaration single flow is subjected to templating and is configured as follows:
a) the multi-table flow configuration main table, the history table and the temporary table are separated by commas;
b) configuring the primary key settings of a primary table, a history table and a temporary table by the multi-table process;
c) the multi-table flow configuration is separated from the table, the history table and the temporary table by commas;
d) configuring primary key settings of a slave table, a history table and a temporary table by a multi-table process;
e) configuring the foreign key fields of a main table, a history table and a temporary table by the multi-table process;
f) the multi-table flow configures the status field.
All of the following configurations use the name of the database for example: the single table configuration comprises setting a table name, namely a data table name; the single table configuration includes setting data columns data column 1, data column 2, data column 3, …; setting the main key column name of the data table to comprise the main key column name; setting whether configuration is enabled (true is start).
The multi-table configuration master-slave table and the master-standard slave table are separated by commas, and comprise master table names and slave table names; the multi-table configuration comprises main external key fields separated by commas, and only single-field main external keys can be configured at present, namely a main table main key 1, a slave table main key and a slave table external key; whether multi-table configuration is enabled (true is boot).
The multi-table flow configuration comprises that a main table, a history table and a temporary table are separated by commas; the multi-table process configuration comprises the setting of the main keys of the main table, the history table and the temporary table, and the method is the same as the above (no main key is separated by a blank space); the multi-table process configuration comprises that the slave table, the history table and the temporary table are separated by commas, different service tables are separated by semicolons, the multi-table process configuration comprises the setting of the master keys of the slave table, the history table and the temporary table, and the method is the same as the above (no master key is separated by spaces); the multi-table process configuration comprises different business tables of the external key fields of a main table, a history table and a temporary table, and only single-field external keys demo can be configured at present, namely a basic table external key 1, a history table external key 1 and a temporary table external key; the configuration of the multi-table process comprises that different service tables of a state field are separated by using a semicolon, only a single-field state, namely state 1, can be configured at present, and whether true/false is started or not is configured for the multi-table process, wherein all the configurations use the name of a database.
In this example, in step S6, taking < template > as the start flag and </template > as the template end flag, configuring the template of the user interface frame file includes the following sub-steps:
step S601, editing a query condition template;
step S602, editing a page editing control;
step S603, editing operation button templates for page addition, deletion, modification and search;
step S604, editing a page form template;
step S605, editing a form paging template;
step S606, editing the new and modified page pop-up window template;
step S607, editing the script template of the user interface frame file;
step S608, editing the query script template
Step S609, editing a page-turning script template;
step S610, editing a main form verification rule template;
step S611, editing the operation template of the entity content of the main table (including the operation templates of the entity content of the main table for detail display, addition and modification);
step S612, editing the template operated by the entity content of the slave table (including the operation template of the entity content of the slave table for detail display, addition and modification);
step S613, editing a style template;
step S614, editing public request resources;
step S615, editing service address parameters;
step S616, editing the general operation functions, including the operation functions of adding, querying, deleting, and modifying.
In step S7 in this example, the templates of the configuration background control processing layer code file include a common class referenced by editing, an entity class referenced by editing, a service class referenced by editing, and an editing general method template. The universal editing method template comprises the universal editing method templates of newly adding, deleting, modifying, inquiring according to ID, inquiring according to page conditions, inquiring according to entity classes, checking, canceling, deleting in batches, checking in batches, submitting and paging
In step S8, the module for configuring the background logic processing layer code file includes interface configuration and service implementation class configuration, where the interface configuration includes a package name to which an editing interface belongs, a public class to be edited and referred to, an entity class to be edited and referred to, a service class to be edited and referred to, and an editing general method template; the service implementation class configuration comprises an edit-quoted public class, an edit-quoted entity class, an edit-quoted service class and an edit universal method template. The interface configuration comprises interface configuration templates which are newly added, deleted, modified, inquired according to ID, inquired according to page conditions, inquired according to entity classes, audited, cancelled, deleted in batches, audited in batches, submitted and paged. The service implementation class configuration comprises interface configuration templates which are newly added, deleted, modified, inquired according to ID, inquired according to page conditions, inquired according to entity classes, audited, cancelled, deleted in batches, audited in batches, submitted and paged.
In this example, the template for configuring the background data access layer code file in step S9 is a mapping file configuration template, and includes editing a naming control, then opening a secondary cache by editing a parameter, editing a general query mapping result, arranging a generated primary key at a first position, inputting a common field and a general field to be generated, editing a general query result column, and further setting an output file position by editing the parameter.
In this example, the configuration code generation path in step S10 is configured to configure a database object entity template, and includes editing a package name to which an entity class belongs, editing a referenced public class, editing a primary key column parameter, facilitating a non-primary key column parameter, editing a presence field filling setting, editing an optimistic lock annotation parameter, editing a logic deletion annotation parameter, and editing a general mapper template configuration.
Step S11 described in this example is for starting the code automatic generation program.
In the step S12, the code automatic generation program reads the template configuration file, the data structure definition file, and the database data structure, and first reads the table name in the configuration file, and then obtains the data structure from the database according to the table name.
In this example, step S13 generates a corresponding code file according to the system parsing configuration template and the database definition file, and according to the template node and the database data structure, the code generation rule is as follows: firstly, generating Java files, vue files (namely the files generated in step S6) and xml files according to templates, then replacing corresponding primary key parameters in the templates according to corresponding primary key field names in a data structure, and replacing entity parameters in the code files according to entity names in the data structure; specifically, the method comprises the following substeps:
step S131, generating a control layer Java file according to a processing layer code file template, reading a database configuration template file through an IO (input/output) class of Java, analyzing a table name and a data column name of a database, reading the Java template file, replacing a parameter name in a corresponding file with the identification range and the data column name, and generating a file through the IO class of the Java;
step S132, a VUE file is generated according to the VUE file template, namely the database configuration template file is read through Java IO (input/output) classes, the table name and the data column name of the database are analyzed, then the VUE template file is read, the parameter name in the corresponding file is replaced by the data table name and the data column name, and finally the file is generated through Java IO classes;
step S133, a JS file (Javascript webpage scripting language file) is generated according to the JS file template, namely the JS file is generated by reading the database configuration template file through the IO class of Java, analyzing the table name and the data column name of the database, then reading the JS template file, replacing the parameter name in the corresponding file with the data table name and the data column name, and then generating the file through the IO class of Java;
step S134, generating an XML file according to the template, namely reading the database configuration template file through the IO class of Java, analyzing the table name and the data column name of the database, then reading XMl the template file, replacing the parameter name in the corresponding file with the data table name and the data column name, and then generating the file through the IO class of the Java;
step S135, generating a service layer file according to a template of the logic processing layer code file, reading the database configuration template file through Java IO (input/output) class, analyzing the table name and the data column name of the database, reading the interface template file and the service implementation class template file, replacing the parameter name in the corresponding file with the data table name and the data column name, and generating the file through Java IO class;
step S136, generating an object entity file according to the database object entity template, reading the database configuration template file through Java IO (input/output) class, analyzing the table name and the data column name of the database, reading the database object entity template file, replacing the parameter name in the corresponding file with the data table name and the data column name, and finally generating the file through Java IO class;
step S14 is used to check the generated code file through the configuration path and introduce the code file into the path of the development project; the automatic generation of code is then complete and ends.
In conclusion, the method can effectively improve the working efficiency and realize the automatic generation of the codes, and the automatically generated codes can be directly quoted by projects under the condition of no complex business logic, so that developers do not need to develop additionally; for the condition that the service logic needs to be added, the method can also be used for perfecting and supplementing on the basis of the generated codes, perfecting operation control, and completing function development after the service logic is supplemented, so that the development efficiency is greatly improved and the error probability is reduced; on the basis, the risk of inconsistent interfaces at the front end and the rear end is reduced, and experiments prove that the interfaces called and received by the front end and the rear end of the code generated by the invention are automatically generated, the joint debugging passing rate is 100 percent, and the condition that the interface calling fails in the joint debugging process at the front end and the rear end is basically avoided; in addition, the technical threshold is reduced, so that developers can pay more attention to logic processing and operation control without knowing complex file structure relation and complex system configuration relation; the project is easy to maintain, the generated code style is consistent through the unified interface specification, the coding specification and the variable method definition specification, each developer who knows the specification is easy to read, and the maintenance is convenient.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (10)

1. A Java-based method for quickly generating codes is characterized by comprising the following steps:
step S1, creating a project in an integrated development environment for Java project development;
step S2, developing a code automatic generation program;
step S3, setting a data structure and creating a data table;
step S4, configuring a data source corresponding to the generated code;
step S5, configuring a database configuration file;
step S6, configuring a template of the user interface frame file;
step S7, configuring a template of the background control processing layer code file;
step S8, configuring modules of background logic processing layer code files;
step S9, configuring a template of the background data access layer code file;
step S10, configuring a code generation path;
step S11, starting the code automatic generation program;
step S12, reading the template configuration file and the data structure definition file;
step S13, generating a corresponding code file;
and step S14, introducing a path from the code to the development project, and realizing code generation.
2. The Java-based fast code generating method according to claim 1, wherein said step S2 includes the sub-steps of:
step S201, a first text file is newly established under the established project to serve as a data source configuration file;
step S202, a second text file is newly established under the established project to serve as a data structure configuration file;
step S203, creating a package structure under the created project;
step S204, creating a database access class;
step S205, creating a data structure configuration file reading class;
step S206, a code template reading class is established;
step S207, creating a code file class;
step S208, a code parameter replacement class is established;
step S209 is to package the created project program as a code automatic generation program.
3. The method for fast code generation according to claim 2, wherein in step S3, the data structure is set by PowerDesigner according to the functional requirements of the automatic code generation program, and after the setting is successful, the data table is created in the database by PowerDesigner.
4. A Java based method for quickly generating code according to claim 2 or 3, wherein the step S4 for configuring the data source process corresponding to the generated code includes the following sub-steps:
step S401, writing the drive type of the connection database in the data source configuration file;
step S402, writing database connection addresses, ports and examples in a data source configuration file;
step S403, writing a database login user and a login password in the data source configuration file;
step S404, writing the database connection type in the data source configuration file.
5. The Java-based fast code generating method according to claim 2 or 3, wherein the step S5 of configuring the database configuration file comprises the following sub-steps:
step S501, writing a path of a reverse code generation tool, wherein the path comprises path addresses of a front end and a back end and a root directory setting for exporting;
step S502, generating and configuring codes of the single table, wherein the codes comprise configuration table names, table main keys and whether the generation codes are started or not;
step S503, generating and configuring codes of multiple tables, wherein table names are separated by commas, and table main keys are also separated by commas; the table name comprises a table head and a table body which are separated by commas, and the table middle keys comprise a table head main key, a table body main key and a table body external key. It is proposed here that generation is only once per time;
step S504, flow table structure configuration, wherein the rule configuration of the flow table includes configuring a multi-table flow configuration main table, a history table, a temporary table and a multi-table flow configuration status field separated by commas.
6. The Java-based fast code generating method according to any one of claims 1 to 3, wherein the step S6 of configuring the template of the user interface frame file comprises the following sub-steps:
step S601, editing a query condition template;
step S602, editing a page editing control;
step S603, editing operation button templates for page addition, deletion, modification and search;
step S604, editing a page form template;
step S605, editing a form paging template;
step S606, editing the new and modified page pop-up window template;
step S607, editing the script template of the user interface frame file;
step S608, editing the query script template;
step S609, editing a page-turning script template;
step S610, editing a main form verification rule template;
step S611, editing the operation template of the entity content of the main table
Step S612, editing the template operated from the entity content of the table;
step S613, editing a style template;
step S614, editing public request resources;
step S615, editing service address parameters;
in step S616, the general operation function is edited.
7. The Java-based fast code generating method as claimed in any one of claims 1 to 3, wherein in step S7, the templates for configuring the background control processing layer code file include edit-referenced public classes, edit-referenced entity classes, edit-referenced service classes, and edit common method templates.
8. The Java-based method for quickly generating code according to any one of claims 1 to 3, wherein in step S8, the module for configuring the background logic processing layer code file includes interface configuration and service implementation class configuration, and the interface configuration includes package name to which the editing interface belongs, common class to which editing reference is made, entity class to which editing reference is made, service class to which editing reference is made, and universal method template to which editing is made; the service implementation class configuration comprises an edit-quoted public class, an edit-quoted entity class, an edit-quoted service class and an edit universal method template.
9. The Java-based code generation method as claimed in any one of claims 1 to 3, wherein the template for configuring the background data access layer code file in step S9 is a template for configuring a mapping file, and includes editing a named control, then opening a secondary cache by editing parameters, and editing a universal query mapping result, where a generated primary key is arranged at a first position, then inputting a common field and a common field to be generated, editing a universal query result column, and further setting an output file position by editing parameters.
10. The method for quickly generating codes based on Java according to any one of claims 1 to 3, wherein the code generation path configured in step S10 is configured to configure database object entity templates, including editing package names to which entity classes belong, editing referenced public classes, editing primary key column parameters, convenient non-primary key column parameters, editing presence field filling settings, editing optimistic lock annotation parameters, editing logic deletion annotation parameters, and editing general mapper template configurations.
CN201911156375.6A 2019-11-22 2019-11-22 Java-based method for quickly generating codes Pending CN110941423A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911156375.6A CN110941423A (en) 2019-11-22 2019-11-22 Java-based method for quickly generating codes

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911156375.6A CN110941423A (en) 2019-11-22 2019-11-22 Java-based method for quickly generating codes

Publications (1)

Publication Number Publication Date
CN110941423A true CN110941423A (en) 2020-03-31

Family

ID=69907394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911156375.6A Pending CN110941423A (en) 2019-11-22 2019-11-22 Java-based method for quickly generating codes

Country Status (1)

Country Link
CN (1) CN110941423A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625219A (en) * 2020-05-22 2020-09-04 杭州指令集智能科技有限公司 BO component processing method, device and equipment
CN111782193A (en) * 2020-07-03 2020-10-16 紫光云技术有限公司 Automatic generation method based on JAVA language code
CN111930350A (en) * 2020-08-05 2020-11-13 深轻(上海)科技有限公司 Actuarial model establishing method based on calculation template
CN112764743A (en) * 2021-01-21 2021-05-07 潘胜怀 Method for automatically generating software based on data model drive
CN112817592A (en) * 2021-01-26 2021-05-18 四川天翼网络服务有限公司 Automatic code generation method based on entity annotation
CN113010232A (en) * 2021-03-31 2021-06-22 建信金融科技有限责任公司 Configuration-driven lightweight batch data processing method and device
CN113448562A (en) * 2021-03-31 2021-09-28 北京新氧科技有限公司 Automatic logic code generation method and device and electronic equipment
CN113485770A (en) * 2021-07-26 2021-10-08 挂号网(杭州)科技有限公司 Method and device for determining service configuration data, electronic equipment and storage medium
CN113741902A (en) * 2021-09-10 2021-12-03 百融至信(北京)征信有限公司 Template-based SaaS code generation method and system
CN113835693A (en) * 2021-09-15 2021-12-24 欧电云信息科技(江苏)有限公司 Code generation method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761848B1 (en) * 2005-03-15 2010-07-20 Open Invention Network, Llc Code generator tool for building software applications with reusable components
CN105487864A (en) * 2015-11-26 2016-04-13 北京京东尚科信息技术有限公司 Method and device for automatically generating code
CN105630472A (en) * 2014-11-03 2016-06-01 中国科学院沈阳自动化研究所 Quick client development frame for manufacturing execution system and software development method for frame
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN107391153A (en) * 2017-07-31 2017-11-24 深圳乐信软件技术有限公司 A kind of code generating method and device based on Spring Yu MyBatis framework integrations
CN109062568A (en) * 2018-06-19 2018-12-21 链家网(北京)科技有限公司 A kind of project generation method and tool
CN110069246A (en) * 2019-03-28 2019-07-30 北京众智益成科技有限公司 The plateform system and its application that a kind of Java Web application is quickly developed

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7761848B1 (en) * 2005-03-15 2010-07-20 Open Invention Network, Llc Code generator tool for building software applications with reusable components
CN105630472A (en) * 2014-11-03 2016-06-01 中国科学院沈阳自动化研究所 Quick client development frame for manufacturing execution system and software development method for frame
CN105487864A (en) * 2015-11-26 2016-04-13 北京京东尚科信息技术有限公司 Method and device for automatically generating code
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN107391153A (en) * 2017-07-31 2017-11-24 深圳乐信软件技术有限公司 A kind of code generating method and device based on Spring Yu MyBatis framework integrations
CN109062568A (en) * 2018-06-19 2018-12-21 链家网(北京)科技有限公司 A kind of project generation method and tool
CN110069246A (en) * 2019-03-28 2019-07-30 北京众智益成科技有限公司 The plateform system and its application that a kind of Java Web application is quickly developed

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
匡松 等: "Java程序设计24学时轻松掌握", vol. 2008, 中国铁道出版社, pages: 204 *

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111625219A (en) * 2020-05-22 2020-09-04 杭州指令集智能科技有限公司 BO component processing method, device and equipment
CN111782193A (en) * 2020-07-03 2020-10-16 紫光云技术有限公司 Automatic generation method based on JAVA language code
CN111930350A (en) * 2020-08-05 2020-11-13 深轻(上海)科技有限公司 Actuarial model establishing method based on calculation template
CN111930350B (en) * 2020-08-05 2024-04-09 深轻(上海)科技有限公司 Calculation template-based fine calculation model establishment method
CN112764743A (en) * 2021-01-21 2021-05-07 潘胜怀 Method for automatically generating software based on data model drive
CN112817592A (en) * 2021-01-26 2021-05-18 四川天翼网络服务有限公司 Automatic code generation method based on entity annotation
CN113448562A (en) * 2021-03-31 2021-09-28 北京新氧科技有限公司 Automatic logic code generation method and device and electronic equipment
CN113448562B (en) * 2021-03-31 2023-10-20 北京新氧科技有限公司 Automatic logic code generation method and device and electronic equipment
CN113010232A (en) * 2021-03-31 2021-06-22 建信金融科技有限责任公司 Configuration-driven lightweight batch data processing method and device
CN113485770A (en) * 2021-07-26 2021-10-08 挂号网(杭州)科技有限公司 Method and device for determining service configuration data, electronic equipment and storage medium
CN113485770B (en) * 2021-07-26 2024-03-22 挂号网(杭州)科技有限公司 Method and device for determining service configuration data, electronic equipment and storage medium
CN113741902A (en) * 2021-09-10 2021-12-03 百融至信(北京)征信有限公司 Template-based SaaS code generation method and system
CN113741902B (en) * 2021-09-10 2024-03-29 百融至信(北京)科技有限公司 Template-based SaaS code generation method and system
CN113835693A (en) * 2021-09-15 2021-12-24 欧电云信息科技(江苏)有限公司 Code generation method and device, electronic equipment and storage medium
CN113835693B (en) * 2021-09-15 2024-03-08 欧电云信息科技(江苏)有限公司 Code generation method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110941423A (en) Java-based method for quickly generating codes
US7937688B2 (en) System and method for context-sensitive help in a design environment
AU2009238294B2 (en) Data transformation based on a technical design document
US10699067B2 (en) Form design and data input in which a server provides a repository of form templates that are distributed to multiple form filing client systems
US9116672B2 (en) Method and system for displaying selectable autocompletion suggestions and annotations in mapping tool
US20040158820A1 (en) System for generating an application framework and components
US20100146491A1 (en) System for Preparing Software Documentation in Natural Languages
US20090125892A1 (en) Computer Software Development System and Method
US20100318894A1 (en) Modifications to Editable Elements of Web Pages Rendered in Word Processor Applications
CN108762743B (en) Data table operation code generation method and device
WO2005029222A2 (en) Method and system for the specification of interface definitions and business rules
US20070073675A1 (en) Database query translation
WO2017058047A1 (en) Method of preparing documents in markup languages
CN104239073A (en) Data maintenance system rapid prototyping development system and method
WO2013075044A1 (en) Business content authoring and distribution
CN112667563A (en) Document management and operation method and system
Gregory Using Visual C++ 6
CN114281342A (en) Automatic code generation method
US20030182287A1 (en) Interface for an electronic spreadsheet and a database management system
CN112364669B (en) Method, device, equipment and storage medium for translating translated terms by machine translation
WO2021022702A1 (en) Log insertion method and apparatus, computer apparatus and storage medium
KR20220003106A (en) Systems and methods of computer-assisted computer programming
JP5994150B2 (en) Document creation method, document creation apparatus, and document creation program
CN111782195B (en) Query method for splicing SQL based on adding notes on request parameters
JP2012164177A (en) Program automatic generation system

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