Skip to content

SQL-215: ProviderQueryProvider.GetProviderMCOPlans

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

Classification

Field Value
SQL ID SQL-215
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 GetProviderMCOPlans

Parameters

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

Tables

Table Access Columns used
MCO_PROVIDER SELECT MCO_PLAN_ID, PROVIDER_LOCATION_SEQ_NUM, EFF_DATE, EXP_DATE, UPDATE_DATE, UPDATE_USER

LINQ statement

Source: Data/SAIF.Data/Queries/Providers/ProviderQueryProvider.cs:226-227.

public IEnumerable<MCOProvider> GetProviderMCOPlans(long providerLocationId)
{
    return Factory.GetRepository<MCOProvider>().Query()
        .Where(m => m.PoviderLocationId == providerLocationId && m.ExpirationDate == null);
}

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
  MP.MCO_PLAN_ID,
  MP.PROVIDER_LOCATION_SEQ_NUM,
  MP.EFF_DATE,
  MP.EXP_DATE,
  MP.UPDATE_DATE,
  MP.UPDATE_USER
FROM MCO_PROVIDER MP
WHERE MP.PROVIDER_LOCATION_SEQ_NUM = :providerLocationId
  AND MP.EXP_DATE IS NULL

Translation notes: - The query is deferred: it returns IEnumerable without materialization and runs when the caller enumerates it. - PoviderLocationId (sic) is a composite-key property (MCOProviderMap.cs:14). MCO_PLAN_ID is shared by the key and References(McoPlan) (line 21) and is selected once. McoPlan is lazy and not joined.

Operations and processes

Business rules

Sources

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