Skip to content

SQL-042: BillQueryProvider.GetCbpServiceZDecDescription

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

Classification

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

Parameters

Parameter Direction Type Max length Description
serviceCode Input string N/A Method argument of BillQueryProvider.GetCbpServiceZDecDescription bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
CBP_SERVICE_DESCRIPTION SELECT BILL_SERVICE_CODE, BILL_SERVICE_TYPE_CODE, SERVICE_DESCR_EFF_DATE, UPDATE_NUM, SERVICE_DESCR_EXP_DATE, SERVICE_DESCR_TEXT, UPDATE_USER, UPDATE_DATE

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:177.

return Factory.GetRepository<CbpServiceDescription>().Query().SingleOrDefault(x => x.Service.Code == serviceCode && x.Service.ServiceType == GetBillServiceTypeCode("Z"));

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
  CSD.BILL_SERVICE_CODE,
  CSD.BILL_SERVICE_TYPE_CODE,
  CSD.SERVICE_DESCR_EFF_DATE,
  CSD.UPDATE_NUM,
  CSD.SERVICE_DESCR_EXP_DATE,
  CSD.SERVICE_DESCR_TEXT,
  CSD.UPDATE_USER,
  CSD.UPDATE_DATE
FROM CBP_SERVICE_DESCRIPTION CSD
WHERE CSD.BILL_SERVICE_CODE = :serviceCode
  AND CSD.BILL_SERVICE_TYPE_CODE = :ServiceType
-- NHibernate expects at most one row

Translation notes: - x.Service.Code and x.Service.ServiceType are both components of CbpServiceCode's composite identifier, so they resolve to CSD's own key columns BILL_SERVICE_CODE/BILL_SERVICE_TYPE_CODE; CBP_SERVICE_CODE is not accessed as a separate table. - x.Service.ServiceType == GetBillServiceTypeCode("Z") compares by identifier, so CBP_SERVICE_TYPE_CODE is not accessed as a separate table either. - As in SQL-041, GetBillServiceTypeCode("Z") runs a separate SQL-044-shape pre-query client-side before this statement executes. - SERVICE_DESCR_EFF_DATE is part of the key and is not filtered; if more than one description row exists, SingleOrDefault throws.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Claims/BillQueryProvider.cs:177