Skip to content

SQL-074: EbillAddressQueryProvider.GetAddress

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

Classification

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

Parameters

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

Tables

Table Access Columns used
EBILL_ADDRESS SELECT EBILL_ADDRESS_SEQ_NUM, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_CITY, ADDRESS_STATE_CODE, ADDRESS_ZIP_CODE, ADDRESS_ZIP_CODE_EXT, ORIG_ADDRESS_LINE1, ORIG_ADDRESS_LINE2, ORIG_ADDRESS_CITY, ORIG_ADDRESS_STATE_CODE, ORIG_ADDRESS_ZIP_CODE, ORIG_ADDRESS_ZIP_CODE_EXT, UNMATCHED_ADDRESS_FLAG, VERIFIED_ADDRESS_FLAG, EBILL_BATCH_SEQ_NUM, ADDRESS_TYPE_CODE

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/Ebilling/EbillAddressQueryProvider.cs:24. The repository is a class field initialised from Factory.GetRepository<EbillAddress>() at Data/SAIF.Data/Queries/Claims/Ebilling/EbillAddressQueryProvider.cs:17.

return repository.Single(ad => ad.Id == addressId);

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
  EA.EBILL_ADDRESS_SEQ_NUM,
  EA.ADDRESS_LINE1,
  EA.ADDRESS_LINE2,
  EA.ADDRESS_CITY,
  EA.ADDRESS_STATE_CODE,
  EA.ADDRESS_ZIP_CODE,
  EA.ADDRESS_ZIP_CODE_EXT,
  EA.ORIG_ADDRESS_LINE1,
  EA.ORIG_ADDRESS_LINE2,
  EA.ORIG_ADDRESS_CITY,
  EA.ORIG_ADDRESS_STATE_CODE,
  EA.ORIG_ADDRESS_ZIP_CODE,
  EA.ORIG_ADDRESS_ZIP_CODE_EXT,
  EA.UNMATCHED_ADDRESS_FLAG,
  EA.VERIFIED_ADDRESS_FLAG,
  EA.EBILL_BATCH_SEQ_NUM,
  EA.ADDRESS_TYPE_CODE
FROM EBILL_ADDRESS EA
WHERE EA.EBILL_ADDRESS_SEQ_NUM = :addressId
-- NHibernate expects at most one row

Translation notes: - Single throws InvalidOperationException when no row matches; this is not SingleOrDefault.

Operations and processes

Sources

  • Data/SAIF.Data/Queries/Claims/Ebilling/EbillAddressQueryProvider.cs:24