CN109271403A - A kind of operating method of data query, device, medium and electronic equipment - Google Patents
A kind of operating method of data query, device, medium and electronic equipment Download PDFInfo
- Publication number
- CN109271403A CN109271403A CN201811139814.8A CN201811139814A CN109271403A CN 109271403 A CN109271403 A CN 109271403A CN 201811139814 A CN201811139814 A CN 201811139814A CN 109271403 A CN109271403 A CN 109271403A
- Authority
- CN
- China
- Prior art keywords
- query
- instance class
- class
- data query
- instance
- 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 embodiment of the invention provides a kind of operating method of data query, device, medium and electronic equipments, comprising: in response to acquired data query parameter, generation includes the first instance class according to query argument;First instance class is parsed, query statement is generated, execute query statement and obtains query result;Second instance class is written into query result, and is exported.The technical solution of the embodiment of the present invention can be avoided a large amount of hand-written SqlMap, support that additions and deletions change and complex query operates simultaneously, substantially increase the development efficiency of system, reduce many repeated codes, reduce the complexity using O&M, it is more clear code logic, code organization more standardizes.
Description
Technical field
The present invention relates to field of computer technology, in particular to a kind of operating method of data query, device, Jie
Matter and electronic equipment.
Background technique
Current internet company generally uses iBatis/MyBatis to relationship map (ORM, Object in application layer
Relational Mapping) frame carries out database model modeling, and operates to database.
When using iBatis/MyBatis, by SqlMapConfig.xml configuration file as entrance, configuration data
Source and all SqlMap files;Wherein, specific sql command needs developer to be handwriting in individual SqlMap file,
One SqlMap configuration, needs to define parameter object, SQL template and return structure, and every SqlMap configuration needs specified
One SQL ID when Java code layer needs to be implemented some sql command, is needing to specify corresponding SQL ID, and incoming phase
The parameter list answered, iBatis/MyBatis frame can find the SQL template in SqlMap according to SQL ID, be placed into corresponding ginseng
Number, is sent to database;Database executes SQL and instructs and return, and iBatis/MyBatis frame can be configured according in SqlMap
Return type, database return value is parsed, is processed.
Although being easy to operate using the mode of the hand-written SQL of iBatis/MyBatis ORM frame, fast and flexible, for big
Type project still suffers from following defect:
(1) work of a large amount of hand-written SqlMap, tedious and easy error are needed;
(2) with the promotion of project complexity, the multiplicity of query logic, the SQL definition being defined in SqlMap can be more next
It is more, it appears more and more in disorder and uncontrollable;
(3) related in research staff SqlMap all before needing to be traversed for once there is the needs of database change field
The SQL of the field, is slightly omitted, and will cause run time error.
It should be noted that information is only used for reinforcing the reason to background of the invention disclosed in above-mentioned background technology part
Solution, therefore may include the information not constituted to the prior art known to persons of ordinary skill in the art.
Summary of the invention
The operating method for being designed to provide a kind of data query, device, medium and the electronic equipment of the embodiment of the present invention,
And then the work for needing to carry out a large amount of hand-written sqlMap in the related technology, the SQL in SqlMap are overcome at least to a certain extent
Definition can become increasingly complex and easily cause one or more problems of run-time error.
Other characteristics and advantages of the invention will be apparent from by the following detailed description, or partially by the present invention
Practice and acquistion.
According to a first aspect of the embodiments of the present invention, a kind of operating method of data query is provided, comprising:
In response to acquired data query parameter, generation includes the first instance class according to query argument;
First instance class is parsed, query statement is generated, execute query statement and obtains query result;
Second instance class is written into query result, and is exported.
In one embodiment of the invention, above-mentioned generation includes to include: according to the first instance class of query argument
After obtaining data query parameter, by calling post method that data query parameter is transferred to controller layers;
According to preset inquiry field, data query parameter is written to first instance class at controller layers;
First instance class is transferred to Dao layers to parse.
In one embodiment of the invention, above-mentioned to parse to first instance class, generating query statement includes:
First instance class is parsed, the information that first instance class is included is obtained;
According to default rule, the information that first instance class is included is converted into query statement.
In one embodiment of the invention, it above-mentioned execution query statement and obtains query result and includes:
Query statement is placed in caching, and preset querying method is called to execute query statement, obtains looking into for map type
Ask result.
In one embodiment of the invention, above-mentioned that second instance class is written into query result, export second instance class packet
It includes:
Based on java reflection mechanism, the key assignments in query result is sequentially written in preset second instance class;
Second instance class is back to controller layers, and is page data, direction view layer by second instance class wrapper
It sends.
According to a second aspect of the embodiments of the present invention, a kind of operating device of data query is provided, comprising:
Generation module, in response to acquired data query parameter, generation to include the first reality according to query argument
Body class;
Enquiry module generates query statement, executes query statement and obtain inquiry for parsing to first instance class
As a result;
Output module for second instance class to be written in query result, and exports
In one embodiment of the invention, above-mentioned generation module is specifically used for:
After obtaining data query parameter, by calling post method that data query parameter is transferred to controller layers;
According to preset inquiry field, data query parameter is written to first instance class at controller layers;
First instance class is transferred to Dao layers to parse.
In one embodiment of the invention, above-mentioned enquiry module is specifically used for:
First instance class is parsed, the information that first instance class is included is obtained;
According to default rule, the information that first instance class is included is converted into query statement.
In one embodiment of the invention, above-mentioned enquiry module is also used to:
Query statement is placed in caching, and preset querying method is called to execute query statement, obtains looking into for map type
Ask result.
In one embodiment of the invention, above-mentioned output module is specifically used for:
Based on java reflection mechanism, the key assignments in query result is sequentially written in preset second instance class;
Second instance class is back to controller layers, and is page data, direction view layer by second instance class wrapper
It sends.
According to a third aspect of the embodiments of the present invention, a kind of computer-readable medium is provided, computer is stored thereon with
Program realizes the operating method such as the data query of first aspect in above-described embodiment when above procedure is executed by processor.
According to a fourth aspect of the embodiments of the present invention, a kind of electronic equipment is provided, comprising: one or more processors;
Storage device, for storing one or more programs, when one or more programs are executed by one or more processors, so that
One or more processors realize the operating method such as the data query of first aspect in above-described embodiment.
Technical solution provided in an embodiment of the present invention can include the following benefits:
The embodiment of the invention provides a kind of operating method of data query, device, medium and electronic equipments, comprising: rings
Data query parameter acquired in Ying Yu, generation include the first instance class according to query argument;First instance class is solved
Analysis generates query statement, executes query statement and obtains query result;Second instance class is written into query result, and is exported.This
The technical solution of inventive embodiments can be avoided a large amount of hand-written SqlMap, while support that additions and deletions change and complex query operates, greatly
The development efficiency for improving system greatly reduces many repeated codes, reduces the complexity using O&M, make code logic
It is more clear, code organization more standardizes.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not
It can the limitation present invention.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention
Example, and be used to explain the principle of the present invention together with specification.It should be evident that the accompanying drawings in the following description is only the present invention
Some embodiments for those of ordinary skill in the art without creative efforts, can also basis
These attached drawings obtain other attached drawings.In the accompanying drawings:
Fig. 1 diagrammatically illustrates the flow chart of data query according to an embodiment of the invention;
Fig. 2 diagrammatically illustrates the work flow diagram according to an embodiment of the invention for realizing data query;
Fig. 3 diagrammatically illustrates generation StudentScoreQuery entity class according to an embodiment of the invention
Schematic diagram;
Fig. 4 diagrammatically illustrates the signal according to an embodiment of the invention for generating StudentScore entity class
Figure;
Fig. 5 diagrammatically illustrates the block diagram of the operating device of data query according to an embodiment of the invention;
Fig. 6 shows the structural schematic diagram for being suitable for the computer system for the electronic equipment for being used to realize the embodiment of the present invention.
Specific embodiment
Example embodiment is described more fully with reference to the drawings.However, example embodiment can be with a variety of shapes
Formula is implemented, and is not understood as limited to example set forth herein;On the contrary, thesing embodiments are provided so that the present invention will more
Fully and completely, and by the design of example embodiment comprehensively it is communicated to those skilled in the art.
In addition, described feature, structure or characteristic can be incorporated in one or more implementations in any suitable manner
In example.In the following description, many details are provided to provide and fully understand to the embodiment of the present invention.However,
It will be appreciated by persons skilled in the art that technical solution of the present invention can be practiced without one or more in specific detail,
Or it can be using other methods, constituent element, device, step etc..In other cases, it is not shown in detail or describes known side
Method, device, realization or operation are to avoid fuzzy each aspect of the present invention.
Block diagram shown in the drawings is only functional entity, not necessarily must be corresponding with physically separate entity.
I.e., it is possible to realize these functional entitys using software form, or realized in one or more hardware modules or integrated circuit
These functional entitys, or these functional entitys are realized in heterogeneous networks and/or processor device and/or microcontroller device.
Flow chart shown in the drawings is merely illustrative, it is not necessary to including all content and operation/step,
It is not required to execute by described sequence.For example, some operation/steps can also decompose, and some operation/steps can close
And or part merge, therefore the sequence actually executed is possible to change according to the actual situation.
Fig. 1 diagrammatically illustrates the flow chart of data query according to an embodiment of the invention.
Shown in referring to Fig.1, the operating method of data query according to an embodiment of the invention includes the following steps:
Step S110, in response to acquired data query parameter, generation includes the first instance class according to query argument.
In one embodiment of the invention, after obtaining data query parameter, by calling post method by data query
Parameter is transferred to controller layers;According to preset inquiry field, controller layers by data query parameter be written to
First instance class;First instance class is transferred to Dao layers to parse.
In one embodiment of the invention, it can be and user obtained by user interface (UI, User Interface)
The data query parameter filled in, above-mentioned UI can be by HyperText Markup Language (HTML, Hyper Text Markup
Language it) designs.
It in one embodiment of the invention, can be in hypertext transfer protocol (HTTP, HyperText Transfer
Protocol call POST method that the data query parameter that user is filled in is transferred to controller layers in), at this
Object in controller layers can be by automatically generating corresponding to data query parameter based on BaseQuery entity class
One entity class receives above-mentioned data query parameter, wherein the above-mentioned first instance class automatically generated based on BaseQuery entity class
Including there are many inquiry word sections, such as: _ IN (inquiry of text+numerical value data type), _ GE (data for the numerical value being more than or equal to
Type queries), inquiry field, the field such as _ LE (data type less than or equal to numerical value is inquired) are inherited in above-mentioned
BaseQuery entity class.
In one embodiment of the invention, first instance class generated is the reality for possessing all query functions
Body class, alternative original Domian domain model, the Model layer in MVC can be used directly such, and user's record is collected in interface
Enter parameter, and Controller layers incoming, is directly inquired using Service and return to user as a result, centre does not need
Any Parameter Switch enhances code versatility, simplifies the exploitation of applied business logic.
In one embodiment of the invention, if without specific logical, Controller layers directly by first instance
Class is transferred to Service layers;If Service layers are directly transmitted first instance class at Service layers without specific logical
To Dao layers.
Step S120 parses first instance class, generates query statement, executes query statement and obtains inquiry knot
Fruit.
In one embodiment of the invention, first instance class is parsed, obtains the letter that first instance class is included
Breath;According to default rule, the information that first instance class is included is converted into query statement.
In one embodiment of the invention, the find method of base class can will be above-mentioned by reflection mechanism in Dao layers
Data query parameter in first instance class is read, and is joined read-out data query according to the preset rules of Query entity
Number is converted to query statement, such as the query statement of structured query language (SQL, Structured Query Language).
In one embodiment of the invention, above-mentioned query statement is placed in caching, and calls preset querying method
Query statement is executed, the query result of map type is obtained.
In one embodiment of the invention, it can be realized by iBatis/MyBatis and execute query statement, specifically,
Above-mentioned query statement can be placed in the SqlMap caching of iBatis/MyBatis, that is, realize without hand-written SqlMap, move
The demand of state generation SqlMap;After the SQL query statement merging SqlMap caching of above-mentioned dynamic generation, iBatis/ can be called
The method that MyBatis is provided executes the SQL query statement, obtains query result, wherein the subsequent interaction with database is still
Give the processing of iBatis/MyBatis frame.
In one embodiment of the invention, the rule of the first instance class of generation can be as shown in the table:
Wherein, by rule shown in upper table, application developer only needs to design database table structure, passes through tool
Respective code is generated, all operationss function (including complex query) for this table can be possessed, it is tedious without writing again
SQLMap further when database table structure changes, can cover original Pojo and Query class, i.e., by tool
Seamless switching can be achieved, if field change, compiler can prompt compile-time error, avoid occurring wrong when indiscoverable operation
Accidentally.
Query result is written second instance class, and exported by step S130.
In one embodiment of the invention, it is based on java reflection mechanism, the key assignments in query result is sequentially written in pre-
If second instance class in;Second instance class is back to controller layers, and is page data by second instance class wrapper,
Direction view layer is sent.
In one embodiment of the invention, it is looked by obtained after iBatis/MyBatis execution SQL query statement
Asking result can be the query result of Map form, according to default rule and reflection mechanism, by the inquiry of above-mentioned Map form
As a result each key assignments in is sequentially written in second instance class.
In one embodiment of the invention, the query result data for being packaged into second instance class are received for Dao layers
Afterwards, which is returned to Service layers;Service layers can be placed in service logic (if nothing to the query result
Specific logical can be returned directly), and it is back to Controller layers;Controller layers obtain query result post package into user
Page data returns to view layer, to respond the inquiry instruction of user.
Below by way of Students' Score List concrete application embodiment to the operating method of data query proposed by the invention
It is described in detail.
Fig. 2 diagrammatically illustrates the work flow diagram according to an embodiment of the invention for realizing data query.
Referring to shown in Fig. 2, the workflow according to an embodiment of the invention for realizing data query, including it is as follows
Step:
Step S201 obtains data query parameter from user UI;
Data query parameter is mapped as StudentScoreQuery entity class by step S202;
In one embodiment of the invention, user is in front end typing querying condition, and uses the post in http agreement
Parameter is transferred to Controller layers by method, at this time in Controller layers of field layer object, can be used directly
StudentScoreQuery entity class receives parameter.Because containing a variety of inquiries in StudentScoreQuery entity class
Field (_ IN, _ GE, _ LE etc.), can meet all query requirements under normal conditions, right so as to avoid independent definition field layer
As reducing developer and writing code operation amount.
In one embodiment of the invention, if without Controller layers of specific logical can directly by
StudentScoreQuery entity class is transferred to Service layers.
Fig. 3 diagrammatically illustrates generation StudentScoreQuery entity class according to an embodiment of the invention
Schematic diagram.
In one embodiment of the invention, as shown in figure 3, will be generated according to the Code Generator that frame provides
StudentScoreQuery entity class, the StudentScoreQuery entity class are inherited from BaseQuery, for the inquiry of the table
Entity, by the entity class, it can be achieved that the query composition of various complex logics.
Step S203 directly increases service logic on the basis of StudentScoreQuery entity class;
In one embodiment of the invention, if without Service layers of specific logical can directly by
StudentScoreQuery entity class is transferred to Dao layers.
Step S204 calls BaseDao base class find method to carry out inquiry operation;
Step S205 generates SQl query statement according to StudentScoreQuery entity class, is placed into SQLMap caching
In;
In one embodiment of the invention, in the find method of base class, it can utilize reflection mechanism will
All the elements in StudentScoreQuery entity class are read, and according to the preset rules of Query entity, by Context resolution
It at SQL statement, is placed into the SqlMap caching of iBatis/MyBatis, and then realizes without hand-written SqlMap, dynamic is raw
At the demand of SqlMap;
Step S206, iBatis/MyBatis execution database query operations simultaneously return to query result;
In one embodiment of the invention, it after the SQL statement merging SqlMap caching of dynamic generation, can call
The method that iBatis/MyBatis is provided executes the SQL, subsequent still to give iBatis/MyBatis frame with database interaction
Frame processing.
Query result is encapsulated into StudentScore entity by step S207;
In one embodiment of the invention, the query result that iBatis/MyBatis is returned is Map form, this programme meeting
According to rule, using Java reflection mechanism, the key assignments data in Map are successively written to StudentScore entity class.
Fig. 4 diagrammatically illustrates the signal according to an embodiment of the invention for generating StudentScore entity class
Figure.
In one embodiment of the invention, as shown in figure 4, will be generated according to the Code Generator that frame provides
StudentScore entity class, the entity class are inherited from BasePojo, represent the completion mapping of a data in database.
The query result of S208, Dao layers of step acquisition StudentScore entity class;
The query result data of StudentScore type are returned to Service layers by S209, Dao layers of step;
Step S210, Service layer obtain the query result data of Dao layers of return, and carry out business logic processing;
In one embodiment of the invention, industry can be placed in the query result of StudentScore type for Service layers
It is engaged in logic (if can directly be returned without specific logical), and Controller layers of return value.
Step S211, Controller layer obtain query result and are packaged into User Page data, return to view layer;
Step S212, user UI show query result.
The embodiment of the invention provides a kind of operating methods of data query, are open source ORM frame MyBatis/Ibatis
On the basis of the secondary extension that carries out, realize strictly regulating for database access layer and database physical table structure, do not need hand
SqlMap is write, has both defaulted and has supported that additions and deletions change and complex query operates, in this way, substantially increasing the development efficiency of system, reduced
Many repeatability codes, reduce the complexity using O&M, are more clear code logic, code organization more standardizes, together
When, it is integrated with SQL monitoring tools in frame, once there is slow inquiry to occur, can easily pass through built-in SQL monitoring tools,
Navigate to specific code word, code line, to facilitate developer to optimize inquiry, and for database create certain
Table is opened, the tool provided using this programme can automatically generate corresponding Bean, QueryBean, Dao, Service layer identification code.
The device of the invention embodiment introduced below can be used for executing the operation side of the above-mentioned data query of the present invention
Method.
Fig. 5 diagrammatically illustrates the block diagram of the operating device of data query according to an embodiment of the invention.
Referring to Figure 5, the operating device 500 of data query according to an embodiment of the invention, comprising:
Generation module 501, in response to acquired data query parameter, generation to include first according to query argument
Entity class;
Enquiry module 502 generates query statement, executes query statement and obtain for parsing to first instance class
Query result;
Output module 503 for second instance class to be written in query result, and exports
In one embodiment of the invention, above-mentioned generation module 501 is specifically used for:
After obtaining data query parameter, by calling post method that data query parameter is transferred to controller layers;
According to preset inquiry field, data query parameter is written to first instance class at controller layers;
First instance class is transferred to Dao layers to parse.
In one embodiment of the invention, above-mentioned enquiry module 502 is specifically used for:
First instance class is parsed, the information that first instance class is included is obtained;
According to default rule, the information that first instance class is included is converted into query statement.
In one embodiment of the invention, above-mentioned enquiry module 502 is also used to:
Query statement is placed in caching, and preset querying method is called to execute query statement, obtains looking into for map type
Ask result.
In one embodiment of the invention, above-mentioned output module 503 is specifically used for:
Based on java reflection mechanism, the key assignments in query result is sequentially written in preset second instance class;
Second instance class is back to controller layers, and is page data, direction view layer by second instance class wrapper
It sends.
Due to each functional module and above-mentioned first party of the operating device of the data query of example embodiments of the present invention
The step of example embodiment of the operating method of the data query in face, is corresponding, therefore for not disclosing in apparatus of the present invention embodiment
Details, please refer to the operating method of the data query of the above-mentioned first aspect of the present invention.
Below with reference to Fig. 6, it illustrates the computer systems 600 for the electronic equipment for being suitable for being used to realize the embodiment of the present invention
Structural schematic diagram.The computer system 600 of electronic equipment shown in Fig. 6 is only an example, should not be to the embodiment of the present invention
Function and use scope bring any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in
Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and
Execute various movements appropriate and processing.In RAM 603, it is also stored with various programs and data needed for system operatio.CPU
601, ROM 602 and RAM 603 is connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to bus
604。
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.;
And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because
The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon
Computer program be mounted into storage section 608 as needed.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 609, and/or from detachable media
611 are mounted.When the computer program is executed by central processing unit (CPU) 601, executes and limited in the system of the application
Above-mentioned function.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter
Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not
Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter
The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires
Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage
Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device,
Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey
The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this
In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium
Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more
Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box
The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical
On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants
It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule
The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction
It closes to realize.
Being described in unit involved in the embodiment of the present invention can be realized by way of software, can also be by hard
The mode of part realizes that described unit also can be set in the processor.Wherein, the title of these units is in certain situation
Under do not constitute restriction to the unit itself.
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when the electronics is set by one for said one or multiple programs
When standby execution, so that the electronic equipment realizes the operating method such as the data query in above-described embodiment.
For example, above-mentioned electronic equipment may be implemented as shown in Figure 1: step S110, in response to acquired data
Query argument, generation include the first instance class according to query argument;Step S120 parses first instance class, generates
Query statement executes query statement and obtains query result;Query result is written second instance class, and exported by step S130.
It should be noted that although being referred to several modules or list for acting the equipment executed in the above detailed description
Member, but this division is not enforceable.In fact, embodiment according to the present invention, it is above-described two or more
Module or the feature and function of unit can embody in a module or unit.Conversely, an above-described mould
The feature and function of block or unit can be to be embodied by multiple modules or unit with further division.
Through the above description of the embodiments, those skilled in the art is it can be readily appreciated that example described herein is implemented
Mode can also be realized by software realization in such a way that software is in conjunction with necessary hardware.Therefore, according to the present invention
The technical solution of embodiment can be embodied in the form of software products, which can store non-volatile at one
Property storage medium (can be CD-ROM, USB flash disk, mobile hard disk etc.) in or network on, including some instructions are so that a calculating
Equipment (can be personal computer, server, touch control terminal or network equipment etc.) executes embodiment according to the present invention
Method.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to of the invention its
Its embodiment.This application is intended to cover any variations, uses, or adaptations of the invention, these modifications, purposes or
Person's adaptive change follows general principle of the invention and including the undocumented common knowledge in the art of the present invention
Or conventional techniques.The description and examples are only to be considered as illustrative, and true scope and spirit of the invention are by following
Claim is pointed out.
It should be understood that the present invention is not limited to the precise structure already described above and shown in the accompanying drawings, and
And various modifications and changes may be made without departing from the scope thereof.The scope of the present invention is limited only by the attached claims.
Claims (12)
1. a kind of operating method of data query characterized by comprising
In response to acquired data query parameter, generation includes the first instance class according to query argument;
The first instance class is parsed, query statement is generated, executes the query statement and obtain query result;
Second instance class is written into the query result, and is exported.
2. the operating method of data query according to claim 1, which is characterized in that the generation include it is described it is investigated that
Ask parameter first instance class include:
After obtaining the data query parameter, by calling post method that the data query parameter is transferred to controller
Layer;
According to preset inquiry field, the data query parameter is written to the first instance at described controller layers
Class;
The first instance class is transferred to Dao layers to parse.
3. the operating method of data query according to claim 1, which is characterized in that it is described to the first instance class into
Row parsing, generating query statement includes:
The first instance class is parsed, the information that the first instance class is included is obtained;
According to default rule, the information that the first instance class is included is converted into query statement.
4. the operating method of data query according to claim 1, which is characterized in that described to execute the query statement simultaneously
Obtaining query result includes:
The query statement is placed in caching, and preset querying method is called to execute the query statement, obtains map type
Query result.
5. the operating method of data query according to claim 1, which is characterized in that described that the query result is written
Second instance class, exporting the second instance class includes:
Based on java reflection mechanism, the key assignments in the query result is sequentially written in the preset second instance class;
The second instance class is back to controller layers, and is page data by the second instance class wrapper, to view
Figure layer is sent.
6. a kind of operating device of data query characterized by comprising
Generation module, in response to acquired data query parameter, generation to include first reality according to query argument
Body class;
Enquiry module generates query statement, executes the query statement and obtain for parsing to the first instance class
Query result;
Output module for second instance class to be written in the query result, and exports.
7. the operating device of data query according to claim 6, which is characterized in that the generation module is specifically used for:
After obtaining the data query parameter, by calling post method that the data query parameter is transferred to controller
Layer;
According to preset inquiry field, the data query parameter is written to the first instance at described controller layers
Class;
The first instance class is transferred to Dao layers to parse.
8. the operating device of data query according to claim 6, which is characterized in that the enquiry module is specifically used for:
The first instance class is parsed, the information that the first instance class is included is obtained;
According to default rule, the information that the first instance class is included is converted into query statement.
9. the operating device of data query according to claim 6, which is characterized in that the enquiry module is also used to:
The query statement is placed in caching, and preset querying method is called to execute the query statement, obtains map type
Query result.
10. the operating device of data query according to claim 6, which is characterized in that the output module is specifically used for:
Based on java reflection mechanism, the key assignments in the query result is sequentially written in the preset second instance class;
The second instance class is back to controller layers, and is page data by the second instance class wrapper, to view
Figure layer is sent.
11. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor
The operating method of the data query as described in any one of claims 1 to 5 is realized when row.
12. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs, when one or more of programs are by one or more of processing
When device executes, so that one or more of processors realize the behaviour of the data query as described in any one of claims 1 to 5
Make method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811139814.8A CN109271403A (en) | 2018-09-28 | 2018-09-28 | A kind of operating method of data query, device, medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811139814.8A CN109271403A (en) | 2018-09-28 | 2018-09-28 | A kind of operating method of data query, device, medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109271403A true CN109271403A (en) | 2019-01-25 |
Family
ID=65198794
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811139814.8A Pending CN109271403A (en) | 2018-09-28 | 2018-09-28 | A kind of operating method of data query, device, medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109271403A (en) |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110765152A (en) * | 2019-09-18 | 2020-02-07 | 平安科技(深圳)有限公司 | SQL extraction method and device, computer equipment and storage medium |
CN111259043A (en) * | 2020-01-09 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Method, device, computer storage medium and terminal for realizing information processing |
CN111459991A (en) * | 2020-04-15 | 2020-07-28 | 中国银行股份有限公司 | Information query method and device |
CN111666293A (en) * | 2019-03-05 | 2020-09-15 | 北京京东尚科信息技术有限公司 | Database access method and device |
CN111752964A (en) * | 2019-06-10 | 2020-10-09 | 北京京东尚科信息技术有限公司 | Data processing method and device based on data interface |
CN111881220A (en) * | 2020-06-22 | 2020-11-03 | 北京城市网邻信息技术有限公司 | Data operation method and device under list storage, electronic equipment and storage medium |
CN112000692A (en) * | 2020-09-02 | 2020-11-27 | 平安养老保险股份有限公司 | Page query feedback method and device, computer equipment and readable storage medium |
CN112948418A (en) * | 2021-02-25 | 2021-06-11 | 平安普惠企业管理有限公司 | Dynamic query method, device, equipment and storage medium |
CN113535140A (en) * | 2020-04-16 | 2021-10-22 | 武汉斗鱼网络科技有限公司 | Parameter packaging method, device, equipment and storage medium |
CN113760961A (en) * | 2020-08-11 | 2021-12-07 | 北京京东振世信息技术有限公司 | Data query method and device |
CN114328572A (en) * | 2020-09-28 | 2022-04-12 | 北京鸿享技术服务有限公司 | Data query method, device, system and medium based on SQL parser |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090070300A1 (en) * | 2007-09-07 | 2009-03-12 | International Business Machines Corporation | Method for Processing Data Queries |
CN101980213A (en) * | 2010-11-23 | 2011-02-23 | 中国科学院软件研究所 | J2EE-based data persistence method and system |
CN103020064A (en) * | 2011-09-20 | 2013-04-03 | 佳都新太科技股份有限公司 | Method and configuration for generating query condition in annotation way |
CN103177016A (en) * | 2011-12-22 | 2013-06-26 | 北京新媒传信科技有限公司 | Visiting method and device for relational database |
CN103226478A (en) * | 2013-05-22 | 2013-07-31 | 北京金和软件股份有限公司 | Method for automatically generating and using code |
-
2018
- 2018-09-28 CN CN201811139814.8A patent/CN109271403A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090070300A1 (en) * | 2007-09-07 | 2009-03-12 | International Business Machines Corporation | Method for Processing Data Queries |
CN101980213A (en) * | 2010-11-23 | 2011-02-23 | 中国科学院软件研究所 | J2EE-based data persistence method and system |
CN103020064A (en) * | 2011-09-20 | 2013-04-03 | 佳都新太科技股份有限公司 | Method and configuration for generating query condition in annotation way |
CN103177016A (en) * | 2011-12-22 | 2013-06-26 | 北京新媒传信科技有限公司 | Visiting method and device for relational database |
CN103226478A (en) * | 2013-05-22 | 2013-07-31 | 北京金和软件股份有限公司 | Method for automatically generating and using code |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111666293A (en) * | 2019-03-05 | 2020-09-15 | 北京京东尚科信息技术有限公司 | Database access method and device |
CN111752964A (en) * | 2019-06-10 | 2020-10-09 | 北京京东尚科信息技术有限公司 | Data processing method and device based on data interface |
CN110765152A (en) * | 2019-09-18 | 2020-02-07 | 平安科技(深圳)有限公司 | SQL extraction method and device, computer equipment and storage medium |
CN110765152B (en) * | 2019-09-18 | 2023-05-30 | 平安科技(深圳)有限公司 | SQL extraction method, SQL extraction device, computer equipment and storage medium |
CN111259043A (en) * | 2020-01-09 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Method, device, computer storage medium and terminal for realizing information processing |
CN111459991A (en) * | 2020-04-15 | 2020-07-28 | 中国银行股份有限公司 | Information query method and device |
CN111459991B (en) * | 2020-04-15 | 2023-04-07 | 中国银行股份有限公司 | Information query method and device |
CN113535140A (en) * | 2020-04-16 | 2021-10-22 | 武汉斗鱼网络科技有限公司 | Parameter packaging method, device, equipment and storage medium |
CN111881220A (en) * | 2020-06-22 | 2020-11-03 | 北京城市网邻信息技术有限公司 | Data operation method and device under list storage, electronic equipment and storage medium |
CN113760961A (en) * | 2020-08-11 | 2021-12-07 | 北京京东振世信息技术有限公司 | Data query method and device |
CN113760961B (en) * | 2020-08-11 | 2023-11-03 | 北京京东振世信息技术有限公司 | Data query method and device |
CN112000692A (en) * | 2020-09-02 | 2020-11-27 | 平安养老保险股份有限公司 | Page query feedback method and device, computer equipment and readable storage medium |
CN112000692B (en) * | 2020-09-02 | 2023-06-23 | 平安养老保险股份有限公司 | Page query feedback method and device, computer equipment and readable storage medium |
CN114328572A (en) * | 2020-09-28 | 2022-04-12 | 北京鸿享技术服务有限公司 | Data query method, device, system and medium based on SQL parser |
CN112948418A (en) * | 2021-02-25 | 2021-06-11 | 平安普惠企业管理有限公司 | Dynamic query method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109271403A (en) | A kind of operating method of data query, device, medium and electronic equipment | |
US11386893B2 (en) | Human-computer interaction processing system, method, storage medium, and electronic device | |
US10592319B2 (en) | API notebook tool | |
US10942708B2 (en) | Generating web API specification from online documentation | |
CN109739478A (en) | Front end project automated construction method, device, storage medium and electronic equipment | |
CN109446099A (en) | Automatic test cases generation method, device, medium and electronic equipment | |
CN109634598A (en) | A kind of page display method, device, equipment and storage medium | |
CN110489751A (en) | Text similarity computing method and device, storage medium, electronic equipment | |
US20130339841A1 (en) | Systems and methods of a script generation engine | |
WO2023221408A1 (en) | Method and apparatus for processing operator for deep learning framework, and device and storage medium | |
CN110109979B (en) | Form option configuration method and device | |
CN106559438A (en) | A kind of program method for uploading and device based on objective network platform | |
CN109634490A (en) | A kind of list display method, device, equipment and storage medium | |
CN109145014A (en) | The method and apparatus for generating elastic searching request | |
CN109002289A (en) | A kind of method and apparatus constructing data model | |
CN111324833A (en) | Page display method, device, electronic design and computer readable medium | |
CN109359194A (en) | Method and apparatus for predictive information classification | |
CN109783562A (en) | A kind of method and device for business processing | |
CN111125064A (en) | Method and device for generating database mode definition statement | |
CN114996619A (en) | Page display method and device, computer equipment and storage medium | |
CN109375910A (en) | Class file generation method, device, electronic equipment and storage medium | |
CN113626223A (en) | Interface calling method and device | |
CN110109983B (en) | Method and device for operating Redis database | |
CN109582317A (en) | Method and apparatus for debugging boarding application | |
US20220198153A1 (en) | Model training |
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: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Beijing Economic and Technological Development Zone, 100176 Applicant after: Jingdong Digital Technology Holding Co., Ltd. Address before: Room 221, 2nd floor, Block C, 18 Kechuang 11th Street, Daxing Economic and Technological Development Zone, Beijing, 100176 Applicant before: Beijing Jingdong Financial Technology Holding Co., Ltd. |
|
CB02 | Change of applicant information | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190125 |
|
RJ01 | Rejection of invention patent application after publication |