Skip to content

SQL-348: Retrieve XDeferredPrint via GetOneXDeferredPrint

This ORM statement performs a read operation on XDeferredPrint, retrieving the single row where Id matches, via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Documents/DocumentRequestService.cs (L301). The SQL below is inferred from the LINQ expression and the XDeferredPrint NHibernate mapping (XDEFERRED_PRINT); it is not literal SQL text present in source.

Classification

Field Value
SQL ID SQL-348
Operation type Read
Execution method ORM (NHibernate LINQ)
Database Oracle
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object XDeferredPrint
Criteria property N/A — ORM
Lifecycle method GetOneXDeferredPrint

Parameters

Parameter Direction Type Max length Description
:recordId Input long N/A Method argument of GetOneXDeferredPrint

Tables

Table Access Columns used
XDEFERRED_PRINT SELECT XDEFERRED_SEQ_NUM, FILE_NAME, DOCUMENT_DESCR, COPIES_COUNT, SORT0_VALUE, SORT1_VALUE, SORT2_VALUE, SORT3_VALUE, SORT4_VALUE, SORT5_VALUE, SORT6_VALUE, SORT7_VALUE, SORT8_VALUE, SORT9_VALUE, PRINTED_DATE, DUPLEX_CODE, CREATE_DATE, CREATE_USER, XML_VALUE_TEXT

LINQ statement

Source: Services/SAIF.Services/Documents/DocumentRequestService.cs:301

// Services/SAIF.Services/Documents/DocumentRequestService.cs:301
var item = UnitOfWork.GetRepository<XDeferredPrint>().Query().SingleOrDefault(a => a.Id == recordId);

Sample SQL

Inferred SQL: This SQL was inferred from the LINQ statement above and the NHibernate mappings. It is not concrete SQL from source code; NHibernate generates the executed statement at runtime, so aliases, column order, join syntax, and bind-parameter names may differ.

-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT
  XP.XDEFERRED_SEQ_NUM,
  XP.FILE_NAME,
  XP.DOCUMENT_DESCR,
  XP.COPIES_COUNT,
  XP.SORT0_VALUE,
  XP.SORT1_VALUE,
  XP.SORT2_VALUE,
  XP.SORT3_VALUE,
  XP.SORT4_VALUE,
  XP.SORT5_VALUE,
  XP.SORT6_VALUE,
  XP.SORT7_VALUE,
  XP.SORT8_VALUE,
  XP.SORT9_VALUE,
  XP.PRINTED_DATE,
  XP.DUPLEX_CODE,
  XP.CREATE_DATE,
  XP.CREATE_USER,
  XP.XML_VALUE_TEXT
FROM XDEFERRED_PRINT XP
WHERE XP.XDEFERRED_SEQ_NUM = :recordId
-- NHibernate expects at most one row

Operations and processes

Sources

  • Services/SAIF.Services/Documents/DocumentRequestService.cs (L301)