Skip to content

SQL-122: Retrieve CbpBillStatusCode via GetBillStatusCodes

This ORM statement performs a read operation on CbpBillStatusCode via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Claims/Bills/BillService.cs (L264).

Classification

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

Parameters

Parameter Direction Type Max length Description
codesNotToDisplay Input ** N/A x.Code IN (codesNotToDisplay) (Contains) → column CODE

Tables

Table Access Columns used
CBP_BILL_STATUS_CODE SELECT CODE, UPDATE_NUM, CODE_DESCR, ACTIVE_FLAG, EXT_IW_CODE_DESCR, UPDATE_DATE, UPDATE_USER

LINQ statement

Source: Services/SAIF.Services/Claims/Bills/BillService.cs:263

// Services/SAIF.Services/Claims/Bills/BillService.cs:263-265
            var codesNotToDisplay = new List<string> { "PEN", "DIS" };
            var codes = unitOfWork.GetRepository<CbpBillStatusCode>().Query()
                .Where(x => !codesNotToDisplay.Contains(x.Code)).ToList();

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/Claims/Bills/BillService.cs:264
SELECT
  CBSC.CODE,
  CBSC.UPDATE_NUM,
  CBSC.CODE_DESCR,
  CBSC.ACTIVE_FLAG,
  CBSC.EXT_IW_CODE_DESCR,
  CBSC.UPDATE_DATE,
  CBSC.UPDATE_USER
FROM CBP_BILL_STATUS_CODE CBSC
WHERE CBSC.CODE NOT IN (:codesNotToDisplay)

Translation notes: - codesNotToDisplay is the local list {"PEN","DIS"} (L263) -> list bind.

Operations and processes

Sources

  • Services/SAIF.Services/Claims/Bills/BillService.cs (L264)