Relational database based generation method of J2EE code

A code generation and database technology, which is applied in the direction of electrical digital data processing, special data processing applications, instruments, etc., can solve problems such as cumbersome program code maintenance, and achieve the effects of shortening development time, improving work efficiency, and reducing development costs

Active Publication Date: 2010-04-21
0 Cites 33 Cited by

AI-Extracted Technical Summary

Problems solved by technology

In the process of software development and maintenance, there are a large number of basic data object maintenance in any information system, most of which are simple maintenance functions, and the business logic is not complicated. However, due to the large number of basic data objects, even if the same and similar modules are copied, Pasting also requires a lot of work to complete...
View more


The invention discloses a relational database based generation method of J2EE codes, comprising the following steps: 1. object code template definition setting: defining an invariable code as a template and a variable code as a macro according to an existing frame; 2. external data acquisition: acquiring a relational database list structure parameter, database object annotation information, a structuralized query command, a code generation configuration parameter and an operating system parameter; 3. logic operation: obtaining the macro related to an object code through logic operation according to the acquired parameters; and 4. code generation: applying the macro to the code template to generate the object code of an MVC three-layer frame. The invention realizes an integral technical proposal to generate the J2EE codes on the basis of the relational database, guided by a two to eight principle of J2EE software development and according to a two to eight principle of the Barrett law that 80 percent of a total result is formed by 20 percent of total consumed time.

Application Domain

Special data processing applicationsSpecific program execution arrangements

Technology Topic

Software developmentDatabase object +8


  • Relational database based generation method of J2EE code
  • Relational database based generation method of J2EE code
  • Relational database based generation method of J2EE code


  • Experimental program(1)

Example Embodiment

[0026] The J2EE code generation method based on relational database of the present invention is characterized in that it comprises the following steps:
[0027] The first step is to set the target code template definition steps:
[0028] According to the existing framework, the unchanging code is defined as a template, and the variable code is defined as a macro;
[0029] That is: First, the J2EE architect designs the logical architecture for the entire project, configures the target code template according to the requirements of the engineering design logical architecture, defines the variable part of the target code as a macro, and writes the unchanging part directly in the template.
[0030] The second step, external data acquisition steps:
[0031] Obtain relational database table structure parameters, database object annotation information, structured query commands, code generation configuration parameters, and operating system parameters;
[0032] Namely: the database engineer designs the database object structure, and adds notes to all tables and columns; after starting the application haivDb4J2ee, the application connects to the database according to the last successful connection configuration; or the user manually adds various database connections by inputting parameters; The application automatically reads the table space, database object name, and object comment of the database, and displays these contents in front of the user in the form of a two-dimensional table; the programmer can use this tool to easily edit the comment of the database object, or Enter the corresponding command in the SQL statement input area to complete the interaction with the database. The user opens a table and displays the column name, column type, column comment, and other attributes. The user enters a structured query command in the SQL statement input area or selects an object in the database object list to enter the J2EE generation wizard. The data in this step is all obtained from the database, and no additional input from the user is required.
[0033] The third step, logical operation steps:
[0034] From the acquired parameters, a macro related to the target code is obtained through logical operations;
[0035] Namely: Generate the default Java object default settings according to the structured query command input by the user or the database object structure, automatically split the module name and submodule name according to the table name, generate the java class name and configuration path that conform to the Hungarian nomenclature according to the table name, Generate each member variable name in the class according to the field name in the table, generate the member variable type according to the field type, generate the class comment according to the table comment, generate the member variable comment according to the column comment, generate the document comment according to the system time, and complete the goal according to the operating system login name Code signing; basically, this series of operations can be completed according to the default rules without user intervention. In the process of completing these tasks, the user can manually adjust the unreasonable points found, and the tool will follow the specified settings according to these settings Method to calculate the macro value required by the target code.
[0036] The fourth step, the code generation step: apply the macro to the code template to generate the target code of the MVC three-tier architecture;
[0037] That is: the user selects the template used by the target code; the system combines the macro generated in the previous step with the template to generate the target code; the user selects the path where the target code is saved, and outputs the target code to the specified path. The generated files include hibernate Configuration files, struts configuration files, spring configuration files, MVC three-tier Java classes, three-tier Java packages, JSP additions, deletions, and changes to check files, and at the same time output generated logs, file lists and instructions for use; after generating the target code, the programmer puts the files and files The folder and the entire java package are copied and pasted into the project to realize the addition, deletion, modification, and checking function of a table, and then the development of a module can be completed by modifying and perfecting the logic part.


no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Automatic device for welding and detecting lithium battery

ActiveCN103904367AShorten the running distanceImprove work efficiency

Vacuum cleaner

InactiveCN103356140Aprevent liftingImprove work efficiency

Classification and recommendation of technical efficacy words

  • shorten development time
  • Improve work efficiency

Cooperation service platform facing different source data

InactiveCN101174957AImprove management level and qualityImprove work efficiency

Screw drilling tool, vertical drilling tool testing method and well inclination simulation testing equipment

InactiveCN111594144AReduced height requirementsImprove work efficiency

Method for intelligent automatic identification of transmission circuit parts


Keyboard spill-proofing mechanism

ActiveUS7030330B2minimize manufacturing costimprove work efficiency
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