Skip to content

SQL-102: Retrieve BillStatus via SetNewBillStatus

This ORM statement performs a read operation on BillStatus via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Legal/Bills/BillPaymentService.cs (L382).

Classification

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

Parameters

Parameter Direction Type Max length Description
toCode Input ** N/A x.Code == toCode → column CODE

Tables

Table Access Columns used
BILL_STATUS_CODE SELECT CODE, CODE_DESCR, FILTER_GROUPING_TEXT

LINQ statement

Source: Services/SAIF.Services/Legal/Bills/BillPaymentService.cs:382

// Services/SAIF.Services/Legal/Bills/BillPaymentService.cs:382-384
            bill.BillStatus = _unitOfWork.GetRepository<BillData.BillStatus>()
                .Query()
                .SingleOrDefault(x => x.Code == toCode);

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
-- Services/SAIF.Services/Legal/Bills/BillPaymentService.cs:382
SELECT
  BSC.CODE,
  BSC.CODE_DESCR,
  BSC.FILTER_GROUPING_TEXT
FROM BILL_STATUS_CODE BSC
WHERE BSC.CODE = :toCode
-- NHibernate expects at most one row

Operations and processes

Sources

  • Services/SAIF.Services/Legal/Bills/BillPaymentService.cs (L382)