Recursive Queries Using Object Relational Mapping
Recent years witnessed continuous development of database query languages and object relational mappers. One of the research fields of interest are recursive queries. The first implementations of such queries for SQL has been introduced by Oracle in 1985. However, it was the introduction of recursive Common Table Expressions into the SQL:99 standard that made the research on this topic more popular. Currently most of the popular DBMS implements recursive queries, but there are no object relational mappers that support such queries. In this paper we propose extending existing ORMs with recursive CTE’s support. A prototype of such an extension has been implemented in SQLObject mapper for the Python language. Tests have been conducted with PostgreSQL 8.4 database. Furthermore, recursive queries written using CTEs amount to be too complex and hard to comprehend. Our proposal overcomes this problem by pushing the formulation of recursive queries to a higher abstraction level, which makes them significantly simpler to write and to read.
KeywordsTransport Change Python Language Union Select Object Relational Mapping Corporate Hierarchy
Unable to display preview. Download preview PDF.
- 1.Boniewicz, A., Burzanska, M., Przymus, P., Stencel, K.: Recursive query facilities in relational databases: a survey. manuscript sent for DTA (2010) [if both papers are accepted, the editor may change this reference]Google Scholar
- 3.JDBC Driver class documentation, http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Driver.html
- 4.SQLObject, http://www.sqlobject.org/
- 6.Recursive queries in PostgreSQL, http://www.postgresql.org/docs/8.4/static/queries-with.html
- 8.Ordonez, C.: Optimization of Linear Recursive Queries in SQL. IEEE Trans. Knowl. Data Eng., 264–277 (2010)Google Scholar
- 9.Melnik, S., Adya, A., Bernstein, P.A.: Compiling mappings to bridge applications and databases. In: ACM SIGMOD, pp. 461–472 (2007)Google Scholar
- 10.Keller, W.: Mapping objects to tables: A pattern language. In: EuroPLoP (2007)Google Scholar
- 11.Codd, E.F.: A relational model of data for large shared data banks. Communications of the ACM (1970)Google Scholar