Mybatis code generation method, apparatus, and computer terminal

A computer terminal and code generation technology, applied in the field of Java development, can solve problems such as low work efficiency of developers, increase code compilation failure, code irregularity, etc., to improve standardization and uniformity, avoid duplication of work, and improve success rate. Effect

Inactive Publication Date: 2019-03-15
BEIJING QDING INTERCONNECTION TECHNOLOGY CO LTD
View PDF4 Cites 13 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

If there are 10 tables in the database of a project, then according to the three-tier structure of the Java development framework, at least 50 classes need to be written, and each class has different methods. In another project, it is also necessary to write the same function Multiple classes and methods cause developers to repeatedly write code with the same function in different projects, resulting in low work efficiency for developers; and due to the different programming styles of different developers, the code developed by the same project is not standardized , not uniform, increasing the probability of code compilation failure

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
  • Mybatis code generation method, apparatus, and computer terminal
  • Mybatis code generation method, apparatus, and computer terminal
  • Mybatis code generation method, apparatus, and computer terminal

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0056] figure 1 It shows a schematic flowchart of a Mybatis code generation method provided by the embodiment of the present invention. The Mybatis code generation method is applied to the Java development framework.

[0057] Such as figure 1 As shown in FIG. 2 , it is a schematic structural diagram of the interaction between a Java development framework and a database provided by an embodiment of the present invention. The Java development framework 10 is divided into a presentation layer 11, a business logic layer 12, a data access layer 13 and a Mybatis SQL layer.

[0058] The presentation layer 11 shown is generally used to process and control data requests and page jumps.

[0059] Described business logic layer 12 is used for generating Service code, and described Service code comprises business interface class (such as IXX Service class, and wherein, XX can be the title of different business) and business service class (such as XX Service class, and wherein, XX can be...

Embodiment 2

[0235] Figure 12 A schematic structural diagram of a Mybatis code generation device provided by an embodiment of the present invention is shown. The Mybatis code generation device 100 is applied in a Java development framework.

[0236] The Mybatis code generation device 100 includes a conversion module 110 , a determination module 120 , an acquisition module 130 and a generation module 140 .

[0237] The conversion module 110 is used to obtain the summary information of the table in the database and the field information of each field in the table, and convert the summary information and the field information into the entity information of the Java specification, wherein the entity information includes The variable of the Bean object and the method name of the Bean object.

[0238] The determination module 120 is configured to determine the attribute value corresponding to the entity information according to the preset correspondence table.

[0239] The acquisition module...

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 Mybatis code generation method, apparatus, and computer terminal, The method comprises the following steps: acquiring summary information of a table in a database and field information of each field in the table, and converting the summary information and field information into entity information of a Java specification, wherein, the entity information comprises variablesof a Bean object and method names of the Bean object; Determining attribute values corresponding to the entity information according to a preset correspondence relation table; Gets the SQL statementfor the predetermined method; A corresponding Mybatis code is generated according to the attribute value and the SQL statement of the predetermined method. The technical proposal of the invention utilizes database information to automatically and quickly generate Mybatis code of a predetermined method, avoids developers from writing repetitive work of the same code in each project, and improves developers' work efficiency and code uniformity.

Description

technical field [0001] The present invention relates to the technical field of Java development, in particular to a Mybatis code generation method, device and computer terminal. Background technique [0002] With the rapid development of the IT (Internet Technology, Internet Technology) industry, the work of developers is becoming more and more important, and writing codes takes up most of the time of developers. [0003] Among the existing computer programming languages, the Java language, as a representative of static object-oriented programming languages, perfectly implements the object-oriented theory, allowing programmers to perform complex programming in an elegant way of thinking, and is widely used. [0004] In the existing Java development framework, it usually includes the presentation layer, business logic layer and data access layer. If a project uses the Mybatis plug-in, developers need to write both SQL code and Java code when operating a table. Code, in the t...

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/30G06F8/36G06F8/41
CPCG06F8/315G06F8/36G06F8/447
Inventor 彭敏
Owner BEIJING QDING INTERCONNECTION TECHNOLOGY CO LTD
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