Simplified one-to-many association table adding, deleting, modifying and checking method under Java program

By designing a simplified method of adding and deletion and checking methods under a multi -association table under the Java program, it solves the duplicate and management problems of associated table operations in the Java program development, realizes the simplification and unity of code, improves development efficiency and readability. Essence

CN119377223AActive Publication Date: 2025-01-28CHENGDU FANGLIAN CLOUD CODE TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411530843.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-01-28
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

In Java program development, the addition, deletion, modification and search operations of the associated table require a lot of repeated writing of code logic and SQL, resulting in cumbersome and high repetition. Different people have different code habits, which increases communication costs and makes it difficult to manage public logic uniformly.

Method used

Design a method of simplifying a pair of multi -associated tables, deletion, deletion and modification inspections under a Java program. By defining public fields and business fields, using annotation mapping entity fields and associated table fields to define basic and business physical categories, database access layer interfaces and database access layer interfaces and database interfaces and database interfaces and database access layers and interfaces The associated table operation interface can be achieved to achieve a unified addition, deletion, change logic.

Benefits of technology

Reduce the definition of duplicate methods in the associated table function and SQL writing, shorten the research and development time, save development costs, improve code readability and versatility, and facilitate subsequent unified modification and logical iteration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119377223A_ABST
    Figure CN119377223A_ABST
Patent Text Reader

Abstract

The invention discloses a simplified one-to-many association table adding, deleting, modifying and checking method under a Java program. The method comprises the steps that S1, an association table is designed; s2, defining a basic entity class; s3, defining a service entity class; s4, defining a basic database access layer interface; s5, defining an association table database access interface; s6, defining an association table operation interface; and S7, adding an addition, deletion, modification and check method of the association table in the association table operation interface, and completing logic codes by using Java. According to the method, the repeated method definition and SQL writing work in the association table function in the Java service development process are reduced, the research and development time is shortened, and the development cost is saved; unified definition is achieved, code readability is higher, subsequent unified modification and logic iteration are facilitated, and the universality and reusability of the association table are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of one-to-many association tables, and in particular to a method for simplifying the addition, deletion, modification and query of one-to-many association tables under a Java program. Background Art

[0002] At present, in the process of Java program development, there are a large number of operations related to adding, deleting, modifying and checking related tables based on the main table. The addition, deletion, modification and query of related tables need to be written separately with code logic and corresponding SQL. Most operations of related tables have some common logic, so the whole process is cumbersome and repetitive. Different people have different code writing habits, so the naming of the methods for adding, deleting, modifying and checking related tables may also be different. When R&D personnel use the corresponding methods in docking, the communication cost will increase, resulting in the difficulty of unified processing of some common logic at the overall project architecture level. Summary of the invention

[0003] The purpose of the present invention is to provide a method for simplifying the addition, deletion, modification and query of one-to-many association tables in a Java program in response to the above technical problems.

[0004] A method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program includes the following sub-steps: S1: Design the association table: define the common fields and business fields of the association table, and check whether the field names are consistent; S2: Define the base entity class: map the entity class fields to the associated table fields through annotations, and use the base entity class as the parent class of the business entity class; S3: Define business entity classes: use annotations to indicate the corresponding table names and fields, and inherit the base entity class; S4: Define the basic database access layer interface: use generic features to support different data entity classes; S5: Define the database access interface of the association table: inherit the basic database access layer interface, obtain the basic operation method, and expand it according to the characteristics of the association table; S6: define the association table operation interface: obtain the main table field name and database access interface of the association table; S7: Add the methods of adding, deleting, modifying and checking the association table in the association table operation interface, and use Java to complete the logic code.

[0005] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S1 includes the following sub-steps: S11: extracting common fields and fields required by business requirements in the intercom table design; The common fields and fields required by business requirements include but are not limited to logical deletion identification, creation, modification, deletion time, and operator information; S12: Unify the names of the extracted fields in the associated table and check whether the common field names are consistent: If the common field names are inconsistent, redefine the common field names; If they match, continue.

[0006] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S2 includes the following sub-steps: S41: All business Mapper layer interfaces inherit the basic database access layer interface, and specify the generic object as the main operation data entity class of the basic database access layer interface; S42: Obtain the tables and fields of the operation according to the annotation mapping, and generate the corresponding database operation SQL.

[0007] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table under a Java program, wherein the database operation SQ includes adding, deleting, modifying and querying data.

[0008] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S7 includes the following sub-steps: S71: Obtain a database access interface to obtain the table name and common fields of the associated table; S72: Return the field names of the main table, and assemble the SQL statements for adding, deleting, modifying, and querying the associated tables based on the main table.

[0009] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein the operation interface of the association table is the core interface of the association table operation, and all repeated additions, deletions, modifications and queries of the association table are performed in the operation interface of the association table; The repeated addition, deletion, modification and query of the association table includes but is not limited to querying the association table list data according to the main table association fields, and deleting the association table data according to the main table association fields.

[0010] The beneficial effects of the present invention are as follows: through a method for simplifying the addition, deletion, modification and query of one-to-many association tables under a Java program, the problem of repeated coding of a large amount of logic of association tables and the lack of unified management of repeated methods of some association tables in Java program development is solved; the repeated method definition and SQL writing work in the association table function in the Java business development process are reduced, the research and development time is shortened and the development cost is saved; the unified definition makes the code more readable, facilitates subsequent unified modification and logic iteration, and improves the versatility and reusability of the association table. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 The present invention is a flowchart of a method for simplifying the addition, deletion, modification and query of one-to-many association tables in a Java program. DETAILED DESCRIPTION

[0012] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described with reference to the accompanying drawings.

[0013] As attached Figure 1 As shown, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program includes the following sub-steps: S1: Design the association table: define the common fields and business fields of the association table, and check whether the field names are consistent; S2: Define the base entity class: map the entity class fields to the associated table fields through annotations, and use the base entity class as the parent class of the business entity class; The S2 step is to reduce code duplication and facilitate business logic processing; S3: Define business entity classes: use annotations to indicate the corresponding table names and fields, and inherit the base entity class; The S3 step is used to subsequently parse the tables and fields corresponding to the business entity class; S4: Define the basic database access layer interface: use generic features to support different data entity classes; S5: Define the database access interface of the association table: inherit the basic database access layer interface, obtain the basic operation method, and expand it according to the characteristics of the association table; S6: define the association table operation interface: obtain the main table field name and database access interface of the association table; The step S6 is for subsequent association table operation; S7: Add the methods of adding, deleting, modifying and checking the association table in the association table operation interface, and use Java to complete the logic code.

[0014] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S1 includes the following sub-steps: S11: extracting common fields and fields required by business requirements in the intercom table design; The common fields and fields required by business requirements include but are not limited to logical deletion identification, creation, modification, deletion time, and operator information; S12: Unify the names of the extracted fields in the associated table and check whether the common field names are consistent: If the common field names are inconsistent, redefine the common field names; If they match, continue.

[0015] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S2 includes the following sub-steps: S41: All business Mapper layer interfaces inherit the basic database access layer interface, and specify the generic object as the main operation data entity class of the basic database access layer interface; S42: Obtain the tables and fields of the operation according to the annotation mapping, and generate the corresponding database operation SQL.

[0016] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table under a Java program, wherein the database operation SQ includes adding, deleting, modifying and querying data.

[0017] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein step S7 includes the following sub-steps: S71: Obtain a database access interface to obtain the table name and common fields of the associated table; S72: Return the field names of the main table, and assemble the SQL statements for adding, deleting, modifying, and querying the associated tables based on the main table.

[0018] Furthermore, a method for simplifying the addition, deletion, modification and query of a one-to-many association table in a Java program, wherein the operation interface of the association table is the core interface of the association table operation, and all repeated additions, deletions, modifications and queries of the association table are performed in the operation interface of the association table; The repeated addition, deletion, modification and query of the association table includes but is not limited to querying the association table list data according to the main table association fields, and deleting the association table data according to the main table association fields.

[0019] This solution uses a method for simplifying the addition, deletion, modification and query of one-to-many association tables in a Java program to solve the problem of repeated coding of a large amount of logic for association tables in Java program development and the lack of unified management of repeated methods for some association tables; it reduces repeated method definitions and SQL writing work in association table functions during Java business development, shortens R&D time and saves development costs; unified definitions make code more readable, facilitate subsequent unified modification and logic iteration, and improve the versatility and reusability of association tables.

[0020] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. A method for simplifying the addition, deletion, modification and query of one-to-many association tables in a Java program, characterized in that: It includes the following sub-steps: S1: Design the association table: define the common fields and business fields of the association table, and check whether the field names are consistent; S2: Define the base entity class: map the entity class fields to the associated table fields through annotations, and use the base entity class as the parent class of the business entity class; S3: Define business entity classes: use annotations to indicate the corresponding table names and fields, and inherit the base entity class; S4: Define the basic database access layer interface: use generic features to support different data entity classes; S5: Define the database access interface of the association table: inherit the basic database access layer interface, obtain the basic operation method, and expand it according to the characteristics of the association table; S6: define the association table operation interface: obtain the main table field name and database access interface of the association table; S7: Add the methods of adding, deleting, modifying and checking the association table in the association table operation interface, and use Java to complete the logic code.

2. The method for simplifying one-to-many association table addition, deletion, modification and query in a Java program according to claim 1, characterized in that: The step S1 comprises the following sub-steps: S11: extracting common fields and fields required by business requirements in the intercom table design; The common fields and fields required by business requirements include but are not limited to logical deletion identification, creation, modification, deletion time, and operator information; S12: Unify the names of the extracted fields in the associated table and check whether the common field names are consistent: If the common field names are inconsistent, redefine the common field names; If they match, continue.

3. The method for simplifying one-to-many association table addition, deletion, modification and query in a Java program according to claim 1, characterized in that: The step S2 comprises the following sub-steps: S41: All business Mapper layer interfaces inherit the basic database access layer interface, and specify the generic object as the main operation data entity class of the basic database access layer interface; S42: Obtain the tables and fields of the operation according to the annotation mapping, and generate the corresponding database operation SQL.

4. The method for simplifying one-to-many association table addition, deletion, modification and query in a Java program according to claim 1, characterized in that: The database operation SQ includes adding, deleting, modifying and checking data.

5. The method for simplifying one-to-many association table addition, deletion, modification and query in a Java program according to claim 1, characterized in that: The step S7 comprises the following sub-steps: S71: Obtain a database access interface to obtain the table name and common fields of the associated table; S72: Return the field names of the main table, and assemble the SQL statements for adding, deleting, modifying, and querying the associated tables based on the main table.

6. The method for simplifying one-to-many association table addition, deletion, modification and query in a Java program according to claim 1, characterized in that: The operation interface of the association table is the core interface of the association table operation. All repeated additions, deletions, modifications and queries of the association table are performed in the operation interface of the association table. The repeated addition, deletion, modification and query of the association table includes but is not limited to querying the association table list data according to the main table association fields, and deleting the association table data according to the main table association fields.

Citation Information

Patent Citations

  • Implementation method for autonomously creating file system based on multi-table association

    CN105447122A

  • Data updating method and device based on relational database, product and medium

    CN111221918A

  • Method and device for generating addition, deletion, modification and query application program interface, and storage medium

    CN112711405A

  • Model-driven database application implementation method

    CN116955313A

  • Administrative unit and accounting unit mapping association method, equipment and medium

    CN118093694A