CN115687317B - Method for realizing Java-end-based multi-way tree object adding, deleting and checking service - Google Patents

Method for realizing Java-end-based multi-way tree object adding, deleting and checking service Download PDF

Info

Publication number
CN115687317B
CN115687317B CN202211292262.0A CN202211292262A CN115687317B CN 115687317 B CN115687317 B CN 115687317B CN 202211292262 A CN202211292262 A CN 202211292262A CN 115687317 B CN115687317 B CN 115687317B
Authority
CN
China
Prior art keywords
sub
service
tables
deleting
compound
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211292262.0A
Other languages
Chinese (zh)
Other versions
CN115687317A (en
Inventor
殷洪沛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Upstream Software Co ltd
Original Assignee
Nanjing Upstream Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Upstream Software Co ltd filed Critical Nanjing Upstream Software Co ltd
Priority to CN202211292262.0A priority Critical patent/CN115687317B/en
Publication of CN115687317A publication Critical patent/CN115687317A/en
Application granted granted Critical
Publication of CN115687317B publication Critical patent/CN115687317B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a method for realizing a Java-end-based multi-tree object adding, deleting and checking service, which comprises the following steps: determining a main table and a plurality of sub-tables according to the external key relation, and establishing a plurality of groups of main sub-tables with one-to-many relation so as to form a multi-fork tree object; the multi-way tree object is a recursively multi-layer main and sub table structure, a plurality of sub tables are built from a main table, the sub tables are non-final sub tables or single tables, the non-final nodes continue to build sub tables of the next stage, and a plurality of compound tables are built according to the foreign key relation of the one-to-many main sub tables; constructing an adding, deleting and checking service interface of the compound table and realizing the adding, deleting and checking service of the compound table by finding the compound table corresponding to the multi-way tree object; according to the initial design file of the multi-tree object, and various Java files and codes related to the multi-tree object, the adding, deleting and checking service of the multi-tree object are automatically generated at the Java end, the workload of developers can be greatly reduced, and the procedural service logic control advantage of the Java end can be fully exerted.

Description

Method for realizing Java-end-based multi-way tree object adding, deleting and checking service
Technical Field
The invention relates to the technical field of Java software development, in particular to a method for realizing a Java-end-based multi-tree object adding, deleting and checking service.
Background
At present, operations such as adding, deleting, modifying and searching of the multi-way tree object are mainly realized by using a multi-table joint query mode of SQL sentences at a database end. This approach has the following problems and disadvantages:
(1) Only the query operation reflects the operation of a plurality of single tables in the multi-way tree object, and the addition, deletion and modification can only operate one single table generally, and cannot operate a plurality of single tables at the same time.
(2) The corresponding business logic is concentrated on the database end of the bottom layer, and the SQL statement mode is non-procedural, so that the procedural business logic control advantage of the Java end is difficult to develop.
(3) Each result of the bottom database operation needs to establish a Java class corresponding to the Java class at the Java end, and the workload of code development at the Java end is greatly increased due to the structural complexity of the multi-tree object and the diversity of operation results, the difficulty of system debugging and modification is increased, and the advantages of layered design development at the Java end are greatly reduced.
(4) Because SQL sentences are set-oriented operation and the multi-tree object is a recursively multi-layer main sub-table structure, the two structures are different, so that the conventional adding, deleting and modifying service codes of the multi-tree object are difficult to automatically generate in a template engine mode.
Disclosure of Invention
The invention aims to: in order to overcome the defects of the prior art, the invention provides a method for realizing the Java-end-based multi-tree object adding, deleting and checking service, which solves the problems of large workload and poor flexibility of adding, deleting and checking the multi-tree object in system development, modification and maintenance.
The technical scheme is as follows: the invention provides a method for realizing a Java-end-based multi-tree object adding, deleting and modifying service, which comprises the following steps:
s1, setting a single table object and an external key of a database end, wherein a persistent layer frame of the database end adopts MyBatis;
s2, determining a main table and a plurality of sub-tables according to the foreign key relation, and establishing a plurality of groups of main sub-tables with one-to-many relation so as to form a multi-fork tree object; the multi-tree object is in a recursion multi-layer main sub-table structure, wherein a main table exists, a plurality of sub-tables are built according to the main table, the sub-tables are non-final sub-tables or single tables, and the non-final nodes continue to build sub-tables of the next stage until the sub-tables are all single tables;
s3, constructing a plurality of compound tables according to the external key relation of the main sub-table with the one-to-many relation, and inserting the compound tables into corresponding positions, wherein the compound tables integrate attribute variables of the plurality of tables with the external key relation into one table, and the compound tables are all non-final sub-tables;
S4, expressing the obtained multiple composite tables at a Java end;
s5, constructing an adding, deleting and checking service interface and implementation of the compound table according to the external key relation, and further constructing adding, deleting and checking service of the compound table corresponding to the multi-tree object.
Further, the method comprises the steps of:
the attribute variable of the composite table comprises two parts, wherein one part is a non-array variable, and elements of the non-array variable inherit attribute fields in the main table object; the other part is an array variable, and the elements of the array variable are sub-table objects; the elements of the non-array variable and the array variable form a one-to-many main sub-table relationship.
Further, the method comprises the steps of:
if a one-to-many main sub-table external key exists between the current main table and other compound tables, a current compound table is constructed at the Java end, and the other compound tables are used as array variables of the current compound table.
Further, the method comprises the steps of:
each attribute variable of each compound table has a corresponding get and set method.
Further, the method comprises the steps of:
in the step S5, the adding, deleting and checking service interface of the composite table is constructed according to the external key relation, and the implementation thereof includes:
if the object of the composite table Yyy includes a main table object Ttt and a sub-table object Ppp, where the main table object Ttt and the sub-table object Ppp are both single tables or composite tables, and the sub-table object Ppp is one or more, the sub-table object has an external key value pointing to the main table object Ttt;
If the sub-table object Ppp is a compound table, the method for constructing the adding, deleting and checking service comprises the following steps:
according to the Bean assembling of Spring and the annotation technology of Spring boot2 and according to the structural characteristics that the multi-tree compound table object is a recursively multi-layer main sub table, firstly, a service interface of the sub table node object adding, deleting and checking operation is built step by step and is created as a Bean, then, a service interface of the main table node object, namely the adding, deleting and checking operation of the compound table is built again, when the service interface of the compound table adding, deleting and checking operation is realized, the beans of the main table object and the sub table object adding, deleting and checking operation service are required to be assembled and called, and the adding, deleting and checking operation of the compound table has transaction management capability through the annotations;
in the interface implementation object YyServiceIII, if a single table exists in a sub-table object, a Bean of an adding, deleting and checking service PppService and a Bean of a database access service PppMapper of the sub-table object Ppp are required to be assembled, if a compound table exists in the sub-table object, a Bean of the adding, deleting and checking service PppService of the compound table in the sub-table is also required to be assembled, and meanwhile, the transaction management capability of the adding, deleting and checking operation of the object compound table Yyy is required to be realized through annotation;
otherwise, if the sub-tables of the Yyy are all final-stage nodes and do not contain the compound table, the Bean service interface of the compound table is not required to be assembled and called, otherwise, the Bean service interface of the compound table is assembled and called.
Further, the method comprises the steps of:
if the sub-table object Ppp is a compound table, the method for constructing the adding, deleting and checking service further comprises:
if the main table and the sub-table of the sub-table object Ppp are both single tables, adding, deleting and checking the single tables, otherwise, if the sub-table of the Ppp still has a composite table, adding, deleting and checking the sub-table node object step by step until the main table and the sub-table are both single tables.
Further, the method comprises the steps of:
the adding, deleting and checking service interface of the compound table, especially the service interface of the adding, deleting and checking operation of the sub-table node object, not only comprises a method for adding, deleting and checking according to the compound table object value, but also comprises a method for adding according to the external key value, so as to support the calling by other nodes in the multi-fork tree structure and provide related services.
Further, the method comprises the steps of:
in the step S5, a service for adding, deleting and modifying the compound table corresponding to the multi-tree object is constructed, which specifically includes:
determining a compound table in the multi-way tree object, wherein the table name is as follows: zzz, which contains the main table object and the sub-table object inside and confirms the final-stage node and non-final-stage node existing in the sub-table object;
in the interface realization object ZzServiceNote, an adding, deleting and checking service interface of a non-final node is called based on an external key relation, a Spring annotation mode is adopted in the interface realization object ZzzServicenote, a Bean service interface is assembled and called, the Bean is recursively decomposed layer by layer through the assembly and the call of each level of compound tables, the realization is supported by adding, deleting and checking service of a main sub-table object of the next level, the adding, deleting and checking operation of a database table is only related in the service of the final node, and the operation of a single table is realized in the service of the non-final node, and the operation of a Java object example is only realized in the service of the non-final node.
Further, the method comprises the steps of:
the method further comprises the steps of: constructing a service which needs to provide a request response to the outside, and specifically:
the multi-tree object adds, deletes and checks the service of the request response, and constructs a corresponding controller object in a Spring annotation mode, wherein the controller object file is stored in a controller/catalog.
The beneficial effects are that: (1) The invention utilizes the Bean technology in Java ecology and the encapsulation technology of the database operation of tk.mybatis to realize the method for adding, deleting and checking the multi-way tree object at the Java end instead of the database end, thus in the system development and business flow design of application software, the design object is unified into the design, development, business logic organization, modification and maintenance of the multi-way tree object, the flexibility is better, and the procedural business logic control advantage of the Java end is fully exerted; (2) The Java end SpringBoot2 can integrate Bean services rapidly and automatically in an annotation mode, so that the advantages of layered design, development, testing, modification and maintenance of the Java end are fully exerted, and only a single table object of the Java end is involved in the operation of accessing a database, so that the workload of system development and maintenance is reduced; (3) The interface and implementation of the adding, deleting and checking service of the compound table in the multi-way tree object is the same as the multi-way tree object in structure and is of a recursively multi-layer main sub-table structure, so that the multi-way tree object and various Java files and codes related to the adding, deleting and checking service thereof can be automatically generated at a Java end according to an initial design file of the multi-way tree object in a template engine mode, and the workload of developers can be greatly reduced.
Drawings
FIG. 1 is a flow chart of an implementation method of a Java-end-based multi-way tree object addition, deletion and verification service according to the invention;
FIG. 2 is a form object block diagram of a database side according to an embodiment of the present invention;
FIG. 3 is a form object block diagram of a Java end according to an embodiment of the present invention;
FIG. 4 is a simplified diagram of a Java-side form object according to an embodiment of the present invention;
FIG. 5 is a block diagram of a multi-drop object according to an embodiment of the present invention;
FIG. 6 is a block diagram of a composition table according to an embodiment of the present invention;
FIG. 7 is a diagram of a multi-drop object after adding a compound table according to an embodiment of the present invention;
FIG. 8 is a block diagram of a database access service interface construction for a single table according to an embodiment of the present invention;
FIG. 9 is a diagram of interface implementation relationships for a single table CustomerServiceIII in accordance with an embodiment of the present invention;
FIG. 10 is a diagram showing the structure of an interface implementation of FhOrderrDetail1 ServiceIII according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating the interface implementation structure of FhConustomer 1ServiceImpl according to an embodiment of the present invention;
FIG. 12 is a block diagram of a FhConustomer 1 ServiceICeimpl interface in accordance with an embodiment of the present invention;
FIG. 13 is a block diagram of the structure of a medium-contrast multi-tree object FhCluster 1 according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the relational database, a multi-layer main sub-table view formed by connecting the main key and the external key forms a typical multi-fork tree object. A single table can be seen as a special case of a multi-way tree object.
In the system design and business flow design of application software, the design objects can be uniformly summarized into the design, development, business logic organization, modification and maintenance of the multi-tree objects.
The system code frame constructed by SpringBoot2, myBatis and the like based on Java has the characteristics of layered design development, rapid integration and automatic assembly, and the code catalog can be divided into a control layer (Controller), an entity class layer (Domain), a Service layer (Service) and a database access layer (Dao and map), so that the testing, debugging, modification and maintenance of a business process are convenient. However, there must be one entity Java class for each database operation object to correspond to the database table.
The invention provides a method for realizing the adding, deleting and checking service of a multi-tree object at a Java end, which solves the following problems:
the business logic of the multi-tree object is transferred to the Java end from the database end at the bottom layer, so that the procedural business logic control advantage of the Java end is fully exerted.
The implementation of the multi-fork tree object Service is transferred to a Java end Service layer (Service) from an SQL bottom layer of a database, and the advantages of hierarchical design, development, testing, modification and maintenance of the Java end are fully exerted due to the characteristic that the Java end SpringBoot2 can integrate and automatically assemble Bean services rapidly in an annotation mode, and the Java end only needs to use a single-table Java object to correspond to a table of the database end, so that the workload of system development, modification and maintenance is greatly reduced.
At the Java end, the structure of the conventional add-delete-modify-search service implementation for the multi-tree object is the same as that of the multi-tree object, and is a recursively multi-layer main sub-table structure, so that the automatic code generation by adopting a template engine mode can be supported.
As shown in fig. 1, the invention provides a method for implementing a Java-end multi-tree object-based added/deleted/revised service, which comprises the following steps:
S1, setting a single table object and an external key of a database end, wherein a database persistent layer framework adopts MyBatis;
s2, setting a single table object of a Java end, wherein each attribute of the single table object has corresponding get and set methods, and the development system of the Java end is Java-based SpringBoot2;
s3, determining a main table and a plurality of sub-tables according to the foreign key relation, and establishing a plurality of groups of main sub-tables with one-to-many relation so as to form a multi-fork tree object;
s4, the multi-way tree object is a recursively multi-layer main and sub-table structure, namely a main table exists, a plurality of sub-tables are built from the main table, the sub-tables are non-final sub-tables or single tables, the non-final nodes continue to build the sub-tables of the next stage until the sub-tables are all single tables, a plurality of compound tables are built according to the foreign key relation of the multi-main sub-tables and inserted into corresponding positions, and the compound tables integrate attribute variables of the tables with the foreign key relation into one table, and the compound tables are all non-final sub-tables.
The attribute variable of the compound table comprises two parts, wherein one part is a non-array variable, and elements of the non-array variable inherit attribute fields in the main table object; the other part is an array variable, and the elements of the array are sub-table objects; the elements of the non-array variable and the array variable form a one-to-many main sub-table relationship.
If a one-to-many main sub-table external key exists between the current main table and other compound tables, a current compound table is constructed at the Java end, and the other compound tables are used as array variables of the current compound table.
Each attribute variable of each compound table has a corresponding get, set method to facilitate the assembly of beans
S5, expressing the obtained multiple composite tables at a Java end;
s6, constructing a database access service interface of a single table and an implementation, addition, deletion and modification service interface thereof by utilizing an abstract class interface in tk.mybatis, wherein the single table is a final sub-table, and no foreign key association and constraint are defined at a database end.
In step S6, the abstract class interface object Mapper and Java generic technology is used for constructing the database access service interface of the single table, the file name thereof is xxxmapper, java, the abstract class generic interface object Mapper in tk.
In step S6, the building of the adding, deleting and checking service interface of the list table includes:
the add-delete-modify-check Service interface object of the single table Xxx is XxxService, the file name is XxxService.java, the Service inherits the abstract class generic interface object Service in tk.mybatis, and the generic data type is the single table object Xxx;
The XxxServiceIII interface realization object is XxxServiceIII, the file name is XxxServiceIII.java, the XxxServiceIII interface realization object inherits abstract type universal interface realization object in tk.mybatis, and the universal data type is also a single-table object Xxx;
in the interface realization object XxxServiceIII, a Spring annotation mode is adopted for the part needing to operate the database, and an XxxMapper Bean service interface is assembled and called to finish the database access operation of a single table Xxx.
S7, constructing a composite table adding, deleting and checking service interface and implementation thereof by utilizing Java interface technology, further finding a composite table corresponding to the multi-tree object, and constructing the composite table adding, deleting and checking service.
In step S7, the construction of the add-drop-check service interface of the compound table and the implementation thereof by using the Java interface technology includes:
if the object of the composite table Yyy contains a main table object Ttt and a sub-table object Ppp, the add-delete-modify-check service interface object of the composite table yyyy is YyyService, and the file name is YyyService. The interface implementation object of the yyServiceIII is yyServiceIII, and the file name is yyServiceIII.java;
if the object of the composite table Yyy includes a main table object Ttt and a sub-table object Ppp, where the main table object Ttt and the sub-table object Ppp are both single tables or composite tables, and the sub-table object Ppp is one or more, the sub-table object has an external key value pointing to the main table object Ttt;
If the sub-table object Ppp is a compound table, the method for constructing the adding, deleting and checking service comprises the following steps:
according to the Bean assembling of Spring and the annotation technology of Spring boot2 and according to the structural characteristics that the multi-tree compound table object is a recursively multi-layer main sub table, firstly, a service interface of the sub table node object adding, deleting and checking operation is built step by step and is created as a Bean, then, a service interface of the main table node object, namely the adding, deleting and checking operation of the compound table is built again, when the service interface of the compound table adding, deleting and checking operation is realized, the beans of the main table object and the sub table object adding, deleting and checking operation service are required to be assembled and called, and the adding, deleting and checking operation of the compound table has transaction management capability through the annotations;
in the interface implementation object YyServiceIII, if a single table exists in a sub-table object, a Bean of an adding, deleting and checking service PppService and a Bean of a database access service PppMapper of the sub-table object Ppp are required to be assembled, if a compound table exists in the sub-table object, a Bean of the adding, deleting and checking service PppService of the compound table in the sub-table is also required to be assembled, and meanwhile, the transaction management capability of the adding, deleting and checking operation of the object compound table Yyy is required to be realized through annotation;
specifically, in the interface implementation object yyservicell, a Spring annotation mode is adopted for the part of database operation, and two Bean service interfaces TttMapper, pppMapper are assembled and called to complete the database access operation on the single table Ttt and the Ppp;
In the interface implementation object yyyservicel, a part for adding, deleting and checking the single table is assembled and called with two Bean service interfaces TttService, pppService in a Spring annotation mode, so that adding, deleting and checking operations on the single table Ttt and Ppp are completed.
Otherwise, if the sub-tables of the Yyy are all final-stage nodes and do not contain the compound table, the Bean service interface of the compound table is not required to be assembled and called, otherwise, the Bean service interface of the compound table is assembled and called.
If the sub-table object Ppp is a compound table, the method for constructing the adding, deleting and checking service further comprises:
if the main table and the sub-table of the sub-table object Ppp are both single tables, adding, deleting and checking the single tables, otherwise, if the sub-table of the Ppp still has a composite table, adding, deleting and checking the sub-table node object step by step until the main table and the sub-table are both single tables.
The adding, deleting and checking service interface of the compound table, especially the service interface of the adding, deleting and checking operation of the sub-table node object, not only comprises a method for adding, deleting and checking according to the compound table object value, but also comprises a method for adding according to the external key value, so as to support the calling by other nodes in the multi-fork tree structure and provide related services.
In step S7, a compound table corresponding to the multi-tree object is found, and a service for adding, deleting and searching the compound table is constructed, which specifically includes:
determining a compound table in the multi-way tree object, wherein the table name is as follows: zzz, which contains the main table object and the sub-table object inside and confirms the final-stage node and non-final-stage node existing in the sub-table object;
in the interface realization object ZzzServiceIII, a Spring annotation mode is adopted to assemble and call a Bean service interface, the Bean is recursively decomposed layer by layer through the assembly and the call of each level of compound table Bean, the realization is supported by the adding, deleting and checking service of the main sub-table object of the next level, the adding, deleting and checking operation on the database table is only related in the service of the final level node, and the operation on a single table is only performed in the service of the non-final level node.
S8 the method further comprises: constructing a service which needs to provide a request response to the outside, and specifically: the multi-tree object adds, deletes and checks the service of the request response, and constructs a corresponding controller object in a Spring annotation mode, wherein the controller object file is stored in a controller/catalog.
In order to more intuitively describe the technical scheme, the application includes the following embodiments:
The development system of the system is SpringBoot2 based on Java, a database persistence layer framework supports automatic assembly and integration of beans by adopting MyBatis, springBoot2, a tk.mybatis tool plug-in is needed in the persistence layer aspect, and tk.mybats can carry out line layered encapsulation on single-table adding, deleting and checking operation through abstract class interfaces and general technology.
The file directory of the Java end is divided into:
domain/: java, each single table at the database end has a single table object corresponding to it at the Java end. The file name is, for example, customer.
/dto/: java, file name is for example fhcoutomer 1.Java.
Dao/: the database based on tk.mybaits accesses the catalog of the service interface file, the file extension is java, and the file under the catalog defines the interface of the single-table operation service of the database terminal. The file name is, for example, customermapper.
Common/: the file extension name is java, and the under-directory file defines the abstract class interface object file based on the universal type and the object file realized by the abstract class interface object file. File names such as service.java, abstract service.java.
Service/: the file extension name is java, and the file under the directory defines the interface of the single-table or compound-table object adding, deleting and checking service. The file names are, for example, customerService.java, fhcustomer1Service.java.
serviceImpl/: the file extension name is java, and the file under the directory defines the realization of the single-table or compound-table object adding, deleting and checking service interface. The file names are, for example, customerServiceIII.java, fhConstromer 1 ServiceIII.java. .
Controller/: the file under the directory defines the service which needs to provide the request response to the outside, including the service of adding, deleting and checking the multi-tree object. The file names are, for example, customerController.Java, fhcustomer1Controller.Java.
The decomposition and expression of the multi-way tree object at the Java end, firstly, the multi-way tree is a tree formed according to the foreign key relation among the single tables.
As shown in fig. 2, first, a single table object and its external key at the database end are set, as shown in fig. 3, a single table object (with a set and a get) at the Java end, where each attribute of the single table object at the Java end has a corresponding get and set method, so as to facilitate the assembly of beans. The single table object files of the Java end are all stored in/domain/directory, and as shown in FIG. 4, a simplified schematic diagram of the single table object of the Java end is shown.
Next, a multi-way tree object constructed from the foreign key relationship, as shown in FIG. 5, the order detail table OrderrDetail contains the foreign key orderid of the belonging order, and the field value is taken from the id value in the order table Orderr, so that a one-to-many main sub-table of relationships can be established between the order Orderr and the order detail OrderrDetail.
Also, both the order table Orderr and the Product table Product contain the foreign key customerId of the Customer to which it belongs, and this field value is taken from the id value in the Customer table Customer, so that a one-to-many main sub-table can be created between the Customer and the order table Orderr and the Product table Product, respectively.
Therefore, a multi-way tree object with 3 levels in the vertical direction and 2 levels in the horizontal direction can be established according to the foreign key relation.
Constructing a composite table object of a Java end according to the foreign key relation, and constructing a composite table according to the foreign key relation of a one-to-many main table, wherein the attribute variable of the composite table consists of two parts, one part is a non-array variable, and the elements of the non-array variable are inherited from attribute fields in the main table object; one part is an array variable, and the elements of the array are sub-table objects; the elements of the non-array variable and the array variable form a one-to-many main sub-table relationship.
Whether non-array variables or array variables, each attribute in the compound table object has a corresponding get, set method to facilitate the assembly of beans.
For example: according to the one-to-many main sub-table external key orderrId between order Orderr and order detail OrderrDetail, a compound table FhOrderrDetail1 can be built at the Java end. As shown in fig. 6:
the attribute variable in the composite table FhOrderrDetail1 consists of two parts, one part is a non-array variable, and its elements are inherited from the attribute field in the single table object Orderr, which contains the foreign key customeid pointing to the client single table Customer; one part is an array variable, and the elements of the array are objects OrderrDetail; a one-to-many main sub-table relationship is formed between the non-array variable Orderr and the element OrderrDetail of the array variable.
Also, a composite table FhCluster 1 can be built at the Java end according to a one-to-many-main-table external key customerId between a Customer and a Product and a one-to-many-main-table external key customerId between the Customer and a composite table FhOrderrDetail1, wherein non-array variables are attribute fields inherited from the single-table Customer and are main tables; there are two array variables, one array variable element is Product, the other array variable element is composite table FhOrderrDetail1, and the non-array variable and the two array variable elements respectively form one-to-many main sub-table relationship, as shown in fig. 7. The files of the compound table objects FhOrderrDetail1 and fhclusterin 1 are saved in/dto/directory.
Next, the multi-way tree object is expressed at the Java end. As can be seen from the structure of FIG. 7, the composition table FhContomer 1 is the expression of the multi-way tree object at the Java end. The multi-way tree object at the Java end is in a recursion multi-layer main sub-table structure, after layer-by-layer decomposition, if the decomposed node does not contain sub-tables, the node is a final-stage node, and the table corresponding to the node is a single table; if the sub-table is still contained, the node is a non-final node and the table corresponding to the node is a compound table.
And the multi-way tree object is decomposed layer by layer, with Customer, product, orderr, orderrDetail being the last-stage node, fhOrderrDetail1 being the non-last-stage node, among the nodes.
Through recursive decomposition, the multi-way tree object can be seen as a composite table of the topmost node. In the previous example, the composite table object FhCluster 1 of the topmost node can be considered a multi-way tree object.
The compound table of each node has the same structure and is composed of two levels of main and sub tables, and a plurality of sub tables are possible, but the sub tables can be compound tables or single tables, and the single tables do not define any foreign key association and constraint at the database side.
The final stage after the layer-by-layer recursion decomposition, namely the single table, has the attribute of Java objects with corresponding get and set methods, and is convenient for the assembly of beans. And corresponds to the single table in the database one by one through the MyBatis persistent layer framework.
Wherein, each attribute of each compound table has corresponding get, set method to facilitate the assembly of beans.
Finally, database access service for building a single table from tk.mybatis
The abstract class interface object Mapper in tk.mybatis and Java generic technology are utilized to construct a single-table database access service interface, and the file extension name of the single-table database access service interface is Java.
According to MyBatis, a realization of a database access service interface of a single table can be constructed, and the file extension of the realization is x.
Taking a Customer list as an example, the Customer database access service interface object is a Customer Mapper, the file name is Customer Mapper, which inherits the abstract generic interface object Mapper in tk. Because SQL statements of various operations of the database are encapsulated in the abstract class interface object Mapper in the tk.mybatis tool plugin, all single-table database access service interfaces and implementation thereof do not need a developer to write any SQL statement code.
The database access service interface of the single table can be assembled and called as a Bean by other object examples.
The database access service interface object files java is stored in/dao/directory.
Xml is stored in/resources/mapper/directory.
Construction of single table add-drop-check services from tk.mybatis
And constructing the adding, deleting and checking Service interface of the single table by using the abstract generic Service interface Service in the tk.mybatis and realizing abstract Service.
In the part of the interface implementation related to database operation, a Spring annotation mode can be adopted to assemble and call a related Bean service interface so as to complete the database access operation of a single table.
Taking a Customer list as an example, the adding and deleting and modifying Service interface object of the list Customer is Customer Service, the file name is Customer Service, the abstract generic interface object Service in tk.mybatis is inherited, and the generic data type is the list object Customer.
The interface realization object of the CustomerServiceIII is CustomerServiceIII, the file name is CustomerServiceIII.java, the abstract generic interface realization object of the tk.mybatis is inherited, and the generic data type is also a single-table object, namely a Customer.
In the interface implementation object CustomerServiceIII, a Spring annotation mode is adopted for the part needing to operate the database, and a Bean service interface, namely a CurtomerMapper, is assembled and called to finish the database access operation on the single-table Curtomer. The addition and deletion of single-table Customer checks the structural relationship of the service interface Customer service and its implementation Customer service template, as shown in fig. 9. According to the basic method required by the single-table adding, deleting and checking Service, the generic and abstract class interface technology of Java is utilized to construct generic abstract class interface object Service and an interface thereof to realize abstract Service.
By utilizing the Bean assembling of Spring, the annotation technology of Spring boot2 and the universal and abstract class interface technology of Java, a single-table adding, deleting and checking service interface is constructed according to the external key connection relation of each single table in the multi-way tree and the method required by single-table adding, deleting and checking, when the interface is realized, the Bean of the database access service of the single table is required to be assembled and called, and the adding, deleting and checking operation of the single table has the Transaction management capability through @ Transaction annotation.
The single-table adding, deleting and checking service interface not only comprises a method for adding, deleting and checking rows according to table object values, but also comprises a method for adding and deleting rows according to foreign key values, so that the single-table adding, deleting and checking service interface is supported to be called by other nodes in a multi-way tree structure and provides related services.
The single-table adding, deleting and checking service interface can be used as a Bean to be assembled and called by other object examples
Java is stored in/service/directory.
Java is stored in/serviceImpl/directory.
Abstract class interface object file service. Java and interface implementation file abstract service. Java is stored in/common/directory.
Taking the Product list as an example, in a multi-way tree structure, the Product has an foreign key value pointing to the Customer. The adding and deleting and modifying Service interface file name of the single-table Product is Product Service, the abstract class generic interface object Service is utilized and inherited, and the generic data type is the single-table object Product.
The interface implementation file name of the ProductServiceIII.Java inherits the abstract class generic interface implementation object Abstract Service, and the generic data type is also a single-table object Product.
In the interface implementation object ProducServiceIII, the methods needed to provide foreign key service for the upper node are createByCurtomerId and deleeByCurtomerId
And the part needing to operate the database adopts a Spring annotation mode, and assembles and calls a Bean service interface of a Product mapper so as to finish the database access operation of a single-table Product.
The adding and deleting and modifying Service interface fhOrderrDetail1Service of the compound table fhOrderrDetail1 and the structural relation for realizing fhOrderrDetail1 serviceoil are shown in fig. 10.
The adding, deleting and checking service for constructing the composite table according to the external key relation comprises the following steps:
s81, utilizing the Bean assembling of Spring and the annotation technology of Spring boot2, constructing a service interface of the sub-table node object adding, deleting and checking operation step by step and creating the sub-table node object adding, deleting and checking operation as a Bean according to the structural characteristics of the multi-layer main sub-table with the multi-way tree compound table object as recursion, then constructing a service interface of the main table node object, namely the adding, deleting and checking operation of the compound table, when the service interface of the compound table adding, deleting and checking operation is realized, assembling and calling the beans of the main table object and the sub-table object adding, deleting and checking operation service, and enabling the adding, deleting and checking operation of the compound table to have Transaction management capability through @ Transaction annotation.
The service interface of the adding, deleting and checking of the S82 compound table, especially the service interface of the adding, deleting and checking operation of the sub-table node object, not only comprises a method for adding, deleting and checking according to the line of the compound table object value, but also comprises a method for adding according to the line of the external key value, so as to support the calling by other nodes in the multi-way tree structure and provide related services.
And S83, adding, deleting and modifying the service interface object file of the compound table.
And S84, adding, deleting and modifying the object files realized by the service interface of the compound table, wherein java is stored in/serviceImpl/catalogue.
Taking the multi-tree compound table object fhcoutomer 1 as an example, as shown in fig. 10, the main table node object is fhcoutomer 1 itself, the main table is a Customer, and the main table is a single table; two sub-table node objects are provided, one is a Product, a single table, one is FhOrderrDeatil1, and the other is a compound table, and the two sub-table node objects have external key values pointing to a master table Customer;
the construction of the add-delete-modify-check service interface of the composite table FhOrderrDetail1 needs to be constructed first according to the methods of the previous S1 and S2.
The main node object of the composite table FhOrderrDetail1 is FhOrderrDetail1 itself, and the main table is Orderr and is a single table; one of the sub-table node objects is a single table OrderrDetail, and the adding, deleting and modifying service interfaces of the single tables Orderr and OrderrDetail are OrderrService, orderrDetailService, are constructed and realized in the prior and are created as beans.
The Service interface of the adding and deleting of the compound table FhOrderrDetail1 is FhOrderrDetail1Service, and when the interface is realized in FhOrderrDetail1 ServiceSimpl, the concrete operation of adding and deleting of the compound table FhOrderrDetail1 relates to the operation of adding and deleting the main object and the sub-object and the operation of accessing the database, so that beans of the Service interface such as OrderrService, orderrDetailService, orderrMapper, orderrDetailMapper are required to be assembled, and the Transaction management capability of the adding and deleting operation of the compound table FhOrderdDetail 1 is required to be realized through @ Transaction annotation.
The method of S81 and S82 is also used for constructing an adding and deleting and checking Service interface FhContomer 1Service of the compound table FhContomer 1, when adding and deleting and checking operations in the interface are specifically realized in FhContomer 1 ServiceSimple, the adding and deleting services of the master table Customer Service and the beans of the database access Service Customer are required to be assembled, the adding and deleting services of the sub-table Product and the beans of the database access Service Product are required to be assembled, the beans of the adding and deleting services FhOrderDetardtail of the compound table FhCondition in the sub-table are required to be assembled, and meanwhile, the Transaction management capability of the adding and deleting operations of the object compound table FhContomer 1 is required to be realized through @ Transaction comments.
As can be seen from FIG. 10, fhOrderrDetail1Service includes a foreign key related method createByCurtomerId that can support being invoked by other nodes in a multi-way tree structure and provide related services.
In the implementation of the interface object FhContomer 1 ServiceIII, a Spring annotation mode is adopted to assemble and call Bean Service interfaces such as CustomerMapper, customerService, productMapper, productService, orderrService, fhOrderrDetail Service, as shown in FIG. 11, because FhContomer 1 is at the top of the multi-way tree structure, the FhContomer 1Service no longer contains foreign key related methods, i.e. foreign key related services do not need to be provided and called by other nodes.
Example code for FhConstromer 1Service interface:
public interface FhCustomer1Service { Long create(FhCustomer1 fhCustomer1); Long delete(Long id); Long update(FhCustomer1 fhCustomer1); FhCustomer1 read(Long id);}
example code for implementing the "New FhConst 1 Complex Table", i.e., create method, in the FhConst 1 ServiceIntermpl interface:
@Service @Transactional public class FhCustomer1ServiceImpl implements FhCustomer1Service { @ Resource private CustomerMapper customerMapper @ Resource private CustomerService customerService @ Resource private ProductMapper productMapper @ Resource private ProductServiceproductService @ Resource private OrderrService orderrService @ Resource private FhOrderrDetail1Service fhOrderrDetail1Service @ Override public Long create (fhclutomer 1) {// new formulation table Customer Customer = new Customer (); beans. copyProperties(fhCustomer1, customer); customer.setId(null); if(customerMapper.insert(customer)>0) UpdateNum. GetAndAdd (customer. GetId ()));// New leaf class sub-List<Product>products = new ArrayList<>(); fhCustomer1.getProductsByCustomerId().forEach(a ->{ Productproduct = new Product(); BeanUtils.copyProperties(a,product); product.setId(null); product.setCustomerId(customer.getId()); products.add(product); }); if (products.size()>0) product mapper. Insert List (products);// New non-leaf class sub-List<FhOrderrDetail1>fhOrderrDetail1s = fhCustomer1.getFhOrderrDetail1sByCustomerId(); fhOrderrDetail1s.forEach(a ->{ fhOrderrDetail1Service.createByCustomerId(a,customer.getId()); }); return customer.getId(); }
}
}
As can be seen from the above example code, in the interface implementation object FhCluster 1 ServiceIII, annotation @ Service indicates that the interface FhCluster 1Service can be assembled and invoked as a Bean Service by other objects; annotating @ Transaction, indicating the realization of all methods in the interface, and having Transaction management capability; annotating @ Resource, indicating that the Bean Service interface CustomerMapper, customerService, productMapper, productService, orderrService, fhOrderrDetail Service is assembled and will be invoked; when the 'newly added FhConst 1 compound table' is realized in the create method, the operation of the Customer with the main table as the single table is involved, the method insert in the Bean instance customerMapper of the database access Service is called, the operation of the Product with the sub table as the single table is involved, the method insert List in the Bean instance productproper of the database access Service is called, the operation of the FhOrderDerrDetail 1 with the sub table as the compound table is involved, and the method createByCursorId in the Bean instance fhOrderDetail 1Service of the compound table enhancement and deletion Service is called.
The method createByCustomerId in fhOrderrDetail1Service is how to implement.
fhOrderrrDetail 1Service interface example code:
public interface FhOrderrDetail1Service { Long createByCustomerId(FhOrderrDetail1 fhOrderrDetail1,Long id); Long create(FhOrderrDetail1 fhOrderrDetail1); Long delete(Long id); Longupdate(FhOrderrDetail1 fhOrderrDetail1); FhOrderrDetail1 read(Long id); }
note that in the fhOrderrrDetail 1Service interface, there is a method createByCustomerId of adding a compound table fhOrderrrDetail 1 according to the foreign key value, in addition to the pruned check method create, delete, update, read.
Example code implementing the "Add composite Table FhOrderrDetail1 from foreign key value" method, createByCustomerId, in FhOrderDetail 1 ServiceSimpl interface implementation:
@Service @Transactional public class FhOrderrDetail1ServiceImpl implements FhOrderrDetail1Service { @Resource private OrderrMapper orderrMapper; @Resource privateOrderrService orderrService; @Resource private OrderrDetailMapper orderrDetailMapper; @Resource private OrderrDetailService orderrDetailService;
override public Long createByCustomerId (FhOrderrDetail 1 fhOrderrDetail1, long id) {// Main Table
OrderrOrderrR=new OrderrR (); beanUtils. Copy Properties (fhOrderrDetail 1, orderr); orderrR. SetId (null); orderrR. SetCustomerId (id); if (orderMapper. Insert (Orderr) > 0); updateNum. GetAndadd (orderD ()); leaf class sub-List < OrderdDetail > OrderdDetails = new ArrayList < >); fhOrderDetails 1. GetDetails ByOrderrId (); for { OrderrDetail orderrDetail OrderDetail (); beUderdId (nula); beta-); beta. Support (orderDerD); beta. Support List ()));
orderrDetail.setOrderrId(orderr.getId()); orderrDetails.add(orderrDetail); }); if (orderrDetails.size()>0) orderrDetailMapper.insertList(orderrDetails); return orderr.getId(); }
}
}
as can be seen from the above example code, in the interface implementation object fhOrderrrDetail 1 ServiceIII, in the createByCurtomerId method of "adding compound table fhOrderrrDetail 1 according to foreign key value", the orderr. SetCurtomerId (id) statement implements assignment of foreign key value to foreign key field of main table; the new addition of the main table invokes the method insert in the Bean instance orderrMapper of the database access service; when the sub-table is constructed, the fhOrderrDetails 1. GetOrderDetails ByOrderry Id (). The forEach statement realizes the traversal of the sub-table array elements in the input object parameter fhOrderdDetails 1; the orderrDetail.setOrderrId (orderr.getId ()) statement implements the assignment of foreign key values to the foreign key fields of the sub-table; the new addition of the sub-table array invokes the method insert List in the Bean instance orderrDetailMapper of the database access service.
In the called Bean Service interface, since fhOrderrrDetail 1Service is an add-drop-modify-check Service interface of the compound table, a Spring annotation mode is also adopted in the Service interface, other Bean services are assembled and called, and the expanded fhcoutomer 1 servicel interface realizes an object structure, as shown in fig. 12.
And finding out the composite table corresponding to the multi-way tree object, and constructing the adding, deleting and checking service of the composite table. In the implementation of the composite table adding, deleting and checking service interface, the part related to the adding, deleting and checking operation of other composite tables can adopt a Spring annotation mode to assemble and call Bean service interfaces related to the adding, deleting and checking operation of other composite tables so as to complete the adding, deleting and checking operation of the composite tables.
In this way, through the assembly and the call of the Bean of each level of composite table, the interface and the realization of the multi-fork tree object adding, deleting and checking service can be recursively decomposed layer by layer and supported by the adding, deleting and checking service of the main sub-table object of the next level. Only in service at the final node is an add-drop-check operation to the database tables involved, and is an operation to a single table. Whereas in services other than the final node, only the operation on Java object instances.
Taking the example of the compound table fhcoutomer 1, the compound table is the expression of the multi-way tree object at the Java end, and the object contains a main table object Customer and two sub-table objects, namely a Product and fhOrderrrDetail 1, respectively, wherein the Product is the final node, and fhOrderrrDetail 1 is the non-final node.
The interfaces and implementation of the composition table FhContomer 1 and FhOrderDetail1 are shown in FIGS. 10 and 11.
In the interface realization object FhCoustomer 1 ServiceIII, fhOrderrDetail1Service adding, deleting and checking Service interface is called based on external key relation, spring annotation mode is adopted in the interface, other Bean services are assembled and called, and the unfolded FhCoustomer 1 ServiceIII interface realizes object structure
Comparing the structures of the multi-way tree object FhCluster 1, as shown in FIG. 13 below, the composite Table addition/subtraction Service FhCluster 1Service and the composite Table object FhCluster 1 have the same iterative structure
And finally, constructing a service requiring external request response, wherein the service requiring external request response comprises a service requiring external request response of adding, deleting and checking by a multi-tree object, and constructing a corresponding controller object in a Spring annotation mode, wherein a controller object file is stored in/controller/catalog by java.
For example: the Controller object of the single-table Product adding and deleting and modifying service is a Product Controller, the Controller object of the compound table FhOrderrDetail1 is a FhOrderrDetail1Controller, and the Controller object of the compound table FhCluster 1 is a FhCluster 1Controller.
In summary, the multi-way tree object at the Java end is a multi-layer main sub-table structure which can be decomposed recursively. After layer-by-layer decomposition, if the node does not contain a sub-table, the node is a single table, and the Java object corresponds to the single table in the database; if the sub-table is still contained, the node is a compound table, and the sub-table is of a List array type.
The compound table of each node has the same structure and is composed of two levels of main and sub tables, and a plurality of sub tables are possible, but the sub tables can be compound tables or single tables.
The Java object attribute of the single table or the compound table is provided with get and set methods so as to facilitate the assembly of beans.
The single table and the node compound table at each level are all encapsulated into beans in Java technology, and the add-delete-modify-check service can be conveniently and automatically assembled and called at other places.
Only the operations of adding, deleting and checking the single table are related to the operations of the table in the database.
For single-table conventional database operations, the tk.mybatis further encapsulated without the need for a developer to rewrite SQL statements.
The interfaces and implementation of the add-delete-modify-search service for the multi-way tree object are the same as the multi-way tree object in structure and are all recursively multi-layer main sub-table structures.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims and the equivalents thereof, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method for realizing a Java-end-based multi-tree object deletion and correction service is characterized by comprising the following steps:
s1, setting a single table object and an external key of a database end, wherein a persistent layer frame of the database end adopts MyBatis;
s2, determining a main table and a plurality of sub-tables according to the foreign key relation, and establishing a plurality of groups of main sub-tables with one-to-many relation so as to form a multi-fork tree object; the multi-tree object is in a recursion multi-layer main sub-table structure, wherein a main table exists, a plurality of sub-tables are built according to the main table, the sub-tables are non-final sub-tables or single tables, and a non-final node continues to build a sub-table of the next stage until the sub-tables are all single tables;
S3, constructing a plurality of compound tables according to the external key relation of the main sub-table with the one-to-many relation, and inserting the compound tables into corresponding positions, wherein the compound tables integrate attribute variables of the plurality of tables with the external key relation into one table, and the compound tables are all non-final sub-tables;
s4, expressing the obtained multiple composite tables at a Java end;
s5, constructing a deletion-adding and checking service interface of the compound table and realizing the deletion-adding and checking service interface according to the external key relation, and further constructing a deletion-adding and checking service of the compound table corresponding to the multi-tree object; in the step S5, the adding, deleting and checking service interface of the composite table is constructed according to the external key relation, and the implementation thereof includes:
if the object of the composite table Yyy includes a main table object Ttt and a sub-table object Ppp, where the main table object Ttt and the sub-table object Ppp are both single tables or composite tables, and the sub-table object Ppp is one or more, the sub-table object has an external key value pointing to the main table object Ttt;
if the sub-table object Ppp is a compound table, the method for constructing the adding, deleting and checking service comprises the following steps:
according to the Bean assembling of Spring and the annotation technology of Spring boot2 and according to the structural characteristics that the multi-tree compound table object is a recursively multi-layer main sub table, firstly, a service interface of the sub table node object adding, deleting and checking operation is built step by step and is created as a Bean, then, a service interface of the main table node object, namely the adding, deleting and checking operation of the compound table is built again, when the service interface of the compound table adding, deleting and checking operation is realized, the beans of the main table object and the sub table object adding, deleting and checking operation service are required to be assembled and called, and the adding, deleting and checking operation of the compound table has transaction management capability through the annotations;
In the interface implementation object YyServiceIII, if a single table exists in a sub-table object, a Bean of an adding, deleting and checking service PppService and a Bean of a database access service PppMapper of the sub-table object Ppp are required to be assembled, if a compound table exists in the sub-table object, a Bean of the adding, deleting and checking service PppService of the compound table in the sub-table is also required to be assembled, and meanwhile, the transaction management capability of the adding, deleting and checking operation of the object compound table Yyy is required to be realized through annotation;
otherwise, if the sub-tables of the Yyy are all final-stage nodes and do not contain the compound table, the Bean service interface of the compound table is not required to be assembled and called, otherwise, the Bean service interface of the compound table is assembled and called.
2. The method for implementing the Java-end multi-way tree object-based pruning and modifying service according to claim 1, wherein the attribute variables of the compound table comprise two parts, one part is a non-array variable, and elements of the non-array variable are inherited from attribute fields in the main table object; the other part is an array variable, and the elements of the array variable are sub-table objects; the elements of the non-array variable and the array variable form a one-to-many main sub-table relationship.
3. The method for implementing the deletion and examination service based on the Java end multi-way tree object according to claim 2, wherein if a one-to-many main sub-table foreign key exists between the current main table and other compound tables, a current compound table is constructed at the Java end, and the other compound tables are used as array variables of the current compound table.
4. The method for implementing a Java-side multi-way tree object-based pruning and checking service according to claim 1, wherein each attribute variable of each compound table has a corresponding get and set method.
5. The method for implementing the services for adding, deleting and checking based on the Java-end multi-way tree object according to claim 1, wherein if the sub-table object Ppp is a compound table, the method for constructing the services for adding, deleting and checking further comprises:
if the main table and the sub-table of the sub-table object Ppp are both single tables, adding, deleting and checking the single tables, otherwise, if the sub-table of the Ppp still has a composite table, adding, deleting and checking the sub-table node object step by step until the main table and the sub-table are both single tables.
6. The method for implementing the Java-side multi-tree object-based pruning and modifying service according to claim 5, wherein the pruning and modifying service interface of the compound table, in particular the pruning and modifying service interface of the sub-table node object, not only includes the method for pruning and modifying according to the compound table object value, but also includes the method for adding according to the external key value, so as to support the invocation by other nodes in the multi-tree structure and provide related services.
7. The method for implementing the deletion-adding and modifying service based on the Java-end multi-tree object according to claim 1, wherein in the step S5, the deletion-adding and modifying service of the compound table corresponding to the multi-tree object is constructed, specifically including:
Determining a compound table in the multi-way tree object, wherein the table name is as follows: zzz, which contains the main table object and the sub-table object inside and confirms the final-stage node and non-final-stage node existing in the sub-table object;
in the interface realization object ZzServiceNote, an adding, deleting and checking service interface of a non-final node is called based on an external key relation, a Spring annotation mode is adopted in the interface realization object ZzzServicenote, a Bean service interface is assembled and called, the Bean is recursively decomposed layer by layer through the assembly and the call of each level of compound tables, the realization is supported by adding, deleting and checking service of a main sub-table object of the next level, the adding, deleting and checking operation of a database table is only related in the service of the final node, and the operation of a single table is realized in the service of the non-final node, and the operation of a Java object example is only realized in the service of the non-final node.
8. The method for implementing a Java-based multi-way tree object added-pruned query service according to claim 1, further comprising: constructing a service which needs to provide a request response to the outside, and specifically:
the multi-tree object adds, deletes and checks the service of the request response, and constructs a corresponding controller object in a Spring annotation mode, wherein the controller object file is stored in a controller/catalog.
CN202211292262.0A 2022-10-21 2022-10-21 Method for realizing Java-end-based multi-way tree object adding, deleting and checking service Active CN115687317B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211292262.0A CN115687317B (en) 2022-10-21 2022-10-21 Method for realizing Java-end-based multi-way tree object adding, deleting and checking service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211292262.0A CN115687317B (en) 2022-10-21 2022-10-21 Method for realizing Java-end-based multi-way tree object adding, deleting and checking service

Publications (2)

Publication Number Publication Date
CN115687317A CN115687317A (en) 2023-02-03
CN115687317B true CN115687317B (en) 2023-10-03

Family

ID=85066181

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211292262.0A Active CN115687317B (en) 2022-10-21 2022-10-21 Method for realizing Java-end-based multi-way tree object adding, deleting and checking service

Country Status (1)

Country Link
CN (1) CN115687317B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6938041B1 (en) * 1999-04-30 2005-08-30 Sybase, Inc. Java-based data access object
CN101073070A (en) * 2004-08-24 2007-11-14 塞门铁克操作公司 Systems and methods for providing a modification history for a location within a data store
CN101073064A (en) * 2004-08-24 2007-11-14 塞门铁克操作公司 Recovering from storage transaction failures using checkpoints
CN102063298A (en) * 2010-12-10 2011-05-18 电子科技大学 Automobile electronic controller-oriented runtime environment generation system and method
CN103761265A (en) * 2014-01-02 2014-04-30 上海起维信息科技有限公司 NoSQL (not only SOL) based medical information system database implementation method
CN114090595A (en) * 2020-09-02 2022-02-25 浙江华云信息科技有限公司 Drive type data processing method based on polymorphic power grid model
CN114443015A (en) * 2022-01-29 2022-05-06 江苏南大先腾信息产业股份有限公司 Method for generating adding, deleting, modifying and checking service interface based on database metadata
CN114528846A (en) * 2022-02-20 2022-05-24 杭州格沃智能科技有限公司 Concept network for artificial intelligence and generation method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070233652A1 (en) * 2006-03-30 2007-10-04 Sap Ag System and method for pre-sorting table data
US8260824B2 (en) * 2009-05-05 2012-09-04 Rocket Software, Inc. Object-relational based data access for nested relational and hierarchical databases
WO2020144676A1 (en) * 2019-01-07 2020-07-16 Technion Research & Development Foundation Limited Real-time multi-pattern detection over event streams

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6938041B1 (en) * 1999-04-30 2005-08-30 Sybase, Inc. Java-based data access object
CN101073070A (en) * 2004-08-24 2007-11-14 塞门铁克操作公司 Systems and methods for providing a modification history for a location within a data store
CN101073064A (en) * 2004-08-24 2007-11-14 塞门铁克操作公司 Recovering from storage transaction failures using checkpoints
CN102063298A (en) * 2010-12-10 2011-05-18 电子科技大学 Automobile electronic controller-oriented runtime environment generation system and method
CN103761265A (en) * 2014-01-02 2014-04-30 上海起维信息科技有限公司 NoSQL (not only SOL) based medical information system database implementation method
CN114090595A (en) * 2020-09-02 2022-02-25 浙江华云信息科技有限公司 Drive type data processing method based on polymorphic power grid model
CN114443015A (en) * 2022-01-29 2022-05-06 江苏南大先腾信息产业股份有限公司 Method for generating adding, deleting, modifying and checking service interface based on database metadata
CN114528846A (en) * 2022-02-20 2022-05-24 杭州格沃智能科技有限公司 Concept network for artificial intelligence and generation method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"HBase数据库迁移工具的设计与实现";杨寒冰等;《计算机科学与探索》;236-246 *

Also Published As

Publication number Publication date
CN115687317A (en) 2023-02-03

Similar Documents

Publication Publication Date Title
US6704747B1 (en) Method and system for providing internet-based database interoperability using a frame model for universal database
US6748374B1 (en) Method for generating a relational database query statement using one or more templates corresponding to search conditions in an expression tree
US7493344B2 (en) Method and system for dynamic data merge in databases
US7676493B2 (en) Incremental approach to an object-relational solution
US20030208493A1 (en) Object relational database management system
US8874619B2 (en) Method and apparatus for defining common entity relationships
US20010016843A1 (en) Method and apparatus for accessing data
US20080319957A1 (en) Extensible command trees for entity data model platform
US20070027849A1 (en) Integrating query-related operators in a programming language
JP2006244498A (en) Data model for object relational data
KR20060045622A (en) Extraction, transformation and loading designer module of a computerized financial system
US20020091705A1 (en) Object integrated management system
Blakeley et al. The ado. net entity framework: Making the conceptual level real
US11561976B1 (en) System and method for facilitating metadata identification and import
CN100440803C (en) Gridding information model system and method for modeling processing gridding information
Marcos et al. Aggregation and composition in object-relational database design
Rahayu et al. Performance evaluation of the object-relational transformation methodology
CN115687317B (en) Method for realizing Java-end-based multi-way tree object adding, deleting and checking service
WO2023151239A1 (en) Micro-service creation method and related device
CN108845793B (en) ORM design method and device
CN116450110A (en) Automatic generation method and system for access codes of database based on custom attributes
CN116627448A (en) Method for creating micro-service and related equipment
EP1040432B1 (en) Method and apparatus for loading stored procedures in a database corresponding to object-oriented data dependencies
CN111752546A (en) Excel-based database object design management platform, system and method
Correa et al. Object-relational mapping tools and Hibernate

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant