Unlock instant, AI-driven research and patent intelligence for your innovation.

A method and device for generating SQL statements

A statement and object technology, applied in the field of SQL statement generation, can solve problems such as coverage and excessively long SQL statements

Active Publication Date: 2021-06-29
BEIJING GRIDSUM TECH CO LTD
View PDF4 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0007] In summary, when the existing ORM framework modifies the object, the generated SQL statement is too long, and it is easy to cause the problem that the modification result submitted first is overwritten by the modification result submitted later

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A method and device for generating SQL statements
  • A method and device for generating SQL statements
  • A method and device for generating SQL statements

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0056] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present disclosure will be more thoroughly understood, and will fully convey the scope of the present disclosure to those skilled in the art.

[0057] see image 3 , image 3 It is a flow chart of a method for generating an SQL statement disclosed in this embodiment, which specifically includes the following steps:

[0058] S101: Obtain an object to be modified, each attribute of the object to be modified, and an attribute value of each attribute;

[0059] The object here is a data structure, and the object includes multiple attributes, and each attribute has ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method for generating an SQL statement, which comprises acquiring an object to be modified, each attribute of the object to be modified, and an attribute value of each attribute; creating a snapshot of the object to be modified, based on the object to be modified The snapshot detection of the modified object detects each attribute value of the modified object, determines the changed attribute in the object to be modified, and the attribute value of the changed attribute; and according to the changed attribute in the object to be modified, and The attribute value of the changed attribute generates a SQL statement for modifying the object to be modified. Since the SQL statement only involves the changed attribute of the object to be modified, the SQL statement is relatively simple, and it can also avoid submitting first under concurrent conditions The modification results of the problem are overwritten by the modification results of the later submission.

Description

technical field [0001] The present invention relates to the technical field of databases, and more specifically, to a method and device for generating SQL statements. Background technique [0002] Object Relational Mapping (full English name: Object Relational Mapping, English abbreviation ORM) is a program technology used to realize the conversion between data of different types of systems in an object-oriented programming language. [0003] The ORM framework is generally used for mapping between the database model and the objects used in the program. The special feature of the ORM framework is that after the object is modified in the program, the ORM automatically generates the corresponding SQL statement and submits the generated SQL statement to the database. middle. [0004] Take the object model "Employee" as an example. "Employee" includes attributes: name, age and work location, which corresponds to a table in the database. The table includes the primary key id, 5 c...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/23G06F16/242
CPCG06F16/235G06F16/2433
Inventor 焦惠达
Owner BEIJING GRIDSUM TECH CO LTD