Skip to content

SQL-119: Retrieve CbpBillService via SubmitBill

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

Classification

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

Parameters

Parameter Direction Type Max length Description
bill.Id Input ** N/A x.Bill.Id == bill.Id → column join via Bill (BILL_ID) → Bill.Id

Tables

Table Access Columns used
CBP_BILL_SERVICE SELECT BILL_ID

LINQ statement

Source: Services/SAIF.Services/Claims/Bills/BillEntryService.cs:321

// Services/SAIF.Services/Claims/Bills/BillEntryService.cs:321
            if (!unitOfWork.GetRepository<CbpBillService>().Query().Where(x => x.Bill.Id == bill.Id).Any())

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/BillEntryService.cs:321
SELECT *
FROM (
  SELECT 1
  FROM CBP_BILL_SERVICE CBS
  WHERE CBS.BILL_ID = :Id
)
WHERE ROWNUM <= 1

Translation notes: - Terminal .Any() -> SELECT 1 ... ROWNUM <= 1; bill.Id -> bind :Id.

Operations and processes

Business rules

Sources

  • Services/SAIF.Services/Claims/Bills/BillEntryService.cs (L321)