CN109739872A - A kind of implementation method, system and the operating method of SQL statement processing - Google Patents
A kind of implementation method, system and the operating method of SQL statement processing Download PDFInfo
- Publication number
- CN109739872A CN109739872A CN201811613476.7A CN201811613476A CN109739872A CN 109739872 A CN109739872 A CN 109739872A CN 201811613476 A CN201811613476 A CN 201811613476A CN 109739872 A CN109739872 A CN 109739872A
- Authority
- CN
- China
- Prior art keywords
- encapsulation
- class
- encapsulation class
- parameter
- function
- 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.)
- Pending
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention discloses a kind of implementation method of SQL statement processing, includes the following steps: to create the package interface for encapsulating querying condition sentence, the input parameter definition of package interface is the conditional parameter of object type;Define the first encapsulation class and analytical tool;First encapsulation class is embodied as including encapsulating function correspondingly with package interface, encapsulation function is embodied as storing the conditional parameter received in internal container;The conditional parameter that analytical tool is embodied as obtaining the first encapsulation class is parsed, the encapsulation of data type output for meeting JPA framework agreement is obtained.The invention also discloses the systems of SQL statement processing, disclosed system and method according to the present invention, pass through the encapsulation to query sentence of database, realize the purpose of direct application entity class, avoiding will also be operated by hand-written sentence, the threshold of inquiry database manipulation is reduced, and is efficiently facilitated.
Description
Technical field
The present invention relates to sentence processing technology field, especially a kind of implementation method, system and the operation of SQL statement processing
Method.
Background technique
SQL (Structured Query Language, structured query language) is that a kind of data base querying and program are set
Language is counted, for accessing data and querying, updating, and managing relational database system.In existing technology, for SQL or HQL
Query function needs realized by hand-written sentence, when executing certain SQL statements, can usually be consumed due to hand-written sentence
Duration and the low situation of operational efficiency, this will seriously tie down the speed of service of system, elongate page response speed, influence system
Performance, to influence user experience.
Summary of the invention
To solve the above-mentioned problems, it is contemplated that can be substituted by entity class wrapper attribute with opponent's write statement,
And the inquiry operation of tables of data is realized by the operation to attribute.By the encapsulation to query sentence of database, realizes and directly grasp
The purpose for making entity class, avoiding will also be operated by hand-written sentence, reduce the threshold of inquiry database manipulation, and
It is efficiently convenient.
According to the first aspect of the invention, a kind of implementation method of SQL statement processing is provided, is included the following steps:
The package interface for encapsulating querying condition sentence is created, the input parameter definition of package interface is object type
Conditional parameter;
Building the first encapsulation class, the first encapsulation class is embodied as including encapsulating function correspondingly with package interface, is sealed
Dress function is embodied as storing the conditional parameter received in internal container;
Analytical tool is constructed, the conditional parameter that analytical tool is embodied as obtaining the first encapsulation class is parsed, is accorded with
Close the encapsulation of data type output of JPA (Java Persistence API, Java persistent layer API) framework agreement.
According to the second aspect of the invention, a kind of SQL statement processing system is provided, comprising:
For encapsulating the package interface of querying condition sentence, wherein the input parameter definition of package interface is object type
Conditional parameter;
First encapsulation class, including encapsulate function correspondingly with package interface, what encapsulation function was embodied as receiving
Conditional parameter is stored into internal container;
Analytical tool is parsed for obtaining conditional parameter from the first encapsulation class, and generates and meet JPA framework agreement
Encapsulation of data type output
According to the third aspect of the present invention, it provides and a kind of a kind of above-mentioned SQL statement processing system is utilized to realize SQL
The method of operation, includes the following steps:
The object instance of creation the first encapsulation class;
The corresponding encapsulation function of the first encapsulation class is called by object instance and conditional parameter is set;
It calls analytical tool to parse the object instance of the first encapsulation class, obtains encapsulated type data;
It calls third party JPA frame to carry out SQL operation processing to the encapsulated type data, obtains processing result.
According to the fourth aspect of the present invention, a kind of electronic equipment is provided comprising: at least one processor, and
The memory being connect at least one processor communication, wherein memory is stored with the finger that can be executed by least one processor
It enables, instruction is executed by least one processor, so that the step of at least one processor is able to carry out the above method.
According to the fifth aspect of the present invention, a kind of storage medium is provided, computer program is stored thereon with, the program
The step of above method is realized when being executed by processor.
The purpose of direct application entity class may be implemented in the device and method provided according to the present invention, and avoiding will also be through
It receives and distributes write statement to be operated, reduces the threshold of inquiry database manipulation, and efficiently facilitate.
Detailed description of the invention
Fig. 1 is the implementation method functional block diagram that a kind of SQL statement of an embodiment of the present invention is handled;
Fig. 2 is the implementation method that a kind of SQL statement of a further embodiment of this invention is handled;
Fig. 3 is a kind of implementation method of SQL statement processing of another embodiment of the present invention;
Fig. 4 is the system block diagram that the SQL statement of an embodiment of the present invention is handled;
Fig. 5 is the system block diagram that the SQL statement of a further embodiment of this invention is handled;
Fig. 6 is the method flow diagram that SQL operation is realized using SQL statement processing system of an embodiment of the present invention;
Fig. 7 is the electronic device block diagram of an embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.
The present invention can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, member
Part, data structure etc..The present invention can also be practiced in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage equipment.
In the present invention, the fingers such as " module ", " device ", " system " are applied to the related entities of computer, such as hardware, hardware
Combination, software or software in execution with software etc..In detail, for example, element can with but be not limited to run on processing
Process, processor, object, executable element, execution thread, program and/or the computer of device.In addition, running on server
Application program or shell script, server can be element.One or more elements can be in the process and/or thread of execution
In, and element can be localized and/or be distributed between two or multiple stage computers on one computer, and can be by each
Kind computer-readable medium operation.Element can also according to the signal with one or more data packets, for example, from one with
Another element interacts in local system, distributed system, and/or the network in internet passes through signal and other system interactions
The signals of data communicated by locally and/or remotely process.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise", not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or equipment institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence " including ... ", it is not excluded that including described want
There is also other identical elements in the process, method, article or equipment of element.
The invention will now be described in further detail with reference to the accompanying drawings.
Fig. 1 schematically shows a kind of a kind of implementation method of SQL statement processing of embodiment according to the present invention
Flow chart.As shown in Figure 1, the present embodiment includes the following steps:
Step S101: creating the package interface for encapsulating querying condition sentence, and the input parameter definition of package interface is
The conditional parameter of object type.SQL query statement is packaged into the calling interface based on querying condition, the calling being packaged into is connect
Mouthful input parameter setting be object type conditional parameter, enable during research and development developer according to operating pair
The attribute of elephant realizes SQL query operation, without hand-written SQL statement.Illustratively, the package interface of creation may include with
Lower several types: isnull is realized, isnotnull is realized, eq is realized, ne is realized, like is realized.
Step S102: the first encapsulation class is defined as including one-to-one with package interface by building the first encapsulation class
Function is encapsulated, illustratively, first is defined and encapsulates class SpecParam, as follows:
Wherein, the conditional parameter that the encapsulation function in the class SpecParam of definition is embodied as to receive is stored in interior
In portion's container (i.e. memory), i.e., by param1, param2 ... it is stored in internal container.
Step S103: analytical tool is embodied as acquisition input parameter and parsed, met by building analytical tool
The encapsulation of data type of JPA framework agreement exports.Analytical tool is also implemented as to the form of class in the present embodiment, it is exemplary
Ground defines the class SpecUtil for being used as analytical tool, as follows:
SpecUtil{
public static Specification spec(SpecParam param1){...};
...
}
Wherein, the function spec in the class SpecUtil of definition is embodied as to the agreement pair according to used JPA frame
Incoming input parameter param1 is parsed, which is exported at the encapsulation of data type for meeting JPA framework agreement,
Illustratively, the JPA frame used can be Hibernate frame.In specific implementation example, input parameter can be the first envelope
Fill the conditional parameter of class.
It can realize that direct application entity class is real by the encapsulation to query sentence of database according to the method for the present embodiment
The purpose of the inquiry operation of existing tables of data, avoiding will also be operated by hand-written sentence, reduce inquiry database manipulation
Threshold, and efficiently facilitate.
Fig. 2 schematically shows a kind of implementation method stream of SQL statement processing of another embodiment according to the present invention
Cheng Tu, as shown in Figure 2:
The implementation of step S201 to step S202 are referred to the implementation method of step S101 to step S102.
Step S203: the second encapsulation class is embodied as including setting field attribute by building the second encapsulation class.Illustratively,
It defines second and encapsulates class SpecProperty, as follows:
Wherein, the field attribute in the class SpecProperty of definition is the field parameter for needing to inquire, by this way
The restriction to querying condition may be implemented, meet different query demands.
Step S204: when calling first encapsulates the encapsulation function of class, judge whether the encapsulation function currently called needs
Whole fields are inquired, when not needing to inquire whole fields, according to the setting field attribute of conditional parameter setting the second encapsulation class.
The mode of judgement can have following implementation: the first can directly check current type function, according to difference
Type function function judge whether it is to inquire whole fields;Second of item that can be based on preset keyword to acquisition
Whether part parameter is matched, be the processing for needing to inquire whole fields with the corresponding processing of the current conditional parameter of determination.When
When judging result is the non-processing for inquiring whole fields, the field contents for needing to inquire are obtained from conditional parameter, will set word
The value of section attribute is set as the field contents for needing to inquire.
It in this embodiment, can be using the instance objects of the second encapsulation class as defeated after being configured to the second encapsulation class
Enter parameter, to be parsed using instance objects of the analytical tool to the second encapsulation class, i.e., in this case, is passed to parsing work
The input parameter of tool is the corresponding instance objects of the second encapsulation class, and analytical tool will obtain the setting word of the second encapsulation class at this time
Section attribute is parsed, and the encapsulation of data type output for meeting JPA framework agreement is obtained.
It can realize that direct application entity class is real by the encapsulation to query sentence of database according to the method for the present embodiment
The purpose of the inquiry operation of existing tables of data, avoiding will also be operated by hand-written sentence, reduce inquiry database manipulation
Threshold, it is efficiently convenient.And the method for the present embodiment carries out condition setting and screening by the second encapsulation of design class, based on sieve
Condition after choosing realizes database manipulation, meets different application demand and scene.
Fig. 3 schematically shows the implementation method flow chart of the SQL statement processing of another embodiment according to the present invention,
As shown in figure 3, this method comprises the following steps:
Step S301: implementation be referred to the implementation method of step S101.
The implementation of step S302 is referred to the implementation method of step S202.
Step S303: the implementation method of the implementation and step S203 is essentially identical, and difference is in the realization example
Second encapsulation class is embodied as further including polymeric type attribute, wherein the value of polymeric type attribute is also according to incoming condition ginseng
Number is configured.
Step S304: the encapsulation function for judging currently to call is the whole field of non-inquiry and conditional parameter includes polymeric type
When type, according to the setting field attribute of conditional parameter setting the second encapsulation class.The implementation of the step and step S204 are basic
Identical, difference is, when judging result is the non-processing for inquiring whole fields, also according to conditional parameter determine whether include with
The corresponding parameter of this attribute of polymeric type also obtains phase when including parameter corresponding with polymeric type from conditional parameter
Field contents are answered, set respective field content for the value of polymeric type attribute.Illustratively, polymeric type parameter can be system
Parameter such as count, parameters sortnig such as groupby etc. is counted, can be judged based on content of the Keywords matching to conditional parameter.
Step S305: statistical tool is embodied as being polymerize according to the attribute value of the second encapsulation class by building statistical tool
Function encapsulation process, illustratively according to the value of above-mentioned specType, determines the polymerization used with specific reference to polymeric type field
Type function obtains the encapsulation of data type output for meeting JPA framework agreement.Preferably, statistical tool can be implemented as class
Form illustratively defines the class CountUtil for being used as statistical tool, as follows:
Wherein, the function spec in the class CountUtil of definition is embodied as to the agreement pair according to used JPA frame
Incoming input parameter param1 is parsed, which is exported at the encapsulation of data type for meeting JPA framework agreement,
Illustratively, the JPA frame used can be Hibernate frame.In specific implementation example, input parameter is the second encapsulation class
Instance objects.
It can realize that direct application entity class realizes data by the encapsulation to query sentence of database according to the present embodiment
The purpose of the inquiry operation of table, avoiding will also be operated by hand-written sentence, reduce the threshold of inquiry database manipulation,
It is efficiently convenient.And the method for the present embodiment carries out the setting of specific fields attribute by the second encapsulation of design class, passes through building
Statistical tool carries out the encapsulation process of aggregate function, can not only realize that SQL query operates, moreover it is possible to realize other kinds of SQL
Operation such as counts, sorts.
Fig. 4 schematically shows a kind of SQL statement processing system block diagram according to an embodiment of the present invention, such as Fig. 4
It is shown,
A kind of SQL statement processing system includes that package interface 401, first encapsulates class and 402 analytical tools 403.
Package interface 401 is for encapsulating querying condition sentence, wherein the input parameter definition of package interface 401 is object
The conditional parameter of type;
First encapsulation class 402, including encapsulation function, encapsulation function are embodied as to connect correspondingly with package interface 401
The conditional parameter received is stored into internal container;
Analytical tool 403 is used to obtain conditional parameter from input parameter and be parsed, and generates and meet JPA framework agreement
Encapsulation of data type output, wherein the input parameter of analytical tool includes the instance objects of the first encapsulation class.
According to the system of the present embodiment, direct application entity class can be realized by the encapsulation to query sentence of database
The purpose for realizing the inquiry operation of tables of data, avoiding will also be operated by hand-written sentence, reduce inquiry database behaviour
The threshold of work, it is efficiently convenient.
Fig. 5 schematically shows the SQL statement processing system block diagram of another embodiment according to the present invention, such as Fig. 5 institute
Show, further includes on the basis of system system shown in Fig. 4
Second encapsulation class 404, the second encapsulation class 404 includes setting field attribute and polymeric type attribute, wherein setting
The value of field attribute and polymeric type attribute is configured according to the setting condition parameter of input;The setting condition parameter of input can
To be the condition parameter values from the corresponding object instance of the first encapsulation class.
It obtains meeting JPA frame for carrying out aggregate function encapsulation process according to the parameter value of input with statistical tool 405
The encapsulation of data type of frame agreement exports.Wherein, the parameter value of input can be the reality of the second encapsulation class in a particular embodiment
Example object comprising have a setting field attribute value and polymeric type attribute, statistical tool is according to the setting field attribute value of input
Aggregate function encapsulation process is carried out with polymeric type attribute value.
In this embodiment, analytical tool input parameter either first encapsulation class instance objects, can also be
The instance objects of second encapsulation class.
It may be implemented to carry out condition setting and screening by the second encapsulation of design class according to the system of the present embodiment, based on sieve
Condition after choosing realizes database manipulation, meets different application demand and scene.And the second encapsulation of design can also be passed through
Class carries out the setting of specific fields attribute, and the encapsulation process of aggregate function is carried out by building statistical tool, can not only be realized
SQL query operation, moreover it is possible to realize that other kinds of SQL operation such as counts, sorts.
Fig. 6 schematically shows that utilization SQL statement processing system according to an embodiment of the present invention realizes that SQL is operated
Method flow diagram, as shown in fig. 6, the present embodiment includes the following steps:
Step S601: the object instance of creation the first encapsulation class.Illustratively, creation first encapsulates class in the following manner
The object instance specParam of SpecParam:
SpecParam<T>specParam=new SpecParam<>();
Step S602: the corresponding encapsulation function of the first encapsulation class is called by object instance and conditional parameter is set.Example
Property, it is for eq is realized by the encapsulation function of calling, implementation is as follows:
specParam.eq("name","aaaaa").like("info","bbbb");
Thus the calling to the two encapsulation functions of eq and like can be realized, and when calling, by conditional parameter point
It is not set as " name ", " aaaaa ", and " info ", " bbbb ".
Step S603: judge whether it is the whole fields of inquiry and execute step when being judged as non-inquiry whole field
S604 executes step S605 when being judged as inquiry whole field.
Step S604: the object instance of creation the second encapsulation class, and it is real according to object of the conditional parameter to the second encapsulation class
Example carries out attribute value setting.Carry out step S606.
SpecProperty productIdProperty=SpecProperty.forName (" productId ");
Step S605: it calls analytical tool to parse the object instance of the first encapsulation class, obtains encapsulated type data.
Illustratively, the calling to analytical tool is accomplished by the following way:
Specification sp=SpecUtil.spec (specParam);
After obtaining encapsulated type data, the processing of step S606 is carried out.
Step S606: calling third party JPA frame to carry out SQL operation processing to encapsulated type data, obtains processing result.
Wherein, by taking third party's JPA frame is embodied as Hibernate as an example, processing result can be obtained in the following manner:
T details=repository.findAll (sp);
It can be seen that when carrying out SQL operation processing by the operating method, completely without the setting for carrying out SQL statement
And writing, it is only necessary to be called according to class object and processing result can be obtained, improve treatment effeciency, reduce development difficulty.
Fig. 7 schematically shows operating using SQL statement processing system realization SQL for root a further embodiment of this invention
Method flow diagram, as shown in fig. 7, method and step shown in the method and step and Fig. 6 of the present embodiment is essentially identical, difference is
Processing of the embodiment illustrated in fig. 7 in step S704 is realized are as follows:
Step S704: the object instance of creation the second encapsulation class, and it is real according to object of the conditional parameter to the second encapsulation class
Example carries out attribute value setting.Later, judge whether in the conditional parameter of the instance objects of the second encapsulation class include polymeric type
Parameter is called statistical tool to carry out aggregate function encapsulation process to the object instance of the second encapsulation class if including, is sealed
Categorical data is filled, does not include that analytical tool is called to parse the object instance of the second encapsulation class, obtains encapsulation class
Type data.Step S706 is carried out after obtaining encapsulated type data.
In some embodiments, the embodiment of the present invention provides a kind of non-volatile computer readable storage medium storing program for executing, described to deposit
Being stored in storage media one or more includes the programs executed instruction, and executing instruction can be (including but unlimited by electronic equipment
In computer, server or the network equipment etc.) it reads and executes, for executing a kind of SQL language of any of the above-described of the present invention
The implementation method of sentence processing.
In some embodiments, the embodiment of the present invention also provides a kind of computer program product, computer program product packet
The computer program being stored on non-volatile computer readable storage medium storing program for executing is included, computer program includes program instruction, works as institute
When program instruction is computer-executed, computer is made to execute a kind of implementation method of SQL statement processing of any of the above-described.
In some embodiments, the embodiment of the present invention also provides a kind of electronic equipment comprising: at least one processor,
And the memory being connect at least one processor communication, wherein memory, which is stored with, to be executed by least one processor
Instruction, instruction is executed by least one processor, so that at least one processor is able to carry out a kind of reality of SQL statement processing
Existing method.
In some embodiments, the embodiment of the present invention also provides a kind of storage medium, is stored thereon with computer program,
It is characterized in that, a kind of program implementation method of SQL statement processing when being executed by processor.
A kind of SQL statement processing system of the embodiments of the present invention can be used for executing a kind of SQL of the embodiment of the present invention
The implementation method of sentence processing, and reach a kind of realization side for realizing SQL statement processing of the embodiments of the present invention accordingly
Method technical effect achieved, which is not described herein again.Hardware processor (hardware can be passed through in the embodiment of the present invention
Processor) Lai Shixian related function module.
Method provided by the embodiment of the present application can be performed in the said goods, has the corresponding functional module of execution method and has
Beneficial effect.The not technical detail of detailed description in the present embodiment, reference can be made to method provided by the embodiment of the present application.
The electronic equipment of the embodiment of the present application exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) car-mounted device: this kind of equipment application may be implemented and the companies such as other auxiliary systems of automobile in vehicle carried driving
It connects.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic devices with data interaction function.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It is realized by the mode of software plus general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, above-mentioned technology
Scheme substantially in other words can be embodied in the form of software products the part that the relevant technologies contribute, the computer
Software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions to
So that computer equipment (can be personal computer, server or the network equipment etc.) execute each embodiment or
Method described in certain parts of embodiment.
Finally, it should be noted that above embodiments are only to illustrate the technical solution of the application, rather than its limitations;Although
The application is described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it still may be used
To modify the technical solutions described in the foregoing embodiments or equivalent replacement of some of the technical features;
And these are modified or replaceed, each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution spirit and
Range.
Claims (10)
1. a kind of implementation method of SQL statement processing, which comprises the steps of:
The package interface for encapsulating querying condition sentence is created, the input parameter definition of the package interface is object type
Conditional parameter;
Building the first encapsulation class, the first encapsulation class is embodied as including encapsulating function correspondingly with the package interface, institute
Encapsulation function is stated to be embodied as storing the conditional parameter received in internal container;
Analytical tool is constructed, analytical tool is embodied as acquisition input parameter and is parsed, the envelope for meeting JPA framework agreement is obtained
Fill data type output, wherein the input parameter of the analytical tool includes the instance objects of the first encapsulation class.
2. the method according to claim 1, wherein the method also includes
Building the second encapsulation class, the second encapsulation class is embodied as to include setting field attribute, wherein the setting field attribute
Value is set as the value of the conditional parameter of input;
The input parameter of the analytical tool further includes the instance objects of the second encapsulation class.
3. the second encapsulation class is embodied as further including polymeric type attribute according to the method described in claim 2, wherein,
Value is configured according to the conditional parameter of input, the method also includes
Define statistical tool;
Statistical tool will be defined to be embodied as carrying out aggregate function encapsulation process according to the attribute value of the second encapsulation class, met
The encapsulation of data type of JPA framework agreement exports.
4. a kind of SQL statement processing system, which is characterized in that including
For encapsulating the package interface of querying condition sentence, wherein the input parameter definition of the package interface is object type
Conditional parameter;
First encapsulation class, including function is encapsulated correspondingly with the package interface, the encapsulation function is embodied as to receive
To conditional parameter store into internal container;
Analytical tool is parsed for obtaining conditional parameter from input parameter, and generates the encapsulation for meeting JPA framework agreement
Data type output, wherein the input parameter of the analytical tool includes the instance objects of the first encapsulation class.
5. system according to claim 4, which is characterized in that further include
Second encapsulation class, including setting field attribute and polymeric type attribute, the setting field attribute and polymeric type attribute
Value be configured according to the setting condition parameter of input;
Wherein, the input parameter of the analytical tool further includes the instance objects of the second encapsulation class.
6. system according to claim 5, which is characterized in that the system also includes
Statistical tool, for carrying out aggregate function envelope according to the setting field attribute value and polymeric type attribute value of the second encapsulation class
Dress processing obtains the encapsulation of data type output for meeting JPA framework agreement.
7. the method for realizing SQL operation using the described in any item systems of claim 4 to 6, which is characterized in that including
The object instance of creation the first encapsulation class;
The corresponding encapsulation function of the first encapsulation class is called by the object instance and conditional parameter is set;
It calls analytical tool to parse the object instance of the first encapsulation class, obtains encapsulated type data;
It calls third party JPA frame to carry out SQL operation processing to the encapsulated type data, obtains processing result.
8. the method according to the description of claim 7 is characterized in that in the phase for calling the first encapsulation class by the object instance
Function should be encapsulated and conditional parameter is set and further include later
According to the conditional parameter of the encapsulation function and setting of calling, the whole fields of inquiry are judged whether it is;
When judging non-inquiry whole field, following operation is executed:
The object instance of creation the second encapsulation class;
Attribute value setting is carried out according to object instance of the conditional parameter to the second encapsulation class;
It calls analytical tool to parse the object instance of the second encapsulation class, obtains encapsulated type data;
It calls third party JPA frame to carry out SQL operation processing to the encapsulated type data, obtains processing result;
It is being judged as that when inquiring whole fields, execution is following to be operated:
It calls analytical tool to parse the object instance of the first encapsulation class, obtains encapsulated type data;
It calls third party JPA frame to carry out SQL operation processing to the encapsulated type data, obtains processing result.
9. according to the method described in claim 8, it is characterized in that, the attribute value being arranged in the object instance to the second encapsulation class
When including polymeric type, third party JPA frame is being called to carry out SQL operation processing, acquisition processing to the encapsulated type data
As a result further include before
It calls statistical tool to carry out aggregate function encapsulation process according to the polymeric type offset of the object instance of the second encapsulation class, obtains
Encapsulated type data.
10. method according to any one of claims 7 to 9, which is characterized in that the JPA frame is Hibernate frame
Frame.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811613476.7A CN109739872A (en) | 2018-12-27 | 2018-12-27 | A kind of implementation method, system and the operating method of SQL statement processing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811613476.7A CN109739872A (en) | 2018-12-27 | 2018-12-27 | A kind of implementation method, system and the operating method of SQL statement processing |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109739872A true CN109739872A (en) | 2019-05-10 |
Family
ID=66360196
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811613476.7A Pending CN109739872A (en) | 2018-12-27 | 2018-12-27 | A kind of implementation method, system and the operating method of SQL statement processing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109739872A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111259043A (en) * | 2020-01-09 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Method, device, computer storage medium and terminal for realizing information processing |
CN112433708A (en) * | 2020-12-01 | 2021-03-02 | 四川长虹电器股份有限公司 | Method for improving JPA standard query coding efficiency |
CN113535140A (en) * | 2020-04-16 | 2021-10-22 | 武汉斗鱼网络科技有限公司 | Parameter packaging method, device, equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105447051A (en) * | 2014-09-22 | 2016-03-30 | 普天信息技术有限公司 | Database operation method and device |
US20160103882A1 (en) * | 2012-09-28 | 2016-04-14 | Oracle International Corporation | Configurable data windows for archived relations |
CN105653277A (en) * | 2015-12-29 | 2016-06-08 | 上海建坤信息技术有限责任公司 | Method for querying appointed field data of data table under simplified JAVA program, multi-table conjunctive query method under simplified JAVA program and statistical query method under simplified JAVA program |
CN106708946A (en) * | 2016-11-25 | 2017-05-24 | 国云科技股份有限公司 | Universal API table query method |
CN107992566A (en) * | 2017-11-29 | 2018-05-04 | 北京天健通泰科技有限公司 | Data mapping method and system based on Hibernate |
-
2018
- 2018-12-27 CN CN201811613476.7A patent/CN109739872A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160103882A1 (en) * | 2012-09-28 | 2016-04-14 | Oracle International Corporation | Configurable data windows for archived relations |
CN105447051A (en) * | 2014-09-22 | 2016-03-30 | 普天信息技术有限公司 | Database operation method and device |
CN105653277A (en) * | 2015-12-29 | 2016-06-08 | 上海建坤信息技术有限责任公司 | Method for querying appointed field data of data table under simplified JAVA program, multi-table conjunctive query method under simplified JAVA program and statistical query method under simplified JAVA program |
CN106708946A (en) * | 2016-11-25 | 2017-05-24 | 国云科技股份有限公司 | Universal API table query method |
CN107992566A (en) * | 2017-11-29 | 2018-05-04 | 北京天健通泰科技有限公司 | Data mapping method and system based on Hibernate |
Non-Patent Citations (1)
Title |
---|
ITEYE_6350: "一个对JPA查询的封装服务类", 《CSDN: HTTPS://BLOG.CSDN.NET/ITEYE_6350/ARTICLE/DETAILS/82550921》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111259043A (en) * | 2020-01-09 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Method, device, computer storage medium and terminal for realizing information processing |
CN113535140A (en) * | 2020-04-16 | 2021-10-22 | 武汉斗鱼网络科技有限公司 | Parameter packaging method, device, equipment and storage medium |
CN112433708A (en) * | 2020-12-01 | 2021-03-02 | 四川长虹电器股份有限公司 | Method for improving JPA standard query coding efficiency |
CN112433708B (en) * | 2020-12-01 | 2021-12-21 | 四川长虹电器股份有限公司 | Method for improving JPA standard query coding efficiency |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108667925B (en) | Method and system for seamless access of WEB application to distributed system | |
CN104125208B (en) | Data transmission method and device | |
US7877091B2 (en) | Method and system for executing a container managed application on a processing device | |
WO2020228063A1 (en) | Method and device for developing service functions | |
CN106649630A (en) | Data query method and device | |
CN109739872A (en) | A kind of implementation method, system and the operating method of SQL statement processing | |
US9477787B2 (en) | Method and apparatus for information clustering based on predictive social graphs | |
CN112181542A (en) | Function calling method and device, electronic equipment and storage medium | |
CN105468709A (en) | Data inquiry device and data inquiry method based on HBase | |
CN110737425B (en) | Method and device for establishing application program of charging platform system | |
CN109522307A (en) | Server, the declaration form data query method based on Mongodb and storage medium | |
CN108959294B (en) | Method and device for accessing search engine | |
CN107479870A (en) | A kind of third party's class libraries call method, device, mobile terminal and storage medium | |
CN109597825B (en) | Rule engine calling method, device, equipment and computer readable storage medium | |
CN113434315B (en) | Interface management method and device, storage medium and electronic equipment | |
CN112905273A (en) | Service calling method and device | |
WO2023125773A1 (en) | Global exception handling method and platform in large-scale micro-service cluster scenario | |
CN116185495B (en) | Computing function construction method, computing engine, electronic device and readable storage medium | |
CN109783132B (en) | Method and device for realizing system singleization and distribution | |
CN110764769A (en) | Method and device for processing user request | |
CN113591448B (en) | Report generation method, device and storage medium | |
CN105260179A (en) | Method for achieving flex and servlet interaction | |
CN113626001A (en) | API dynamic editing method and device based on script | |
CN111104098A (en) | Method for developing hybrid App based on JSbridge | |
CN116756460B (en) | Combined data acquisition method and device and related equipment |
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 | ||
CB02 | Change of applicant information |
Address after: 215123 building 14, Tengfei Innovation Park, 388 Xinping street, Suzhou Industrial Park, Suzhou City, Jiangsu Province Applicant after: Sipic Technology Co.,Ltd. Address before: 215123 building 14, Tengfei Innovation Park, 388 Xinping street, Suzhou Industrial Park, Suzhou City, Jiangsu Province Applicant before: AI SPEECH Ltd. |
|
CB02 | Change of applicant information |