IP Library Granted Patent US 9,448,944
Granted Patent B2
US 9,448,944 · App. 13/424,557 · Granted Sep 20, 2016

Method and system for dynamic templatized query language in software

Inventors: Greg Seitz (Lake Oswego, OR); Christopher J. Kasten (Rancho Cordova, CA)
Assignee: PayPal, Inc.
G06F12/0875G06F9/5016G06F17/30017G06F17/3048G06F17/30336G06F17/30477G06F17/30545G06F2212/465Y10S707/99933Y10S707/99944
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,448,944
App. No.
13/424,557
Granted
Sep 20, 2016
Kind
B2
Abstract

A system to automatically generate query language in software is described. The system receives a request for data that is persistently stored in a database. The system selects a predefined query template from a number of query templates based on the request. The system utilizes the query template to receive content from at least one different source, the first source being a prototype data object. The system generates a query statement based on the query template that includes the content. Finally the system queries the database using the query statement to retrieve the requested data.

Claims (39)

1. A method to automatically generate query language in an object to relational mapping system, the method comprising:

responsive to a request for data, selecting, by a computer processor, a query template that is predefined, from a plurality of query templates, the query template including a procedural language/structured query language (PL/SQL) query template and a logical table name;

receiving first content from a first source the first content comprising a first attribute;

receiving second content from a second source, the second content including a physical table name that is identified by the second source based on the logical table name;

generating a query statement based on the PL/SQL query template and the logical table name, the query statement including at least part of the first content, part of the second content, and a return variable place holder for receiving a return variable that is returned from a PL/SQL routine in PL/SQL; and

executing the query statement to insert a record in the database, the executing the query statement including utilizing the return variable place holder in the query statement to receive a record identifier from the PL/SQL routine in the PL/SQL and assigning the record identifier to an attribute in a prototype data object in the object to relational mapping system, the record identifier being accessible to the object to relational mapping system via the attribute in the prototype data object and identifying the record that was inserted into the database.

2. The method of claim 1 , wherein the second source includes a software routine that selects a plurality of query language expressions in place of a bind position based on a type of operation being performed.

3. The method of claim 1 , wherein the first content includes a software routine that selects the physical table name from a plurality of physical table names.

4. The method of claim 1 , wherein the first content includes a set of columns that are determined by the second source, the second source including a software routine that selects the set of columns from a plurality of sets of columns.

5. The method of claim 1 , wherein the first content includes a set of columns and values that are determined by the second source, the second source including a software routine that selects the set of columns and values based on at least one of a plurality of attributes in a data object that have been modified and a plurality of attributes in the data object that have been loaded.

6. The method of claim 1 , further comprising passing a hint value to a query engine, the hint value being selected from a group of hints consisting of the first attribute in a prototype data object and a hint hash table defined by metadata in the prototype data object.

7. The method of claim 1 , wherein the first content includes an SQL join language construct that is determined by the second source, the second source including a software routine that determines whether the SQL join language construct is required based on columns determined during runtime.

8. The method of claim 1 , wherein the receiving of the first content is performed by a data access layer.

9. The method of claim 1 , wherein the plurality of query templates further includes a select query template, an update query template, and a delete query template.

10. A system to automatically generate query language in an object to relational mapping system, the system comprising:

at least one processor and executable instructions accessible on a computer-readable medium that, when executed, cause the at least one processor to perform operations comprising:

responsive to a request for data, selecting, by a computer processor, a query template that is predefined, from a plurality of query templates, the query template including a procedural language/structured query language (PL/SQL) query template and a logical table name;

receiving first content from a first source the first content comprising a first attribute;

receiving second content from a second source, the second content including a physical table name that is identified by the second source based on the logical table name;

generating a query statement based on the PL/SQL query template and the logical table name, the query statement including at least part of the first content, part of the second content, and a return variable place holder for receiving a return variable that is returned from a PL/SQL routine in PL/SQL; and

executing the query statement to insert a record in the database, the executing the query statement including utilizing the return variable place holder in the query statement to receive a record identifier from the PL/SQL routine in the PL/SQL and assigning the record identifier to an attribute in a prototype data object in the object to relational mapping system, the record identifier being accessible to the object to relational mapping system via the attribute in the prototype data object and identifying the record that was inserted into the database.

11. The system of claim 10 , wherein the second source includes a software routine that selects a plurality of query language expressions in place of a bind position based on a type of operation being performed.

12. The system of claim 10 , wherein the first content includes a software routine that selects the physical table name from a plurality of physical table names.

13. The system of claim 10 , wherein the first content includes a set of columns that are determined by the second source, the second source including a software routine that selects the set of columns from a plurality of sets of columns.

14. The system of claim 10 , wherein the first content includes a set of columns and values that are determined by the second source, the second source includes a software routine that selects the set of columns and values based on at least one of attributes in a data object that have been modified and the attributes in the data object that have been loaded.

15. The system of claim 10 , further comprising passing a hint value to a query engine, the hint value is selected from a group of hints that consist of the first attribute in a prototype data object and a hint hash table defined by metadata in the prototype data object.

16. The system of claim 10 , wherein the first content includes a SQL join language construct that is determined by the second source, the second source includes a software routine that determines whether the SQL join language construct is required based on columns determined during runtime.

17. The system of claim 10 , wherein the operations further comprise receiving the first content in a data access layer.

18. The system of claim 10 , wherein the plurality of query templates includes a select query template, an update query template, and a delete query template.

19. A machine readable hardware storage device storing a set of instructions that, when executed by a machine, cause the machine to perform actions comprising:

responsive to a request for data, selecting, by a computer processor, a query template that is predefined, from a plurality of query templates, the query template including a procedural language/structured query language (PL/SQL) query template and a logical table name;

receiving first content from a first source the first content comprising a first attribute;

receiving second content from a second source, the second content including a physical table name that is identified by the second source based on the logical table name;

generating a query statement based on the PL/SQL query template and the logical table name, the query statement including at least part of the first content, part of the second content, and a return variable place holder for receiving a return variable that is returned from a PL/SQL routine in PL/SQL; and

executing the query statement to insert a record in the database, the executing the query statement including utilizing the return variable place holder in the query statement to receive a record identifier from the PL/SQL routine in the PL/SQL and assigning the record identifier to an attribute in a prototype data object in the object to relational mapping system, the record identifier being accessible to the object to relational mapping system via the attribute in the prototype data object and identifying the record that was inserted into the database.

20. The machine readable hardware storage device of claim 19 , wherein the second source includes a software routine that selects a plurality of query language expressions in place of a bind position based on a type of operation that is performed.

21. The machine readable hardware storage device of claim 19 , further comprising passing a hint value to a query engine, the hint value is selected from a group of hints that consist of the first attribute in a prototype data object and a hint hash table defined by metadata in the prototype data object.

22. The machine readable hardware storage device of claim 19 , wherein the first content includes a SQL join language construct that is determined by the second source, the second source includes a software routine that determines whether the SQL join language construct is required, based on columns determined during runtime.

23. The machine readable hardware storage device of claim 19 , further comprising a data access layer that receives the first content.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 23, 2015
From: EBAY INC.
To: PAYPAL, INC.
Reel/Frame 036169/0798 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 2, 2015
From: SEITZ, GREG; KASTEN, CHRISTOPHER J.
To: EBAY INC.
Reel/Frame 034865/0398 →
Continuity (5)
Continuation 11008776 · Dec 8, 2004
Provisional Application 60528053 · Dec 8, 2003
Provisional Application 60528237 · Dec 8, 2003
Provisional Application 60528238 · Dec 8, 2003
Related Publication 20120179720A1 · Jul 12, 2012