The following paper presents results of combining two intensively developed technologies used to build database applications SQL’s recursive queries and object-relational mapping. Recursive queries are efficient tools for querying graph and hierarchical structures. They are very useful in solving problems such as searching for connections between two cities or calculating bill-of-material. Object-relational mapping allows for separation of business logic from database layer and more efficient implementation of computer software. However, modern mapping systems still lack support for many advanced SQL techniques. In order to perform a recursive calculation a programmer has to either write a recursive function in a language supported by the target database or implement a native function in the main software code that recursively sends queries to the database. The authors propose an enhancement enabling the use of recursive queries in one of the most popular ORM systems Hibernate for Java language. With this enhancement a programmer will be able to take a full advantage of the support for the recursive queries offered by various object-relational database management systems and write a code fully compliant with Hibernate standard. The proposed solution works with IBM DB2, Oracle and PostgreSQL DBMS and proved to be many times faster than the approaches currently used.