CN105487864B - The method and apparatus of Code automatic build - Google Patents

The method and apparatus of Code automatic build Download PDF

Info

Publication number
CN105487864B
CN105487864B CN201510837148.5A CN201510837148A CN105487864B CN 105487864 B CN105487864 B CN 105487864B CN 201510837148 A CN201510837148 A CN 201510837148A CN 105487864 B CN105487864 B CN 105487864B
Authority
CN
China
Prior art keywords
code
module
business
configuration information
information
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.)
Active
Application number
CN201510837148.5A
Other languages
Chinese (zh)
Other versions
CN105487864A (en
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201510837148.5A priority Critical patent/CN105487864B/en
Publication of CN105487864A publication Critical patent/CN105487864A/en
Application granted granted Critical
Publication of CN105487864B publication Critical patent/CN105487864B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/33Intelligent editors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention provides a kind of method and apparatus of Code automatic build, by writing complicated query language, break through the limitation that can only carry out code building for single table in the prior art, and detailed configuration can be carried out according to business module of the business demand to project, so that the code generated is maximumlly met business demand.This method comprises: configuring the business module according to business demand Added Business module, and using SQL query statement;The configuration information of the business module is saved in database;Code file is generated according to the configuration information.

Description

The method and apparatus of Code automatic build
Technical field
The present invention relates to field of computer technology more particularly to a kind of method and apparatus of Code automatic build.
Background technique
Web technology is widely used in all trades and professions, as the application of the every profession and trades such as telecommunications, bank, government, enterprise, electric business System can be realized by Web technological development.As the scale of Web project is more and more huger, the development cycle is increasingly longer, exploitation Cost is higher and higher, and people increasingly favor being capable of the automatic development simple, fast and automatically, intelligent that carry out Web project development Platform.
Current existing automatic development platform implementation is mainly to pass through the personal code generator write to carry out code Automatically generate, that is, develop a code generator, realize according to formulation logic automatic code generating.Carrying out business module When exploitation, a main table of business, the basis as real time workshop are selected first;Then pass through the personal code building write The existing logic of device carries out real time workshop to the main table of the business of selection, to reduce the workload of hand-coding code.
The problem of existing automatic development platform is able to solve written in code in project development, but still there is certain office It is sex-limited:
1. the code generator logic that people writes fixes, is inflexible, code only has a kind of generating mode, can not cope with variation The desired content of multiplicity;
2. the code that code generator generates generates corresponding code content simply by the field hardness of the main table of business, do not have It is provided with the function that each field is arranged in detail, the code after generation also needs largely to be modified according to demand.
3. code generator can only be handled single table, the case where multilist conjunctive query, can not be handled, be difficult to fit Business scenario that should be all.
4. code generator realizes the persistence operation of data in conjunction with Hibernate mostly, literary style is inflexible, business After demand change, it is difficult to carry out complex when code revision.
5. the code that code generator generates generally all has carried out customized encapsulation process, it should be understood that corresponding when use Encapsulation logic, secondary learning cost can be generated.
Summary of the invention
In view of this, the present invention provides a kind of method and apparatus of Code automatic build, by writing complicated inquiry language Speech breaks through the limitation that can only carry out code building for single table in the prior art, and can be according to business demand to the business of project Module carries out detailed configuration, and the code generated is made maximumlly to meet business demand.
To achieve the above object, according to an aspect of the invention, there is provided a kind of method of Code automatic build.
The method of Code automatic build of the invention include: according to business demand Added Business module, and utilize SQL query Sentence configures the business module;The configuration information of the business module is saved in database;According to the configuration information Generate code file.
Optionally, configuring the business module using SQL query statement includes: to be generated to initialize according to SQL query statement Configuration information, the initial configuration information include: the single table information, Grid essential information, Grid column information, Form base being related to This information, Form column information;It is modified according to business demand to initial configuration information.
Optionally, the configuration information of the business module is saved in database includes: to utilize Mybatis persistent layer frame All configuration informations of the business module are saved in database by frame in the form of allocation list.
Optionally, generating code file according to the configuration information includes: by calling Velocity template engine to obtain The Code Template is generated foreground code file and backstage code by Code Template in conjunction with the configuration information of the business module File;By calling MyBatis Generator file generated tool, the text of code needed for generating MyBatis Persistence Layer Framework Part.
Optionally, the method also includes: when business demand change when, according to business demand change content modification it is corresponding Configuration information and saved;According to the code file that the selection of modified configuration information needs to regenerate, code is carried out It regenerates.
Optionally, the method also includes: when the business module develop complete, do not need to carry out code building and change again When more, the business module is locked.
To achieve the above object, according to an aspect of the invention, there is provided a kind of device of Code automatic build.
The device of Code automatic build of the invention includes: configuration module, is used for according to business demand Added Business module, And the business module is configured using SQL query statement;Preserving module, for the configuration information of the business module to be saved in In database;Code generation module, for generating code file according to the configuration information.
Optionally, the configuration module is also used to: initial configuration information is generated according to SQL query statement, it is described initial Changing configuration information includes: the single table information being related to, Grid essential information, Grid column information, Form essential information, Form column letter Breath;It is modified according to business demand to initial configuration information.
Optionally, the preserving module is also used to: being matched all of the business module using Mybatis Persistence Layer Framework Confidence breath is saved in database in the form of allocation list.
Optionally, the code generation module is also used to:, will by calling Velocity template engine to obtain Code Template The Code Template generates foreground code file and backstage code file in conjunction with the configuration information of the business module;Pass through tune With MyBatis Generator file generated tool, code file needed for generating MyBatis Persistence Layer Framework.
Optionally, described device is also used to: when business demand change, content that configuration module is changed according to business demand Modify corresponding configuration information;Preserving module saves modified configuration information;Code generation module is according to modified configuration The code file that information selection needs to regenerate carries out code and regenerates.
Optionally, the configuration module is also used to: being developed and is completed when the business module, does not need to carry out code building again When with change, the business module is locked.
According to the technique and scheme of the present invention, during web project development, as unit of business module, pass through and configure SQL query statement breaks through the limitation that can only carry out single table code generation in the prior art, can handle any industry to realize Business logic;By the detailed configuration to each field of business module, so that so that the code generated is maximumlly met business needs It asks;Carrying out persistence in the form of allocation list to configuration information using Mybatis Persistence Layer Framework, so that place The scope of business of reason is broader, and availability is higher, and the code legibility generated is good, and modification difficulty is low, facilitates opening for project Hair;By calling Velocity template engine to generate code file, the height of realization code building pattern be can customize, so as to To adapt to different types of business demand exploitation;By generating MyBatis using MyBatis Generator file generated tool Code file needed for Persistence Layer Framework thereby may be ensured that unified and standard and with MyBatis the combination of single table public documents, It realizes and the persistence of data is operated;Further, since the mode of allocation list has been used to save the configuration information of business module, thus It can directly select corresponding allocation list when carrying out code revision and modify, and regenerate corresponding code, it is real The controllability of existing code building;After the completion of the exploitation of a certain business module, by lock out action, it may be implemented to the business module Locking, with prevent generate code covered because being misused.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of the method for Code automatic build according to an embodiment of the present invention;
Fig. 2 is the schematic diagram of the main modular of the device of Code automatic build according to an embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is the schematic diagram of the key step of the method for Code automatic build according to an embodiment of the present invention.
As shown in Figure 1, the method for the Code automatic build of the embodiment of the present invention mainly includes the following steps:
Step S11: the business module is configured according to business demand Added Business module, and using SQL query statement.
Step S12: the configuration information of the business module is saved in database.
In technical solution of the present invention, a web project automatic development platform is built using open source technology.Wherein, mainly exist (MVC, i.e. Model View Controller are model (model)-view (view)-controllers to MVC frame (controller) abbreviation, a kind of software design model, with a kind of service logic, data, the method group of interface display separation Code is knitted, service logic is gathered into an inside components, while improvement and personalized customization interface and user's interaction, no Need to rewrite service logic) exploitation of interior carry out project.Spring MVC frame is mainly utilized in the present invention.Spring MVC frame belongs to the subsequent product of Spring FrameWork, provides the global function MVC module of building web application. Spring MVC has separated the role of controller, model object, allocator and processing routine object.
In the present invention, according to business demand to the newly-increased and configuration of business module mainly in the exhibition of Spring MVC frame Show that layer carries out.The display technique of Spring MVC presentation layer (i.e. view view) can be based on Jquery language and Jquery The technical support in Easy UI displaying control library.Page layout is carried out by the component that Jquery Easy UI is provided, is passed through The foreground JavaScript operating method that Jquery is provided realizes service logic.For example, in one Students'Management System of exploitation In the process, it may relate to gender field in the student information table of student's business module, at this point it is possible to provided by Jquery Foreground JavaScript method obtains corresponding gender data, then passes through the combobox component of Jquery Easy UI in foreground page Gender option is shown in face.
In an embodiment of the present invention, the exploitation of web project is carried out as unit of module, according to business demand Added Business Module, and detailed configuration is carried out to business module.It is to increase a business module newly according to business demand first;Secondly it configures SQL query statement, according to the SQL query statement initial configuration information of configuration, by single table and word involved by business module The acquisition of information of section etc. comes out, and the information obtained at this time is the default configuration information of business module initialization, including the list being related to Table information, Grid essential information, Grid column information, Form essential information, Form column information;Finally to the initial configuration of generation Information is modified according to business demand.
Wherein modified to the initial configuration information of generation according to business demand includes: after configuring SQL query statement Generate the single table information being related to, the Grid essential information, Grid column information, Form essential information, Form column information of initialization;Root According to business demand to the single table information, Grid essential information, Grid column information, the Form essential information, Form that are related to of initialization Column information carries out detailed configuration.
During business module configures, need for all configuration informations of business module to be saved in database.This hair In bright, all configuration informations of business module are saved in database in the form of allocation list using Mybatis Persistence Layer Framework In.Mybatis Persistence Layer Framework is the Persistence Layer Framework based on Java, and sql sentence is directly write in support, by sql sentence It is stored in xml configuration file, program is directly read, and the business logic processing of any complexity may be implemented.And existing skill Art be by the configuration information of field write-in code, modification get up it is not flexible, in the present invention using Mybatis Persistence Layer Framework into The preservation of row configuration information, so that the accessible scope of business of business module is broader, availability is higher, and the code generated Legibility is good, can be modified according to business demand to code after code building, and directly select corresponding allocation list Corresponding configuration information is modified, and modification difficulty is reduced compared with the difficulty for being handled complicated business using Hibernate.
The concrete configuration process of business module is as described below:
A module is increased newly according to business demand.Recording module title, block code, developer, background generate The business modules basic configuration informations such as the folder path where behind the packet path, foreground file generated where afterwards.According to typing Block code automatically generate the file name of foreground file and background, and business module basic configuration information is saved in The business module of database configures in main table.
If necessary to modify to module information after Added Business module, corresponding module information record can choose, The modification of module configuration information is carried out by modified module interface.
After the completion of Added Business module, detailed configuration is carried out to business module.Including SQL query statement configuration, it is related to table Information configuration, the configuration of Grid essential information, the configuration of Grid column information, the configuration of Form essential information, the configuration of Form column information.
Query statement is sorted out according to the business demand of module, and corresponding be entered into presentation layer of query statement content is matched The purchase of property be engaged in the select statement parts of module interfaces, from statement part, where statement part, group by statement part and Order by statement part etc. is saved after the completion of typing.Development platform verifies query statement during preservation, school It tests whether query statement can correctly execute, such as cannot correctly execute, then prompt is modified, as can correct execute, is then utilized Query statement is saved in the query SQL field that the business module in database configures in main table by Mybatis.
After query statement saves successfully, business module is initialized, generates following initial configuration information:
I. according to the business module query statement of configuration obtain out it involved in list table information, such as table name, table alias, And generate the corresponding entity class name of single table, the packet path of entity file storage, the packet path of SqlMap file storage and Mapper The packet path of file storage, while the value for whether participating in persistence field of default setting list table, finally will be every using Mybatis A list table relevant information records the module being saved in database as one and is related in table allocation list;
Ii. configured in the Grid of database and generate a record in main table, default setting List name, Grid height, Grid width, every page line number, whether single choice, whether the field informations such as editable;
Iii. according to all field informations inquired in query statement, it is in the Grid column configuration information table of database Each field generates a record information, when generation obtain automatically the corresponding field name of field, field alias, field annotate, Whether the affiliated table of field, automatic identification field are major key, according to recognition result write-back whether show and whether editable respective value, The type for judging automatically field, according in field type write-back display type, line editor parameter, combobox transcoding type etc. Hold;
Iv. it is configured in the Form of database and generates three records in main table, corresponding three kinds of Form types are respectively inquired Whether Form, newly-increased Form, modification Form, every ranks number of default setting every record the fields letter such as show, whether generate Breath;
V. it according to all field informations inquired in query statement, configures in detailed table in the Form of database as inquiry Form, newly-increased Form, modification Form three classes Form generate corresponding record information respectively.Automatically it is corresponding that field is obtained when generation Field name, field alias, field annotation, the affiliated table of field, whether automatic identification field is major key, according to recognition result intelligence Write-back whether show and whether editable respective value, judge automatically the type of field, class shown according to the automatic write-back of field type The contents such as type, foreground verification rule, foreground verification prompt information, query type, combobox transcoding type.
After the completion of initialization process, initialization information is returned in the corresponding lists of the operation interface of presentation layer, at this time Initialization information can further be modified in conjunction with business demand, such as modify certain single tables operated without persistence, The height and width of Grid, Grid whether editable, whether the column in Grid show, whether the column in Grid are combobox and right Those fields need to show, inquire the query type of field in inquiry Form in the transcoding type answered, inquiry Form, and newly-increased Field verification rule and verification prompt information etc. in Form and modification Form.And after being modified using Mybatis Persistence Layer Framework Configuration information be saved in database.The database used in the present invention for example can be MySQL (relevant database management System) database.
It completes configuring business module, and after configuration information is saved in database, is started to process from step S13.
Step S13: code file is generated according to the configuration information.
The generation of code mainly carries out in the control layer (controller controller) of Spring MVC frame.According to guarantor The configuration information deposited in the database generates code file, comprising: by calling Velocity template engine to obtain Code Template, The Code Template is generated into foreground code file and backstage code file in conjunction with the configuration information of business module;Pass through calling MyBatis Generator file generated tool, code file needed for generating MyBatis Persistence Layer Framework.
Wherein, Velocity template engine is the template engine (template engine) based on java.It allows Simple template instruction (template language) Lai Yinyong is only used only by the object of java code definition in anyone.? In the present invention, using Velocity template engine, realize customized to Code Template predetermined progress.To predetermined Code Template progress is customized to be may is that by modifying to existing template, realizes that modified Code Template more accords with Run the business demand of hair jointly;Further, it is also possible to replicate existing template, the template of oneself is re-established on its basis.
Development platform calls Velocity template engine, obtains Code Template, then passes the configuration information of business module Enter in Code Template, to replace corresponding attribute, combines configuration data with Code Template to realize, to generate foreground Code file and backstage code file.These files include the following contents: foreground main interface Main.jsp, foreground main interface Main.js, foreground increase interface A dd.jsp newly, foreground increases interface A dd.js newly, interface Update.jsp is modified on foreground, foreground is repaired Change interface Update.js, backstage Controller.java, backstage Service interface IService.java, backstage Service Realize that class ServiceImpl.java, backstage DAO interface IDAO.java, backstage DAO realize class DAOImpl.java, backstage industry Entity BusiEntity.java, Batch Processing sqlmap file sqlmap.xml.
MyBatis Generator is file generated tool, is generated using MyBatis Generator file generated tool File content needed for MyBatis Persistence Layer Framework, including the corresponding mapped file of single table being related in query SQL and entity File.
Development platform calls MyBatis Generator file generated tool, in conjunction with Configuration information in MyBatisGeneratorConfig.xml configuration file automatically generates the corresponding MyBatis of all single tables Code file needed for Persistence Layer Framework, including the following contents: Batch Processing sqlmap file sqlmap.xml, the single table in backstage are public File Entity.java and Mapper.xml altogether.
By the code building of the step, it may be implemented to generate height according to the detailed configuration information of business module and meet The foreground code file of business demand, backstage code file and the public persistence file of single table, developer do not need again substantially Code revision is carried out, the business demand of oneself can be realized.
The method of the Code automatic build of the embodiment of the present invention can also include: when business demand change, according to business The corresponding configuration information of demand modification business module simultaneously saves;The generation for needing to regenerate according to the selection of modified configuration information Code file carries out code and regenerates.
After having automatically generated code by development platform, if business personnel proposes demand change, it is only necessary to according to need It asks changed content to re-start the configuration of business module, corresponding configuration information is adjusted to meet the content after demand changes, And the configuration information after change is saved in database, the code file that then selection needs to regenerate carries out code again It generates.For not being related to demand change or having carried out the code file of modification, generation can may be implemented in this way without selection The controllability that code generates prevents the code file for not needing to change to be capped.
When code regenerates, automatic code is carried out to the file that selection needs to regenerate according to the information reconfigured The process of generation is as previously mentioned, details are not described herein again.
The method of the Code automatic build of the embodiment of the present invention can also include: to develop to complete when business module, not need When carrying out code building and change again, locking service module.
If a business module all complete by exploitation, do not need to carry out code building again, then it can be to the business Module record is locked, and cannot be modified, be configured again after locking, generating code, delete operation, preventing code from accidentally being grasped Make and is capped.
When carrying out module lock operation, in the module allocation list in write-back library corresponding record whether lock field is "Yes".When operating again to module record, development platform meeting is according to whether lock field judges that the record has been in lock Determine state, directly prompt cannot carry out relevant operation.
The method of Code automatic build according to an embodiment of the present invention can be seen that during web project development, with Business module is unit, and by configuring SQL query statement, breakthrough can only carry out the limitation of single table code generation in the prior art, It can handle any service logic to realize;By the detailed configuration to each field of business module, come to make to generate Code maximumlly meet business demand;Utilizing Mybatis Persistence Layer Framework to configuration information in the form of allocation list Persistence is carried out, so that the scope of business of processing is broader, availability is higher, and the code legibility generated Good, modification difficulty is low, facilitates the exploitation of project;By calling Velocity template engine to generate code file, realize that code is raw It can customize at the height of pattern, so as to adapt to different types of business demand exploitation;By utilizing MyBatis Code file needed for Generator file generated tool generates MyBatis Persistence Layer Framework, thereby may be ensured that single table is public Unified and standard and with MyBatis the combination of file is realized and is operated to the persistence of data;Further, since having used allocation list Mode save the configuration information of business module, so as to directly select corresponding configuration when carrying out code revision Table is modified, and regenerates corresponding code, realizes the controllability of code building;It develops and completes in a certain business module Afterwards, by lock out action, the locking to the business module may be implemented, to prevent the code generated from covering because being misused.
Fig. 2 is the schematic diagram of the main modular of the device of Code automatic build according to an embodiment of the present invention.
As shown in Fig. 2, the device 20 of the Code automatic build of the embodiment of the present invention mainly includes following module: configuration module 201, preserving module 202, code generation module 203.
Configuration module 201, for configuring the industry according to business demand Added Business module, and using SQL query statement Business module;Preserving module 202, for the configuration information of the business module to be saved in database;Code generation module 203, for generating code file according to the configuration information.
Configuration module 201 is also used to: generating initial configuration information, the initial configuration letter according to SQL query statement Breath includes: the single table information being related to, Grid essential information, Grid column information, Form essential information, Form column information;According to industry Business demand modifies to initial configuration information.
Preserving module 202 is also used to: using Mybatis Persistence Layer Framework by all configuration informations of the business module with The form of allocation list is saved in database.
Code generation module 203 is also used to: by calling Velocity template engine to obtain Code Template, by the code Template generates foreground code file and backstage code file in conjunction with the configuration information of the business module;Pass through calling MyBatis Generator file generated tool, code file needed for generating MyBatis Persistence Layer Framework.
Device 20 is also used to: when business demand change, content modification phase that configuration module 201 is changed according to business demand The configuration information answered;Preserving module 202 saves modified configuration information;Code generation module 203 is according to modified configuration The code file that information selection needs to regenerate carries out code and regenerates.
Configuration module 201 is also used to: being developed and is completed when the business module, does not need to carry out code building and change again When, lock the business module.
From the above, it can be seen that during web project development, as unit of business module, by configuring SQL Query statement breaks through the limitation that can only carry out single table code generation in the prior art, can handle any business to realize Logic;By the detailed configuration to each field of business module, so that the code generated be made maximumlly to meet business demand; Carrying out persistence in the form of allocation list to configuration information using Mybatis Persistence Layer Framework, so that processing The scope of business it is broader, availability is higher, and generate code legibility it is good, modification difficulty is low, facilitates the exploitation of project; By calling Velocity template engine to generate code file, the height of realization code building pattern be can customize, so as to Adapt to different types of business demand exploitation;It is held by generating MyBatis using MyBatis Generator file generated tool Code file needed for long layer frame, thereby may be ensured that unified and standard and with MyBatis the combination of single table public documents, real Now the persistence of data is operated;Further, since the mode of allocation list has been used to save the configuration information of business module, so as to To directly select corresponding allocation list and modify, and regenerate corresponding code when carrying out code revision, realize The controllability of code building;After the completion of the exploitation of a certain business module, by lock out action, it may be implemented to the business module Locking, to prevent the code generated from covering because being misused.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of method of Code automatic build characterized by comprising
The business module is configured according to business demand Added Business module, and using SQL query statement;
The configuration information of the business module is saved in database;
Code file is generated according to the configuration information;
Wherein, described to configure the business module using SQL query statement, comprising: to be generated according to the SQL query statement initial Change configuration information, the initial configuration information includes: the single table information being related to, Grid essential information, Grid column information, Form Essential information, Form column information, the single table information being related to include table name involved in the business demand, entity class name, The packet path of entity file storage;
It is modified according to business demand to the initial configuration information.
2. the method according to claim 1, wherein the configuration information of the business module is saved in database In include: to be saved in all configuration informations of the business module in the form of allocation list using Mybatis Persistence Layer Framework In database.
3. the method according to claim 1, wherein including: according to configuration information generation code file
By calling Velocity template engine to obtain Code Template, by the Code Template with the business module with confidence Breath, which combines, generates foreground code file and backstage code file;
By calling MyBatis Generator file generated tool, the text of code needed for generating MyBatis Persistence Layer Framework Part.
4. the method according to claim 1, wherein the method also includes:
When business demand change, according to the corresponding configuration information of content modification of business demand change and saved;
According to the code file that the selection of modified configuration information needs to regenerate, carries out code and regenerate.
5. method according to claim 1-4, which is characterized in that the method also includes:
It develops and completes when the business module, when not needing to carry out code building and change again, lock the business module.
6. a kind of device of Code automatic build characterized by comprising
Configuration module, for configuring the business module according to business demand Added Business module, and using SQL query statement, According to the SQL query statement generate initial configuration information, the initial configuration information include: the single table information being related to, Grid essential information, Grid column information, Form essential information, Form column information, the single table information being related to includes the industry The packet path that table name involved in business demand, entity class name, entity file are stored;According to business demand to initial configuration information It modifies;
Preserving module, for the configuration information of the business module to be saved in database;
Code generation module, for generating code file according to the configuration information.
7. device according to claim 6, which is characterized in that the preserving module is also used to: utilizing Mybatis persistent layer All configuration informations of the business module are saved in database by frame in the form of allocation list.
8. device according to claim 6, which is characterized in that the code generation module is also used to:
By calling Velocity template engine to obtain Code Template, by the Code Template with the business module with confidence Breath, which combines, generates foreground code file and backstage code file;
By calling MyBatis Generator file generated tool, the text of code needed for generating MyBatis Persistence Layer Framework Part.
9. device according to claim 6, which is characterized in that described device is also used to:
When business demand change, configuration module is according to the corresponding configuration information of content modification that business demand changes;
Preserving module saves modified configuration information;
The code file that code generation module needs to regenerate according to the selection of modified configuration information carries out code and gives birth to again At.
10. according to the described in any item devices of claim 6-9, which is characterized in that the configuration module is also used to:
It develops and completes when the business module, when not needing to carry out code building and change again, lock the business module.
11. a kind of electronic equipment of Code automatic build characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 5 is realized when row.
CN201510837148.5A 2015-11-26 2015-11-26 The method and apparatus of Code automatic build Active CN105487864B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510837148.5A CN105487864B (en) 2015-11-26 2015-11-26 The method and apparatus of Code automatic build

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510837148.5A CN105487864B (en) 2015-11-26 2015-11-26 The method and apparatus of Code automatic build

Publications (2)

Publication Number Publication Date
CN105487864A CN105487864A (en) 2016-04-13
CN105487864B true CN105487864B (en) 2019-06-04

Family

ID=55674864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510837148.5A Active CN105487864B (en) 2015-11-26 2015-11-26 The method and apparatus of Code automatic build

Country Status (1)

Country Link
CN (1) CN105487864B (en)

Families Citing this family (26)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126564A (en) * 2016-06-17 2016-11-16 浙江万朋教育科技股份有限公司 A kind of method rendered based on dynamic template language
CN107273116B (en) * 2017-05-22 2020-09-25 互联天下科技发展(深圳)有限公司 Method for producing code using framework-based code generation tool
CN110019350B (en) * 2017-07-28 2021-06-29 北京京东尚科信息技术有限公司 Data query method and device based on configuration information
CN108153897B (en) * 2018-01-10 2022-04-12 中国银行股份有限公司 PLSQL program code generation method and system
CN110019146A (en) * 2018-06-26 2019-07-16 珠海宏桥高科技有限公司 A kind of implementation method and device of list table maintenance function
CN108920140B (en) * 2018-07-19 2022-03-01 河北中科恒运软件科技股份有限公司 Front-end and back-end unified verification method
CN109240670A (en) * 2018-11-21 2019-01-18 北京锐安科技有限公司 Modular software development methodology, system, equipment and medium
CN109725891A (en) * 2018-12-29 2019-05-07 深圳市思迪信息技术股份有限公司 The method and device that business module quickly generates
CN109783084A (en) * 2019-01-18 2019-05-21 广州思坦德计算机信息科技有限公司 A kind of computer code automatic generation method, system, device and storage medium
CN110162295A (en) * 2019-04-01 2019-08-23 贵州力创科技发展有限公司 A kind of quick development method and system
CN112181396A (en) * 2019-07-02 2021-01-05 北京京东尚科信息技术有限公司 RN code automatic generation system, method, equipment and medium
CN110262790B (en) * 2019-07-04 2024-05-07 平安科技(深圳)有限公司 Component generation method and device, storage medium and terminal equipment
CN110489106A (en) * 2019-07-22 2019-11-22 北京字节跳动网络技术有限公司 A kind of generation method, device, medium and the electronic equipment of project initial code
CN110247843A (en) * 2019-07-31 2019-09-17 浪潮软件股份有限公司 A kind of wechat public platform based customized service message method for pushing and system
CN110765152B (en) * 2019-09-18 2023-05-30 平安科技(深圳)有限公司 SQL extraction method, SQL extraction device, computer equipment and storage medium
CN110795080A (en) * 2019-10-21 2020-02-14 山东舜知信息科技有限公司 Automatic code generation system based on database annotation and construction method
CN110941423A (en) * 2019-11-22 2020-03-31 深圳市航通智能技术有限公司 Java-based method for quickly generating codes
CN111694562A (en) * 2020-06-16 2020-09-22 北京弘远博学科技有限公司 Code generation tool
CN112256250A (en) * 2020-10-22 2021-01-22 重庆中源绿蓝环境科技有限公司 Java spring cloud + MyBatis framework base layer source code generation tool
CN112631568A (en) * 2020-12-30 2021-04-09 深圳康佳电子科技有限公司 Code generation method and device, intelligent terminal and storage medium
CN113110832A (en) * 2021-04-08 2021-07-13 北京联创新天科技有限公司 Intelligent efficient code generation method and device and storage medium
CN113268231A (en) * 2021-06-08 2021-08-17 浪潮天元通信信息系统有限公司 Data acquisition and comparison method
CN113485770B (en) * 2021-07-26 2024-03-22 挂号网(杭州)科技有限公司 Method and device for determining service configuration data, electronic equipment and storage medium
CN113608726B (en) * 2021-07-30 2023-08-11 三一专用汽车有限责任公司 Code generation method, device, electronic equipment and storage medium
CN114089979A (en) * 2021-11-29 2022-02-25 中国联合网络通信集团有限公司 Persistent layer code updating method, system, terminal device and computer storage medium
CN114756554B (en) * 2022-06-13 2022-09-30 中建电子商务有限责任公司 Data query processing method based on MyBatis framework

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398755A (en) * 2008-08-22 2009-04-01 满延平 Software auto generating method based on template
CN101727324A (en) * 2009-12-17 2010-06-09 中国电力科学研究院 Code generation method and device
CN103092589A (en) * 2011-11-03 2013-05-08 浙江省公众信息产业有限公司 SSH (Struts, Spring and Hibernate) frame based code automatic generation method
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system
CN104462545A (en) * 2014-12-24 2015-03-25 国家电网公司 Page construction method and device based on three-layer model

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101398755A (en) * 2008-08-22 2009-04-01 满延平 Software auto generating method based on template
CN101727324A (en) * 2009-12-17 2010-06-09 中国电力科学研究院 Code generation method and device
CN103092589A (en) * 2011-11-03 2013-05-08 浙江省公众信息产业有限公司 SSH (Struts, Spring and Hibernate) frame based code automatic generation method
CN103617037A (en) * 2013-11-27 2014-03-05 张洁 Developing method for web development system and web development system
CN104462545A (en) * 2014-12-24 2015-03-25 国家电网公司 Page construction method and device based on three-layer model

Also Published As

Publication number Publication date
CN105487864A (en) 2016-04-13

Similar Documents

Publication Publication Date Title
CN105487864B (en) The method and apparatus of Code automatic build
CN110825362A (en) Low-code application software development system and method
CN107967316A (en) A kind of method of data synchronization, equipment and computer-readable recording medium
CN110287097A (en) Batch testing method, device and computer readable storage medium
US20130097583A1 (en) Systems and Methods For Automating the Application of a Software Methodology
CN106648587A (en) Annotation-based Web application code generation method
AU2017265144B2 (en) Information retrieval
CN104111826A (en) Software project development method and device
CN106886406A (en) The generation method and device of exploitation code or document
CN102693127B (en) Data-driven schema for describing and executing management tasks in a graphical user interface
US9977655B2 (en) System and method for automatic extraction of software design from requirements
CN110020356A (en) A kind of code generating method of page module, apparatus and system
US9508083B2 (en) Extensibility for sales predictor (SPE)
US20230086854A1 (en) Dynamically controlling case model structure using case fragments
CN114238808A (en) Page display method and device, computer equipment and storage medium
EP2883134A1 (en) Executable software specification generation
JP2018538641A (en) Computer system for generating randomized and clinical trial supply management (RTSM) systems for clinical trials
CN117311778A (en) Application management method and device
US10936557B2 (en) Relational database schema generation
Gill Using React Native for mobile software development
CN110333859A (en) Page creation method, apparatus, electronic equipment and computer readable storage medium
CN113506099A (en) Configuration system, method, computer device and storage medium for reporting service
US20080022258A1 (en) Custom database system and method of building and operating the same
Jørgensen et al. Variability handling for mobile banking apps on ios and android
CN117850752B (en) Method and system for constructing low-code platform through domain model instantiation generator

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant