Method and configuration for generating query condition in annotation way

An annotation and query operation technology, applied in the field of electronic information, can solve problems such as time-consuming and long-time requests, and achieve the effect of easy use

Inactive Publication Date: 2013-04-03
PCI TECH GRP CO LTD
View PDF3 Cites 29 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Of course, this method also has certain defects, that is, when the query statement is not generated by the parser for the first time, it takes a period of time for the parser to parse a complex entity class. In this case, the query may request time longer

Method used

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

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and configuration for generating query condition in annotation way
  • Method and configuration for generating query condition in annotation way

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0022] Embodiment one, see figure 1 , figure 2

[0023] The invention provides a method for generating database query sentences through annotations.

[0024] The class parser calls the field parser again after parsing the query request parameters sent by the client and the annotations of the defined database table entity classes to generate the final query SQL.

[0025] From the above, it can be seen that the method for generating database query statements in the form of annotations provided by the present invention has the following advantages.

[0026] (1) Easy to configure

[0027] The present invention only needs to configure the annotation of the entity class, and it can be completed by calling the resolver.

[0028] (2) Wide variety of application databases

[0029] The present invention uses the type of data dialect, and if the database type annotation is configured, the generated SQL supports changing the database.

[0030] (3) More object-oriented

[0031] Whe...

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

PUM

No PUM Login to view more

Abstract

The invention discloses a java bean for configuring ORM (Object Relational Mapping) of a database in an annotation way, wherein the java bean can enable the ORM to be matched with HttpRequest Map delivered from a page in Servlet; in such a way, query condition statements of an SQL (Structured Query Language) are generated according to the type of an annotation; the type of the provided annotation can include database type, matching indications, matching table field names, corresponding names of parameters in the RequestMap, query operation and the like; and finally, after the configured annotation and the RequestMap are judged and matched through a resolver through the adoption of a java reflection operation mode, a string of String type SQL condition statements is returned.

Description

technical field [0001] The invention relates to the technical field of electronic information, in particular to a method for generating query conditions through annotation. Background technique [0002] In the business development of IT software, the interaction between the development language and the database is very frequent. Usually, developers will generate a series of SQL statements of the database through business logic, and then execute them through the class library provided by the database. Often in the query interface of a client, various query conditions will be input, and developers have to write a long string of statements to judge query parameters in the background code, and then generate the final SQL to submit to the database, which makes the development efficiency low , It is also easy to generate wrong SQL statements. [0003] In order to improve the developer's development efficiency of the database query module, a method based on java annotations is use...

Claims

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

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/30
Inventor 田之进周涛唐磊
Owner PCI TECH GRP CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products