Skip to content

SQL-014: AuditQueryProvider.GetAuditForBill

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

Classification

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

Parameters

Parameter Direction Type Max length Description
billId Input long N/A Method argument of AuditQueryProvider.GetAuditForBill bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
CBP_AUDIT SELECT BILL_ID, UPDATE_NUM, TOTAL_CHARGED_AMT, TOTAL_ALLOWED_AMT, TOTAL_MCO_ADMIN_FEE_AMT, UPDATE_DATE, UPDATE_USER, AUDIT_RECEIPT_DATE, CHARGEABLE_COST_FLAG, PRINT_EOB_FLAG, SPECIAL_HANDLING_CODE

LINQ statement

Source: Data/SAIF.Data/Queries/AuditQueryProvider.cs:39. The repository is a class field initialised from Factory.GetRepository<CbpAudit>().Query() at Data/SAIF.Data/Queries/AuditQueryProvider.cs:23.

return repository.SingleOrDefault(x => x.Bill.Id == billId);

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
  CA.BILL_ID,
  CA.UPDATE_NUM,
  CA.TOTAL_CHARGED_AMT,
  CA.TOTAL_ALLOWED_AMT,
  CA.TOTAL_MCO_ADMIN_FEE_AMT,
  CA.UPDATE_DATE,
  CA.UPDATE_USER,
  CA.AUDIT_RECEIPT_DATE,
  CA.CHARGEABLE_COST_FLAG,
  CA.PRINT_EOB_FLAG,
  CA.SPECIAL_HANDLING_CODE
FROM CBP_AUDIT CA
WHERE CA.BILL_ID = :billId
-- NHibernate expects at most one row

Translation notes: - x.Bill.Id is the identifier of References(Bill).Column("BILL_ID"), so it resolves to CA.BILL_ID with no join; CBP_BILL is not accessed as a separate table.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/AuditQueryProvider.cs:39