Skip to content

SQL-181: OutputDocumentQueryProvider.GetReleasedStatus

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by OutputDocumentQueryProvider.GetReleasedStatus.

Classification

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

Tables

Table Access Columns used
document_status_code SELECT code, code_descr

LINQ statement

Source: Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs:23-24.

public DocumentStatusCode GetReleasedStatus()
{
    return Factory.GetRepository<DocumentStatusCode>().Query()
        .SingleOrDefault(x => x.Code == DocumentStatusCode.ReleasedDocumentStatusCode);
}

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
  DSC.code,
  DSC.code_descr
FROM document_status_code DSC
WHERE DSC.code = 'RELE'
-- SingleOrDefault: NHibernate expects at most one row

Translation notes: - DocumentStatusCode.ReleasedDocumentStatusCode is a C# constant "RELE" (DocumentStatusCode.cs:8). It is shown inline; NHibernate binds it as a parameter. - Table and column names are lower-case in the mapping; Oracle folds unquoted identifiers to upper case.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs:23