Automatic code generation method based on entity annotation

An automatic code and annotation technology, applied in the computer field, can solve problems such as time-consuming, high repetition, and low technical content

Pending Publication Date: 2021-05-18
四川天翼网络股份有限公司
View PDF5 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This type of development has the following characteristics: simple business, low technical content; high repetition; heavy coding workload and long time-consuming
[0003] With the application of ORM technology, the industry also has some automatic code generation for this type of CURD, which can automatically generate ORM-based entity mapping, data entities, data access, business logic, and interface display layer codes to help developers simplify the development process. Reduce the development workload, but most of the solutions have the following problems: the automatically generated code is biased towards the background service code, and the front-end code is too simple; different input controls cannot be generated according to the type of data field, such as a date type field, and the date is automatically generated Class control code; cannot automatically generate the text display and input interface of foreign key entities according to the foreign key relationship designed by the database; cannot automatically generate forms of different styles according to the characteristics of entity information, for example, for complex forms, multi-column display may be required , partition display, etc.

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
  • Automatic code generation method based on entity annotation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0018] The present invention will be further described below in conjunction with the accompanying drawings.

[0019] Such as figure 1 As shown, an automatic code generation method based on entity annotations includes the following steps:

[0020] Step 1: Define the entity relationship model, write the entity class code and its annotations;

[0021] Step 2: Read all classes, fields and annotation information of the specified entity class, and generate data tables and fields in the target database;

[0022] Step 3: Generate server-side entity mapping, data access, business logic, and interface control layer codes according to the basic information of classes and fields;

[0023] Step 4: Generate front-end code;

[0024] Step 5: Run effect detection.

[0025] The step 4 specifically includes the following sub-steps:

[0026] Step 41: Select the corresponding style template according to the class annotation;

[0027] Step 42: Generate an entity class list page according to t...

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 an automatic code generation method based on entity annotation, which comprises the following steps of: 1, defining an entity relationship model, and compiling entity class codes and annotations thereof; 2, reading all classes, fields and annotation information of a specified entity class, and generating a data table and fields in a target database; 3, generating server entity mapping, data access, business logic and interface control layer codes according to the basic information of classes and fields; 4, generating a front-end code; and 5, detecting the operation effect. The method has the beneficial effects that a corresponding input control and check codes are automatically generated according to the field type, and common field types such as dates, numbers, enumeration and file types are supported; foreign key field list display is supported, and form foreign key field single-selection and multi-selection input and display are supported; according to entity class metadata information, field grouping and personalized sorting are supported, and automatic generation of simple and complex class form codes is supported.

Description

technical field [0001] The invention relates to the field of computers, in particular to an automatic code generation method based on entity annotation. Background technique [0002] The development of MIS (Management Information System) management information system and industry applications involves a large number of basic operation functions of adding, deleting, modifying and checking information (CURD for short), especially for some form-based information systems. To more than 50% of the entire project development workload. This type of development has the following characteristics: simple business, low technical content; high repetition; heavy coding workload and time-consuming. [0003] With the application of ORM technology, the industry also has some automatic code generation for this type of CURD, which can automatically generate entity mapping, data entity, data access, business logic and interface display layer code based on ORM technology to help developers simp...

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
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/38G06F8/33G06F8/73
CPCG06F8/38G06F8/33G06F8/73
Inventor 苟林
Owner 四川天翼网络股份有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products