IP Library Granted Patent US 11,314,735
Granted Patent B2
US 11,314,735 · App. 16/775,541 · Granted Apr 26, 2022

Generation of query stacks from object relationships

Inventor: Cameron Cogan (San Francisco, CA)
Assignee: salesforce.com, inc.
G06F16/2425G06F16/2458G06F16/287G06F16/289
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 11,314,735
App. No.
16/775,541
Granted
Apr 26, 2022
Kind
B2
Abstract

System and methods are described for generating query stacks from object relationships. In one implementation, a method comprises receiving user input specifying an initial object and a target object; identifying a plurality of directionality relationships associated with the initial object, the target object, and one or more junction objects that link the initial object to the target object; generating, based on the plurality of directionality relationships, a query stack comprising a plurality of queries linking the initial object to the target object; and executing the query stack to retrieve data stored in the target object.

Claims (30)

1. A computer-implemented method comprising:

receiving, by a processing device comprising a processor, user input specifying an initial object and a target object;

identifying, by the processing device, a plurality of directionality relationships associated with the initial object, the target object, and a plurality of junction objects that link the initial object to the target object, the plurality of directionality relationships being indicative of a parent relationship or a child relationship between a given object and another object immediately upstream or downstream from the given object, wherein the plurality of junction objects comprises one or more pivot objects and a number of bridge objects;

generating, by the processing device based on the plurality of directionality relationships, a query stack comprising a plurality of queries linking the initial object to the target object, wherein each pivot object of the one or more pivot objects is referenced by a FROM clause corresponding to one or more queries of the plurality of queries to reduce a number of child lookup operations in the plurality of queries such that a total number of queries included in the plurality of queries is minimized to allow a user to specify target data fields to be queried; and

executing, by the processing device, the query stack to retrieve data stored in the target object, wherein the query stack is generated to maximize a number of parent relationship lookup operations per query and minimize the number of child relationship lookup operations.

2. The computer-implemented method of claim 1 , wherein the user input further specifies the plurality of junction objects.

3. The computer-implemented method of claim 1 , wherein the initial object, the target object, or the plurality of junction objects comprises at least one field indicating a relationship with an object immediately upstream or downstream from the given object.

4. The computer-implemented method of claim 1 , wherein generating the query stack comprises sequentially pushing each generated query onto a stack, and wherein executing the query stack comprises executing each query in order of the query stack starting with a first query pushed onto the query stack.

5. The computer-implemented method of claim 4 , wherein each query in the query stack is a Salesforce Object Query Language (SOQL) query.

6. The computer-implemented method of claim 1 , further comprising: generating, by the processing device for display in a graphical user interface (GUI), a contact card comprising data from the target object.

7. A database system comprising:

a processing device; and a memory coupled to the processing device, the memory having instructions stored thereon that, in response to execution by the processing device, cause the processing device to:

receive user input specifying an initial object and a target object;

identify a plurality of directionality relationships associated with the initial object, the target object, and a plurality of junction objects that link the initial object to the target object, the plurality of directionality relationships being indicative of a parent relationship or a child relationship between a given object and another object immediately upstream or downstream from the given object, wherein the plurality of junction objects comprises one or more pivot objects and a number of bridge objects;

generate, based on the plurality of directionality relationships, a query stack comprising a plurality of queries linking the initial object to the target object, wherein each pivot object of the one or more pivot objects is referenced by a FROM clause corresponding to one or more queries of the plurality of queries to reduce a number of child lookup operations in the plurality of queries such that a total number of queries included in the plurality of queries is minimized to allow a user to specify target data fields to be queried; than n+1; and

execute the query stack to retrieve data stored in the target object, wherein the query stack is generated to maximize a number of parent relationship lookup operations per query and minimize the number of child relationship lookup operations.

8. The database system of claim 7 , wherein the user input further specifies the plurality of junction objects.

9. The database system of claim 7 , wherein the initial object, the target object, or the plurality of junction objects comprises at least one field indicating a relationship with an object immediately upstream or downstream from the given object.

10. The database system of claim 7 , wherein generating the query stack comprises sequentially pushing each generated query onto a query stack, and wherein executing the query stack comprises executing each query in order of the query stack starting with a first query pushed onto the query stack.

11. The database system of claim 10 , wherein each query in the query stack is a Salesforce Object Query Language (SOQL) query.

12. The database system of claim 7 , wherein the processing device is to further: generate, for display in a graphical user interface (GUI), a contact card comprising data from the target object.

13. A non-transitory computer-readable storage medium having instructions encoded thereon which, when executed by a processing device, cause the processing device to:

receive user input specifying an initial object and a target object;

identify a plurality of directionality relationships associated with the initial object, the target object, and a plurality of junction objects that link the initial object to the target object, the plurality of directionality relationships being indicative of a parent relationship or a child relationship between a given object and another object immediately upstream or downstream from the given object, wherein the plurality of junction objects comprises one or more pivot objects and a number of bridge objects;

generate, based on the plurality of directionality relationships, a query stack comprising a plurality of queries linking the initial object to the target object, wherein each pivot object of the one or more pivot objects is referenced by a FROM clause corresponding to one or more queries of the plurality of queries to reduce a number of child lookup operations in the plurality of queries such that a total number of queries included in the plurality of queries is minimized to allow a user to specify target data fields to be queried; and

execute the query stack to retrieve data stored in the target object, wherein the query stack is generated to maximize a number of parent relationship lookup operations per query and minimize the number of child relationship lookup operations.

14. The non-transitory computer-readable storage medium of claim 13 , wherein the user input further specifies the plurality of junction objects.

15. The non-transitory computer-readable storage medium of claim 13 , wherein the initial object, the target object, or the plurality of junction objects comprises at least one field indicating a relationship with an object immediately upstream or downstream from the given object.

16. The non-transitory computer-readable storage medium of claim 13 . wherein generating the query stack comprises sequentially pushing each generated query onto a query stack, and wherein executing the query stack comprises executing each query in order of the query stack starting with a first query pushed onto the query stack.

17. The non-transitory computer-readable storage medium of claim 16 , wherein each query in the query stack is a Salesforce Object Query Language (SOQL) query.

Assignments (2)
CHANGE OF NAME Recorded Dec 18, 2024
From: SALESFORCE.COM, INC.
To: SALESFORCE, INC.
Reel/Frame 069717/0475 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 29, 2020
From: COGAN, CAMERON
To: SALESFORCE.COM, INC.
Reel/Frame 051658/0399 →
Continuity (1)
Related Publication 20210232578A1 · Jul 29, 2021
Cited By (1)
US 12,423,311