IP Library Granted Patent US 7,149,733
Granted Patent B2
US 7,149,733 · App. 10/199,943 · Granted Dec 12, 2006

Translation of object queries involving inheritence

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 7,149,733
App. No.
10/199,943
Granted
Dec 12, 2006
Kind
B2
Abstract

Join expressions, expressed in terms of objects, are translated into a relational database join statement by generating a parse tree based on the join expression. The parse tree is traversed to build the relational database join statement.

Claims (54)

1. A computer-implemented method for translating an object query identifying an entity to be queried, the entity having inheritance, into a relational database query for execution against a relational database, comprising:

identifying associated entities in an inheritance hierarchy associated with the entity to be queried, wherein identifying associated entities comprises constructing a tree having nodes corresponding to ancestors and descendents of the entity to be queried in the inheritance hierarchy;

grouping associated entities that are mapped to a common table in the relational database, wherein grouping comprises traversing the tree, grouping nodes of the tree where entities in the nodes are mapped to a common table, to form an entity group tree, and wherein grouping further comprises repeating the steps of constructing a tree and traversing the tree until the entity group tree stabilizes; and

building one or more query statements based on the groups.

2. The computer-implemented method of claim 1 wherein traversing the tree comprises:

traversing the tree in prefix order.

3. The computer-implemented method of claim 2 wherein grouping nodes comprises:

merging parent and child nodes having entities that are mapped to a common table.

4. The computer-implemented method of claim 3 wherein grouping nodes comprises:

merging children nodes of an identified parent node where the children nodes have entities that are mapped to a common table.

5. The computer-implemented method of claim 4 wherein building one or more query statements comprises:

building a query statement for each entity in the entity group tree; and

adding the query statement to a statement list.

6. The computer-implemented method of claim 5 wherein building one or more query statements comprises:

if more than one query statement is on the statement list, joining the query statements with a relational database operator producing a union of the query statements.

7. The computer-implemented method of claim 6 wherein building a query statement for each entity in the entity group tree comprises:

generating a statement with an indicator identifying the statement;

adding to the generated statement a column name identifying table columns from the concrete entity to be returned; and

adding a column name identifying table columns from ancestor and descendent nodes in the inheritance hierarchy.

8. The computer-implemented method of claim 7 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement name of table columns for a least-derived node in the inheritance hierarchy.

9. The computer-implemented method of claim 8 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement name of table columns for all additional ancestor nodes in the inheritance hierarchy.

10. The computer-implemented method of claim 9 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement name of table columns for descendent nodes in the inheritance hierarchy.

11. The computer-implemented method of claim 10 wherein building a query statement for each concrete entity comprises:

adding restrictions specified in the object query to the query statement.

12. A computer readable medium storing instructions which, when executed, cause a computer to perform a translation of an object query that identifies an entity to be queried, the entity to be queried having inheritance, into a relational database query for execution against a relational database, by performing the steps of:

identifying associated entities in an inheritance hierarchy associated with the entity to be queried, wherein identifying associated entities comprises constructing a tree having nodes corresponding to ancestors and descendents of the entity to be queried in the inheritance hierarchy;

grouping associated entities that are mapped to a common table in the relational database into groups, wherein grouping comprises traversing the tree, grouping nodes of the tree when entities in the nodes are mapped to a common table, to form an entity group tree, and wherein grouping further comprises repeating the steps of constructing a tree and traversing the tree until the entity group tree stabilizes; and

building one or more query statements based on the groups.

13. The computer readable medium of claim 12 wherein traversing the tree comprises:

traversing the tree in prefix order.

14. The computer readable medium of claim 13 wherein grouping nodes comprises:

merging parent and child nodes having entities that are mapped to a common table.

15. The computer readable medium of claim 14 wherein grouping nodes comprises:

merging children nodes of an identified parent node where the children nodes have entities that are mapped to a common table.

16. The computer readable medium of claim 15 wherein building one or more query statements comprises:

building a query statement for entity group tree that has at least one concrete entity; and

adding the query statement to a statement list.

17. The computer readable medium of claim 16 wherein building one or more query statements comprises:

if more than one query statement is on the statement list, joining the query statements with a relational database operator producing a union of the query statements.

18. The computer readable medium of claim 17 wherein building a query statement for each entity group tree comprises:

generating a statement with an indicator identifying the statement;

adding to the generated statement a column name identifying table columns from the concrete entity to be returned; and

adding a column name identifying table columns from ancestor and descendent nodes in the entity group tree.

19. The computer readable medium of claim 18 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement an name of table columns for a least-derived node in the entity group tree.

20. The computer readable medium of claim 19 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement name of table columns for all additional ancestor nodes in the entity group tree.

21. The computer readable medium of claim 20 wherein adding a column name identifying columns from ancestor and descendent nodes comprises:

adding to the generated statement name of table columns for descendent nodes in the entity group tree.

22. The computer readable medium of claim 18 wherein building a query statement for each concrete entity comprises:

adding restrictions specified in the object query to the query statement.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034541/0477 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 13, 2002
From: LIN, CHEN-MI; TRAPPEN, ANTHONY R.; SWAN, DEMPSEY R.; THALMAN, MATTHEW A.; HOLZHEY, RAYMOND E.; ANONSEN, STEVEN P.; BAIRD, WADE DANIEL LEE
To: MICROSOFT CORPORATION
Reel/Frame 013488/0721 →