Object Relational Mapper Single Query Generation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional object relational mapping techniques require multiple query statements to retrieve data from relational databases with complex relationships, leading to duplicative data in result sets and increased execution time, especially in databases with nested tables and multiple parent-child relationships.
Innovation Solution
An object relational mapper generates a single automatically generated query statement using tree representations of relationships, leveraging analytic functions and full outer joins to eliminate duplicates and improve efficiency, allowing for data retrieval from arbitrary nested tables with a single query.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Measurement precision
If multiple query statements are used to retrieve data from databases with complex relationships, then complete data retrieval is achieved, but execution time increases and duplicative data appears in result sets
Solution Approach 1:
The patent combines multiple query statements into a single query by merging the execution of parent table queries and child table queries. The system generates one unified query statement that retrieves data from both parent and child tables in a single database operation, eliminating the need for sequential multiple queries and reducing execution time while maintaining complete data retrieval.
Solution Approach 2:
The single generated query statement serves multiple functions simultaneously: it retrieves parent table data, retrieves child table data, and performs the operations that would have required separate queries. This multi-functional query approach allows the system to achieve complete data retrieval across complex relationships without the time penalty of multiple sequential queries.
2Quantity of substance
If multiple query statements are used to retrieve data from nested tables, then all nested data is retrieved, but the number of queries increases computational overhead
Solution Approach 1:
The system merges multiple queries for nested tables into a single unified query statement. By combining the retrieval operations for parent tables and multiple levels of child tables into one query, the system reduces computational overhead while maintaining complete retrieval of all nested data, avoiding the complexity of executing multiple separate queries.
3Adaptability or versatility
If conventional object relational mapping is used with multiple queries, then data is retrieved from complex relationships, but duplicative data appears in result sets
Solution Approach 1:
The patent merges parent table queries and child table queries into a single unified query that retrieves data from complex relationships in one operation. This unified approach eliminates duplicative data in result sets by coordinating the retrieval of parent and child table data simultaneously, while maintaining the adaptability to handle arbitrary complex relationships between tables.
Data Source
AI summary
Methods, systems, and apparatus, including computer programs encoded on computer storage media, for generating an object graph from records of a relational database. One of the methods includes receiving a request to populate a software object with values from a plurality of tables represented in a graph, the plurality of tables stored in a relational database maintained by a database management system, each table comprising one or more respective tuples of values; generating a single query statement that, when executed by the database management system, causes the database management system to retrieve the values from the plurality of tables represented in the graph as a result set; querying the relational database using the single query statement to obtain the result set; and populating the software object with one or more values of the result set.


