To get the necessary data, I form an SQL query to PostgreSQL, which is a related set of View tables : When I execute these queries from the console in the database sequentially, one after the other, everything works. However, if you run similar queries in the repository via the @query annotation (“… ” , NativeQuery = true), a number