Skip to content

SQL-202: ProviderQueryProvider.GetProvider

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

Classification

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

Parameters

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

Tables

Table Access Columns used
PROVIDER SELECT PROVIDER_SEQ_NUM, UPDATE_NUM, PRIMARY_TAX_ID, UPDATE_DATE, UPDATE_USER

LINQ statement

Source: Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:50. The repository/queryable is initialised at Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:27.

// Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:27
_providerRepository = Factory.GetRepository<Provider>().Query();

// Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:50
public Provider GetProvider(long providerId)
{
    return _providerRepository.SingleOrDefault(x => x.Id == providerId);
}

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
  P.PROVIDER_SEQ_NUM,
  P.UPDATE_NUM,
  P.PRIMARY_TAX_ID,
  P.UPDATE_DATE,
  P.UPDATE_USER
FROM PROVIDER P
WHERE P.PROVIDER_SEQ_NUM = :providerId
-- SingleOrDefault: NHibernate expects at most one row

Translation notes: - The Locations/TaxIds collections (ProviderMap.cs:23-24) are lazy and not loaded here.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:50