Supercharge Your Innovation With Domain-Expert AI Agents!

Method and system for automatically generating engineering front-end codes based on JDBC

An automatic generation and engineering technology, applied in the direction of creating/generating source code, etc., can solve problems such as communication errors, waste of human resources, inability to adapt to the front-end framework, etc., to facilitate page addition, reduce repetitive work, and facilitate style management Effect

Pending Publication Date: 2020-05-22
DAWNING INFORMATION IND BEIJING
View PDF7 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] At present, more and more projects have begun to implement the method of separating the front and back ends. By using the interface to call and query the interactive data, MyBatis reverse engineering has appeared on the back end to automatically generate the back-end code. However, the front-end is still writing pages repeatedly according to the interface. Adding a table once and adding a new function requires rewriting all the basic additions, deletions, modification and query pages, which greatly wastes human resources
[0003] Through the above-mentioned traditional technologies in the actual project development process, after the database design is completed, a large number of developers are required to implement the front-end pages. There are a large number of repetitive pages and functions, and some of them may only store different data and corresponding table structures. However, the development Personnel must write the front-end page separately for each table structure and implement it in the background. It is very easy to cause bug pages due to communication errors
Moreover, in the large-scale development process, a unified template cannot be formed, which makes it difficult to unify the style and maintain later
However, the front-end did not have a perfect framework for design before, and it was impossible to generate templates through the estimated pages of the design; that is, MyBatis reverse engineering and other back-end code generation technologies. Although the back-end uses spring to unify the basic business logic, it cannot adapt to different front-end framework

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for automatically generating engineering front-end codes based on JDBC
  • Method and system for automatically generating engineering front-end codes based on JDBC
  • Method and system for automatically generating engineering front-end codes based on JDBC

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0050] Such as Figure 1-2 As shown, a method for automatically generating engineering front-end code based on JDBC, including using JDBC to obtain the database table structure;

[0051] Perform data conversion on the obtained database table structure according to preset rules, and generate Java objects;

[0052] Build Freemarker templates;

[0053] Correspondingly input each parameter in the Java object into the Freemarker template to generate the front-end code.

[0054] The inventive method mainly uses and utilizes the JDBC (Java Database Connectivity, Java Database Connectivity, JDBC for short) interface provided by each database manufacturer, uses Java to read the database configuration information, and generates the front-end engineering code according to the Freemarker template of design, and removes the repetitive labor of developers , saving development costs; and using templates to generate pages can unify project codes and facilitate later maintenance and manageme...

Embodiment 2

[0084] On the other hand, the present invention also provides a system for implementing the above method, such as image 3 shown, including:

[0085] JDBC module, used to obtain the database table structure;

[0086] The data conversion module is used to perform data conversion on the obtained database table structure according to preset rules, and generate Java objects;

[0087] Freemarker configuration module for building Freemarker templates;

[0088] A code generation module is used for correspondingly inputting each parameter in the Java object into the Freemarker template to generate the front-end code.

[0089] Specifically, in the process of obtaining the database table structure, the JDBC module uses JDBC as the interface basis, performs corresponding configurations according to databases in different environments, and then reads the database table structure through a Java program.

[0090] The table structure data obtained by the JDBC module is transmitted to the ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for automatically generating an engineering front-end code based on JDBC, and the method is characterized in that the method comprises the steps: obtaining a databasetable structure through the JDBC; performing data conversion on the obtained data table structure according to a preset rule to generate a Java object; constructing a Freemarker template; correspondingly inputting each parameter in the Java object into the Freemarker template to generate a front-end code. According to the method disclosed by the invention, the database is read, and the obtained field generates a target code through the Freemarker template, so that the repetitive work of front-end development is reduced; when a new table is added, a front-end code can be automatically generatedby directly running a template program, so that a front-end developer can add a page conveniently; by means of the template generation mode, front-end basic functions can be unified, style managementis facilitated, direct generation of basic test files is facilitated, and test pressure is relieved. The invention also provides a system for realizing the method.

Description

technical field [0001] The invention relates to the technical field of front-end development, specifically, a method and system for automatically generating engineering front-end codes based on JDBC. Background technique [0002] At present, more and more projects have begun to implement the method of separating the front and back ends. By using the interface to call and query the interactive data, MyBatis reverse engineering has appeared on the back end to automatically generate the back-end code. However, the front-end is still writing pages repeatedly according to the interface. Adding a table once and adding a new function requires rewriting all the basic additions, deletions, modifications and query pages, which greatly wastes human resources. [0003] Through the above-mentioned traditional technologies in the actual project development process, after the database design is completed, a large number of developers are required to implement the front-end pages. There are...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/30
CPCG06F8/30
Inventor 张瑜张晋锋张丹丹张永生李斌
Owner DAWNING INFORMATION IND BEIJING
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More