[go: up one dir, main page]

CN105487864A - Method and device for automatically generating code - Google Patents

Method and device for automatically generating code Download PDF

Info

Publication number
CN105487864A
CN105487864A CN201510837148.5A CN201510837148A CN105487864A CN 105487864 A CN105487864 A CN 105487864A CN 201510837148 A CN201510837148 A CN 201510837148A CN 105487864 A CN105487864 A CN 105487864A
Authority
CN
China
Prior art keywords
code
module
configuration information
information
business
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.)
Granted
Application number
CN201510837148.5A
Other languages
Chinese (zh)
Other versions
CN105487864B (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 invention provides a method and device for automatically generating a code. By writing a complex query language, limits in the prior art that code generation can only be performed on a single table can be broken through, and detailed configuration can be performed on a service module of a project according to a service requirement, so that the generated code can meet the service requirement to the maximum extent. The method comprises the following steps: newly adding the service module according to the service requirement and using an SQL (Structured Query Language) query statement to configure the service module; conserving configuration information of the service module to a database; and generating a code file 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, particularly relate to a kind of method and apparatus of Code automatic build.
Background technology
Web technology is widely used in all trades and professions, and the application system as every profession and trades such as telecommunications, bank, government, enterprise, electric business all realizes by Web technological development.Along with the scale of Web project is more and more huger, the construction cycle is more and more longer, and cost of development is more and more higher, people more and more favor can simply, fast and automatically, intelligence the automatic development platform carrying out Web project development.
The code generator that current existing automatic development platform implementation is mainly write by individual carries out the automatic generation of code, namely develops a code generator, realizes the logic automatic code generating according to formulating.When carrying out business module exploitation, first select a business master meter, as the basis of real time workshop; Then by the existing logic of the individual code generator write, real time workshop is carried out to the business master meter selected, thus reduce the workload of hand-coding code.
Existing automatic development platform can solve the problem that in project development, code is write, but still has certain limitation:
1. the code generator logic that a people writes is fixed, inflexible, code only has a kind of generating mode, cannot the various desired content of challenging changes;
2. the code that code generator generates is the code content by the rigid generation correspondence of the field of business master meter, and do not provide the function of each field being carried out to setting in detail, the code after generation also needs to revise in a large number according to demand.
3. code generator can only process single table, and the situation for multilist conjunctive query cannot process, and is difficult to adapt to all business scenarios.
4. code generator realizes the persistence operation of data mostly in conjunction with Hibernate, literary style underaction, after business demand changes, and complex difficulty when carrying out code revision.
5. the code that code generator generates generally all has carried out self-defining encapsulation process, needs to understand corresponding encapsulation logic, can produce secondary learning cost during use.
Summary of the invention
In view of this, the invention provides a kind of method and apparatus of Code automatic build, by writing complicated query language, break through the restriction can only carrying out code building in prior art for single table, and detailed configuration can be carried out according to business demand to the business module of project, make that generation code is out maximized meets business demand.
For achieving the above object, according to an aspect of the present invention, a kind of method of Code automatic build is provided.
The method of Code automatic build of the present invention comprises: according to business demand Added Business module, and utilizes SQL query statement to configure described business module; The configuration information of described business module is saved in database; According to described configuration information generating code file.
Alternatively, utilize SQL query statement to configure described business module to comprise: generate initializes configuration information according to SQL query statement, described initializes configuration information comprises: the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to; According to business demand, initializes configuration information is modified.
Alternatively, the configuration information of described business module is saved in database to comprise: utilize Mybatis Persistence Layer Framework to be saved in database with the form of allocation list by all configuration informations of described business module.
Alternatively, comprise according to described configuration information generating code file: obtaining Code Template by calling Velocity template engine, described Code Template being combined with the configuration information of described business module and generating foreground code file and backstage code file; By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
Alternatively, described method also comprises: when business demand changes, and the corresponding configuration information of content modification changed according to business demand is also preserved; Select the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
Alternatively, described method also comprises: when described business module has been developed, and when not needing carry out code building again and change, locks described business module.
For achieving the above object, according to an aspect of the present invention, a kind of device of Code automatic build is provided.
The device of Code automatic build of the present invention comprises: configuration module, for according to business demand Added Business module, and utilizes SQL query statement to configure described business module; Preserve module, for being saved in database by the configuration information of described business module; Code generation module, for according to described configuration information generating code file.
Alternatively, described configuration module also for: according to SQL query statement generate initializes configuration information, described initializes configuration information comprises: the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to; According to business demand, initializes configuration information is modified.
Alternatively, described preservation module also for: utilize Mybatis Persistence Layer Framework to be saved in database with the form of allocation list by all configuration informations of described business module.
Alternatively, described code generation module also for: by call Velocity template engine obtain Code Template, described Code Template is combined with the configuration information of described business module and generates foreground code file and backstage code file; By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
Alternatively, described device also for: when business demand changes, the corresponding configuration information of content modification that configuration module changes according to business demand; Preserve module and preserve amended configuration information; Code generation module selects the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
Alternatively, described configuration module also for: when described business module has been developed, when not needing to carry out again code building and change, lock described business module.
According to technical scheme of the present invention, in the process of web project development, in units of business module, by configuration SQL query statement, break through the restriction can only carrying out single table code generation in prior art, thus realize processing any service logic; By the detailed configuration to each field of business module, thus make that generation code is out maximized meets business demand; By utilizing Mybatis Persistence Layer Framework to carry out persistence to configuration information with the form of allocation list, thus the scope of business making it possible to process is broader, and availability is higher, and the code legibility generated is good, and amendment difficulty is low, facilitates the exploitation of project; By calling Velocity template engine generating code file, the height that code generates pattern can customize, thus can adapt to dissimilar business demand exploitation; By utilizing MyBatisGenerator file generated instrument to generate code file needed for MyBatis Persistence Layer Framework, thus can bonding table public documents unified and standard and the combination with MyBatis, realize operating the persistence of data; In addition, because the mode employing allocation list preserves the configuration information of business module, thus when carrying out code revision, corresponding allocation list directly can be selected to modify, and regenerates corresponding code, the controllability that code generates; After a certain business module has been developed, by lock out action, the locking to this business module can being realized, covering because being misused to prevent the code generated.
Accompanying drawing explanation
Accompanying drawing is used for understanding the present invention better, does not form inappropriate limitation of the present invention.Wherein:
Fig. 1 is the schematic diagram of the key step of the method for Code automatic build according to the embodiment of the present invention;
Fig. 2 is the schematic diagram of the main modular of the device of Code automatic build according to the embodiment of the present invention.
Embodiment
Below in conjunction with accompanying drawing, one exemplary embodiment of the present invention is explained, comprising the various details of the embodiment of the present invention to help understanding, they should be thought it is only exemplary.Therefore, those of ordinary skill in the art will be appreciated that, can make various change and amendment, and can not deviate from scope and spirit of the present invention to the embodiments described herein.Equally, for clarity and conciseness, the description to known function and structure is eliminated in following description.
Fig. 1 is the schematic diagram of the key step of the method for Code automatic build according to the 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 comprises the steps:
Step S11: according to business demand Added Business module, and utilize SQL query statement to configure described business module.
Step S12: the configuration information of described business module is saved in database.
In technical scheme of the present invention, open source technology is utilized to build a web project automatic development platform.Wherein, main at MVC framework (MVC, i.e. ModelViewController, it is the abbreviation of model (model)-view (view)-controller (controller), a kind of Software for Design model, code is organized by a kind of method that service logic, data, interface display are separated, service logic is gathered an inside components, while improvement and personalized customization interface and user interactions, do not need again to write service logic) in carry out the exploitation of project.SpringMVC framework is mainly utilized in the present invention.SpringMVC framework belongs to the subsequent product of SpringFrameWork, provides the global function MVC module building web application.SpringMVC has been separated the role of controller, model object, allocator and handling procedure object.
In the present invention, according to business demand, the newly-increased of business module and configuration are mainly carried out at the presentation layer of SpringMVC framework.The display technique of SpringMVC presentation layer (i.e. view view) can be the technical support based on Jquery language and JqueryEasyUI displaying control storehouse.The assembly provided by JqueryEasyUI carries out page layout, and the foreground JavaScript method of operating provided by Jquery realizes service logic.Such as, in the process of an exploitation Students'Management System, sex field may be related in the student information table of student's business module, now, the foreground JavaScript method that can be provided by Jquery obtains corresponding gender data, then in front page layout, shows sex option by the combobox assembly of JqueryEasyUI.
In an embodiment of the present invention, the exploitation of web project is carried out in units of module, according to business demand Added Business module, and carries out detailed configuration to business module.Namely be first according to the newly-increased business module of business demand; Secondly configuration SQL query statement, according to the SQL query statement initializes configuration information of configuration, by the acquisition of information of the list table involved by business module and field etc. out, the information now obtained is the initialized default configuration information of business module, comprises the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to; Finally the initializes configuration information generated is modified according to business demand.
Wherein the initializes configuration information generated is modified according to business demand and comprise: after configuration SQL query statement, generate initialized the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to; The list table information related to initialized according to business demand, Grid essential information, Grid column information, Form essential information, Form column information carry out detailed configuration.
In the process of business module configuration, need all configuration informations of business module to be saved in database.In the present invention, Mybatis Persistence Layer Framework is utilized to be saved in database with the form of allocation list by all configuration informations of business module.Mybatis Persistence Layer Framework is a Persistence Layer Framework based on Java, supports directly to write sql statement, and be kept in xml configuration file by sql statement, program directly reads, and can realize the business logic processing of any complexity.And prior art is by the configuration information of field write code, amendment is got up dumb, Mybatis Persistence Layer Framework is utilized to be configured the preservation of information in the present invention, make the accessible scope of business of business module broader, availability is higher, and the code legibility generated is good, can modify to code according to business demand after code building, and directly select configuration information corresponding to corresponding allocation list to modify, the difficulty of the business that amendment difficulty comparatively utilizes Hibernate process complicated reduces.
The concrete configuration process of business module is as described below:
According to the newly-increased module of business demand.The business module basic configuration information such as folder path at place after the bag path at place, foreground file generated after typing module title, block code, developer, background generate.Automatically generate the file name of foreground file and background according to the block code of typing, and business module basic configuration information is saved in the business module configuration master meter of database.
If need after Added Business module to modify to module information, corresponding module information record can be selected, carried out the amendment of module configuration information by modified module interface.
After Added Business module completes, detailed configuration is carried out to business module.Comprise the configuration of SQL query statement, relate to and show 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.
Business demand according to module arranges out query statement, and query statement content correspondence is entered into the select statement part at configuring service module interface in presentation layer, from statement part, where statement part, groupby statement part and orderby statement part etc., preserve after typing completes.In preservation process, development platform verifies query statement, whether verification query statement can correctly perform, as can not be correctly performed, then prompting is modified, if correctly perform, then the business module utilizing Mybatis to be saved in by query statement in database configures in the query SQL field in master meter.
Query statement is preserved successfully, carries out initialization to business module, generates following initializes configuration information:
I. wherein involved list table information is obtained out according to the business module query statement of configuration, as table name, table alias, and generate entity class name corresponding to single table, bag path that bag path that entity file is deposited, SqlMap file are deposited and the bag path that Mapper file is deposited, the value whether participating in persistence field of default setting list table simultaneously, finally utilizes Mybatis to relate in table allocation list using each single table relevant information as a record module be saved in database;
Ii. configure in master meter at the Grid of database and generate a record, default setting List name, Grid height, Grid width, every page of line number, whether single choice, the field information such as whether can to edit;
Iii. according to all field informations inquired about in query statement, a recorded information is generated for each field in the Grid row configuration information table of database, table belonging to the field name that during generation, automatic acquisition field is corresponding, field another name, field annotation, field, whether automatic identification field is major key, whether show according to recognition result write-back and whether can edit respective value, the type of automatic decision field, according to contents such as field type write-back display type, line editor parameter, combobox transcoding type;
Iv. configure in master meter at the Form of database and generate three records, corresponding three kinds of Form types, be respectively inquiry Form, newly-increased Form, amendment Form, every ranks number of default setting every bar record, whether show, the field information such as whether to generate;
V. according to all field informations inquired about in query statement, be the recorded information of inquiring about Form, newly-increased Form, amendment Form tri-class Form generates correspondence respectively in the Form configuration of database is shown in detail.Table belonging to the field name that during generation, automatic acquisition field is corresponding, field another name, field annotation, field, whether automatic identification field is major key, whether show according to recognition result intelligence write-back and whether can edit respective value, the type of automatic decision field, according to the content such as the automatic write-back display type of field type, foreground verification rule, foreground verification information, query type, combobox transcoding type.
After initialization process completes, initialization information is turned back in the corresponding lists of the operation interface of presentation layer, now can revise further initialization information in conjunction with business demand, persistence operation is not carried out as revised some single table, the height of Grid and width, whether Grid can edit, whether the row in Grid show, whether the row in Grid are combobox and corresponding transcoding type, in inquiry Form, those fields need display, the query type of field is inquired about in inquiry Form, and field verifies rule and verification information etc. in newly-increased Form and amendment Form.And utilize Mybatis Persistence Layer Framework to be saved in database by amended configuration information.The database used in the present invention can be such as MySQL (Relational DBMS) database.
Business module is being configured, and after configuration information is saved in database, is processing from step S13.
Step S13: according to described configuration information generating code file.
The generation of code is mainly carried out in the key-course of SpringMVC framework (controller controller).According to the configuration information generating code file preserved in a database, comprising: obtaining Code Template by calling Velocity template engine, described Code Template being combined with the configuration information of business module and generating foreground code file and backstage code file; By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
Wherein, Velocity template engine is a template engine based on java (templateengine).It allows anyone only to use simple template instruction (templatelanguage) to quote by the object of java code definition.In the present invention, use Velocity template engine, realize carrying out self-defined to predefined Code Template.Predefined Code Template is carried out self-definedly can be: by modifying to existing template, realize the business demand that amended Code Template meets exploitation more; In addition, existing template can also be copied, re-establish the template of oneself on its basis.
Development platform calls Velocity template engine, obtain Code Template, then the configuration information of business module is imported in Code Template, to replace corresponding attribute, thus realize configuration data to combine with Code Template, thus generate foreground code file and backstage code file.These files comprise following content: the main interface Main.jsp in foreground, the main interface Main.js in foreground, foreground increases interface A dd.jsp newly, foreground increases interface A dd.js newly, amendment interface, foreground Update.jsp, amendment interface, foreground Update.js, backstage Controller.java, backstage Service interface IService.java, backstage Service realizes class ServiceImpl.java, backstage DAO interface IDAO.java, backstage DAO realizes class DAOImpl.java, Batch Processing entity B usiEntity.java, Batch Processing sqlmap file sqlmap.xml.
MyBatisGenerator is file generated instrument, uses MyBatisGenerator file generated instrument to generate file content needed for MyBatis Persistence Layer Framework, comprises mapped file corresponding to the list table that relates in query SQL and entity file.
Development platform calls MyBatisGenerator file generated instrument, in conjunction with the configuration information in MyBatisGeneratorConfig.xml configuration file, the code file needed for MyBatis Persistence Layer Framework that all single tables of automatic generation are corresponding, comprises following content: Batch Processing sqlmap file sqlmap.xml, backstage single table public documents Entity.java and Mapper.xml.
Through the code building of this step, can realize generating according to the detailed configuration information of business module the foreground code file, backstage code file and the public persistence file of single table that highly meet business demand, developer does not need to carry out code revision more substantially, can realize the business demand of oneself.
The method of the Code automatic build of the embodiment of the present invention can also comprise: when business demand changes, and revises the corresponding configuration information of business module and preserve according to business demand; Select the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
Automatically after having generated code by development platform, if business personnel proposes demand and changes, changed content according to demand is only needed to re-start the configuration of business module, the configuration information of correspondence is adjusted to the content after meeting demand change, and the configuration information after changing is saved in database, then select to need the code file regenerated to carry out code and regenerate.Change for not relating to demand or carried out the code file revised, can not select, like this can the controllability that generates of code, prevent from not needing the code file changed to be capped.
When code regenerates, needing the file regenerated to carry out the process of real time workshop as previously mentioned according to the information reconfigured to selecting, repeating no more herein.
The method of the Code automatic build of the embodiment of the present invention can also comprise: when business module has been developed, when not needing carry out code building again and change, and locking service module.
If a business module has all been developed, do not need to carry out code building again, then can lock this business module record, can not modify again after locking, and configure, generating code, deletion action, prevent code be misused and be capped.
When carrying out module lock operation, in the block configuration table in write-back storehouse corresponding record whether lock field is "Yes".When operating this module record, development platform can according to whether lock field judges that this record is in the lock state, and directly prompting can not carry out associative operation again.
Method according to the Code automatic build of the embodiment of the present invention can be found out, in the process of web project development, in units of business module, by configuration SQL query statement, break through the restriction can only carrying out single table code generation in prior art, thus realize processing any service logic; By the detailed configuration to each field of business module, thus make that generation code is out maximized meets business demand; By utilizing Mybatis Persistence Layer Framework to carry out persistence to configuration information with the form of allocation list, thus the scope of business making it possible to process is broader, and availability is higher, and the code legibility generated is good, and amendment difficulty is low, facilitates the exploitation of project; By calling Velocity template engine generating code file, the height that code generates pattern can customize, thus can adapt to dissimilar business demand exploitation; By utilizing MyBatisGenerator file generated instrument to generate code file needed for MyBatis Persistence Layer Framework, thus can bonding table public documents unified and standard and the combination with MyBatis, realize operating the persistence of data; In addition, because the mode employing allocation list preserves the configuration information of business module, thus when carrying out code revision, corresponding allocation list directly can be selected to modify, and regenerates corresponding code, the controllability that code generates; After a certain business module has been developed, by lock out action, the locking to this business module can being realized, covering because being misused to prevent the code generated.
Fig. 2 is the schematic diagram of the main modular of the device of Code automatic build according to the embodiment of the present invention.
As shown in Figure 2, the device 20 of the Code automatic build of the embodiment of the present invention mainly comprises as lower module: configuration module 201, preservation module 202, code generation module 203.
Configuration module 201, for according to business demand Added Business module, and utilizes SQL query statement to configure described business module; Preserve module 202, for being saved in database by the configuration information of described business module; Code generation module 203, for according to described configuration information generating code file.
Configuration module 201 also for: according to SQL query statement generate initializes configuration information, described initializes configuration information comprises: the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to; According to business demand, initializes configuration information is modified.
Preserve module 202 also for: utilize Mybatis Persistence Layer Framework to be saved in database with the form of allocation list by all configuration informations of described business module.
Code generation module 203 also for: by call Velocity template engine obtain Code Template, described Code Template is combined with the configuration information of described business module and generates foreground code file and backstage code file; By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
Device 20 also for: when business demand changes, the corresponding configuration information of content modification that configuration module 201 changes according to business demand; Preserve module 202 and preserve amended configuration information; Code generation module 203 selects the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
Configuration module 201 also for: when described business module has been developed, when not needing to carry out again code building and change, lock described business module.
As can be seen from the above description, in the process of web project development, in units of business module, by configuration SQL query statement, break through the restriction can only carrying out single table code generation in prior art, thus realize processing any service logic; By the detailed configuration to each field of business module, thus make that generation code is out maximized meets business demand; By utilizing Mybatis Persistence Layer Framework to carry out persistence to configuration information with the form of allocation list, thus the scope of business making it possible to process is broader, and availability is higher, and the code legibility generated is good, and amendment difficulty is low, facilitates the exploitation of project; By calling Velocity template engine generating code file, the height that code generates pattern can customize, thus can adapt to dissimilar business demand exploitation; By utilizing MyBatisGenerator file generated instrument to generate code file needed for MyBatis Persistence Layer Framework, thus can bonding table public documents unified and standard and the combination with MyBatis, realize operating the persistence of data; In addition, because the mode employing allocation list preserves the configuration information of business module, thus when carrying out code revision, corresponding allocation list directly can be selected to modify, and regenerates corresponding code, the controllability that code generates; After a certain business module has been developed, by lock out action, the locking to this business module can being realized, covering because being misused to prevent the code generated.
Above-mentioned embodiment, does not form limiting the scope of the invention.It is to be understood that depend on designing requirement and other factors, various amendment, combination, sub-portfolio can be there is and substitute in those skilled in the art.Any amendment done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within scope.

Claims (12)

1. a method for Code automatic build, is characterized in that, comprising:
According to business demand Added Business module, and SQL query statement is utilized to configure described business module;
The configuration information of described business module is saved in database;
According to described configuration information generating code file.
2. method according to claim 1, is characterized in that, utilizes SQL query statement to configure described business module and comprises:
Generate initializes configuration information according to SQL query statement, described initializes configuration information comprises: the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to;
According to business demand, initializes configuration information is modified.
3. method according to claim 1, it is characterized in that, the configuration information of described business module is saved in database and comprises: utilize Mybatis Persistence Layer Framework to be saved in database with the form of allocation list by all configuration informations of described business module.
4. method according to claim 1, is characterized in that, comprises according to described configuration information generating code file:
Obtaining Code Template by calling Velocity template engine, described Code Template being combined with the configuration information of described business module and generating foreground code file and backstage code file;
By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
5. method according to claim 1, is characterized in that, described method also comprises:
When business demand changes, the corresponding configuration information of content modification changed according to business demand is also preserved;
Select the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
6. the method according to any one of claim 1-5, is characterized in that, described method also comprises:
When described business module has been developed, when not needing carry out code building again and change, lock described business module.
7. a device for Code automatic build, is characterized in that, comprising:
Configuration module, for according to business demand Added Business module, and utilizes SQL query statement to configure described business module;
Preserve module, for being saved in database by the configuration information of described business module;
Code generation module, for according to described configuration information generating code file.
8. device according to claim 7, is characterized in that, described configuration module also for:
Generate initializes configuration information according to SQL query statement, described initializes configuration information comprises: the list table information, Grid essential information, Grid column information, Form essential information, the Form column information that relate to;
According to business demand, initializes configuration information is modified.
9. device according to claim 7, is characterized in that, described preservation module also for: utilize Mybatis Persistence Layer Framework to be saved in database with the form of allocation list by all configuration informations of described business module.
10. device according to claim 7, is characterized in that, described code generation module also for:
Obtaining Code Template by calling Velocity template engine, described Code Template being combined with the configuration information of described business module and generating foreground code file and backstage code file;
By calling MyBatisGenerator file generated instrument, generate the code file needed for MyBatis Persistence Layer Framework.
11. devices according to claim 7, is characterized in that, described device also for:
When business demand changes, the corresponding configuration information of content modification that configuration module changes according to business demand;
Preserve module and preserve amended configuration information;
Code generation module selects the code file needing to regenerate according to amended configuration information, carry out code and regenerate.
12. devices according to any one of claim 7-11, is characterized in that, described configuration module also for:
When described business module has been developed, when not needing carry out code building again and change, lock described business module.
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 true CN105487864A (en) 2016-04-13
CN105487864B 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)

Cited By (29)

* 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
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN108153897A (en) * 2018-01-10 2018-06-12 中国银行股份有限公司 A kind of PLSQL program codes generation method and system
CN108920140A (en) * 2018-07-19 2018-11-30 河北中科恒运软件科技股份有限公司 Method of calibration is unified in a kind of front and back end
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
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information
CN110019146A (en) * 2018-06-26 2019-07-16 珠海宏桥高科技有限公司 A kind of implementation method and device of list table maintenance function
CN110162295A (en) * 2019-04-01 2019-08-23 贵州力创科技发展有限公司 A kind of quick development method and system
CN110247843A (en) * 2019-07-31 2019-09-17 浪潮软件股份有限公司 A kind of wechat public platform based customized service message method for pushing and system
CN110262790A (en) * 2019-07-04 2019-09-20 平安科技(深圳)有限公司 Component generation method, device, storage medium and terminal device
CN110489106A (en) * 2019-07-22 2019-11-22 北京字节跳动网络技术有限公司 A kind of generation method, device, medium and the electronic equipment of project initial code
CN110765152A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 SQL extraction method and 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
CN112181396A (en) * 2019-07-02 2021-01-05 北京京东尚科信息技术有限公司 RN code automatic generation system, method, device and medium
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
CN113485770A (en) * 2021-07-26 2021-10-08 挂号网(杭州)科技有限公司 Method and device for determining service configuration data, electronic equipment and storage medium
CN113608726A (en) * 2021-07-30 2021-11-05 三一专用汽车有限责任公司 Code generation method and 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
CN114489609A (en) * 2022-01-20 2022-05-13 上海金仕达软件科技有限公司 Service code automatic update method, device, storage medium and electronic device
CN114706565A (en) * 2022-03-24 2022-07-05 浪潮软件科技有限公司 A Simple and Efficient Code Generation Method
CN114756554A (en) * 2022-06-13 2022-07-15 中建电子商务有限责任公司 Data query processing method based on MyBatis framework
CN119045816A (en) * 2024-07-15 2024-11-29 广州三七极耀网络科技有限公司 Automatic page generation method, device, equipment and medium based on query SQL statement

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

Cited By (37)

* 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
CN107273116A (en) * 2017-05-22 2017-10-20 互联天下科技发展(深圳)有限公司 The method that code is produced using the Code Generator based on framework
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information
CN110019350B (en) * 2017-07-28 2021-06-29 北京京东尚科信息技术有限公司 Data query method and device based on configuration information
CN108153897A (en) * 2018-01-10 2018-06-12 中国银行股份有限公司 A kind of PLSQL program codes generation method and system
CN110019146A (en) * 2018-06-26 2019-07-16 珠海宏桥高科技有限公司 A kind of implementation method and device of list table maintenance function
CN108920140A (en) * 2018-07-19 2018-11-30 河北中科恒运软件科技股份有限公司 Method of calibration is unified in a kind of front and back end
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, device and medium
CN110262790B (en) * 2019-07-04 2024-05-07 平安科技(深圳)有限公司 Component generation method and device, storage medium and terminal equipment
CN110262790A (en) * 2019-07-04 2019-09-20 平安科技(深圳)有限公司 Component generation method, device, storage medium and terminal device
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
CN110765152A (en) * 2019-09-18 2020-02-07 平安科技(深圳)有限公司 SQL extraction method and 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
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
CN113608726A (en) * 2021-07-30 2021-11-05 三一专用汽车有限责任公司 Code generation method and device, 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
CN114489609A (en) * 2022-01-20 2022-05-13 上海金仕达软件科技有限公司 Service code automatic update method, device, storage medium and electronic device
CN114706565A (en) * 2022-03-24 2022-07-05 浪潮软件科技有限公司 A Simple and Efficient Code Generation Method
CN114756554A (en) * 2022-06-13 2022-07-15 中建电子商务有限责任公司 Data query processing method based on MyBatis framework
CN114756554B (en) * 2022-06-13 2022-09-30 中建电子商务有限责任公司 Data query processing method based on MyBatis framework
CN119045816A (en) * 2024-07-15 2024-11-29 广州三七极耀网络科技有限公司 Automatic page generation method, device, equipment and medium based on query SQL statement

Also Published As

Publication number Publication date
CN105487864B (en) 2019-06-04

Similar Documents

Publication Publication Date Title
CN105487864A (en) Method and device for automatically generating code
CN114035773B (en) Configuration-based low-code form development method, system and device
CN102779040B (en) A kind of method and apparatus generating customizing form
CN106528129B (en) A kind of Web application interface generation system and method
CN110825362A (en) Low-code application software development system and method
CN106371825B (en) A kind of mobile terminal application interface list dynamic creation method and device
CN105511873B (en) User interface control display method and device
CN109358851A (en) Creation method, device and the computer readable storage medium of chart components
CN110069246A (en) The plateform system and its application that a kind of Java Web application is quickly developed
US8307015B2 (en) Decorated model architecture for efficient model-driven application development
CN102207872A (en) Method and system for customizing Web UI (User Interface) control according to user requirements
CN109766097A (en) UI generation method, device, electronic equipment and computer readable storage medium
CN104111826A (en) Software project development method and device
CN102968306A (en) Method and system for automatically generating code based on data model drive
CN106293664A (en) Code generating method and device
US10448227B2 (en) Mobile database access application development system and method
CN106648587A (en) Annotation-based Web application code generation method
CN104346149A (en) Descriptive framework used for data visualization
CN103268227A (en) Method for rapidly developing BI platform based on EXTJS
CN103914290A (en) Operating command processing method and device
CN111476007B (en) Table generation method, table generation device, computer device and computer-readable storage medium
CN110738038A (en) Contract text generation method, device, equipment and computer readable storage medium
CN115358204A (en) Report generation method and device, electronic equipment and storage medium
CN105404692A (en) Web page generation method and generation device
CN107294750A (en) A kind of distribution configuring management method and device for converging group energy self-identifying

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