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

A technology of specifying fields and joint query, applied in the field of computer programming, can solve problems such as many writing and many steps, and achieve the effect of reducing the amount of code

Inactive Publication Date: 2016-06-08
SHANGHAI JIANKUN INFORMATION TECH
View PDF3 Cites 4 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

The disadvantage is that you need to understand the mechanism of the framework, know and master the m

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 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
  • 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
  • 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

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0048] The operating principles involved in the method of the present invention include:

[0049] a. Create a class, define attributes, write the get / set method of the attribute, and map the class and its attribute name with the data table and its fields, such as figure 1 As shown, based on this, a query object is created. This object can define all queryable settings such as wheregroupby of the query;

[0050] b. The name of the class attribute corresponding to some fields to be queried is represented by putting it into a string array;

[0051] c. Loop the string array and set each attribute name into the query object to set the field to be queried;

[0052] d. Write a method to put the data of the obtained data set into the entity class. This entity class is generally a class mapped to a table, or it can be another class. This class must provide a get / set method;

[0053] e. On the basis of the above method, multi-table joint query and aggregation calculation query can be ...

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

PUM

No PUM Login to view more

Abstract

The invention discloses a method for querying the appointed field data of a data table under a simplified JAVA program. The method comprises the following steps: creating a data entity class corresponding to a table field one by one; describing a field name to be queried by a character string array; creating a corresponding sql (Structured Query Language) query statement, and initiating and obtaining a result; utilizing reflection to map the result data to each attribute of a corresponding data entity object; and during data operation, directly utilizing a "get" method in the object to read a certain value.

Description

technical field [0001] The invention belongs to the technical field of computer programming, and in particular relates to a method for simplifying querying specified field data of a data table, multi-table joint query, and statistical query under a JAVA program. Background technique [0002] Under the existing JAVA program, there are usually the following "old methods" to query only part of the field data, but all of them need to write a lot of extra redundant code, among them: [0003] 1. It is possible to write a variety of construction methods corresponding to entity classes for various query fields. [0004] Example: Just query the "name" field in the UserInfo table [0005] publicUserInfo(Stringname){this.name=name;} [0006] Or to query "name" "age" "address" in the table [0007] [0008] Then when writing a query, actually write a constructor that uses one of the required [0009] Stringhql="selectnewUserInfo(name)fromUserInfo"; [0010]  … [0011] The disa...

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
IPC IPC(8): G06F9/44
CPCG06F8/315
Inventor 仲灵烨
Owner SHANGHAI JIANKUN INFORMATION TECH
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