Skip to content

SQL-145: Retrieve ClaimSeverityModelActivity via ClaimSeverityModelActivityQuery (property)

This ORM statement performs a read operation on ClaimSeverityModelActivity via IUnitOfWork.GetRepository<T>(), executed from Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs (L22).

Classification

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

Parameters

Parameter Direction Type Max length Description
(none) N/A N/A N/A No inline filter — full-entity read (Query().ToList()/projection) or filters appended later

Tables

Table Access Columns used
CSGSEV_CLM_SGMNTN_ACTIONS_SENT SELECT ACTIONS_SENT_ID, CLM_ID, ACTION_DESC, ACTION_ROLE

LINQ statement

Source: Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22

// Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22
        private IQueryable<ClaimSeverityModelActivity> ClaimSeverityModelActivityQuery => _sqlServerUnitOfWork.GetRepository<ClaimSeverityModelActivity>().Query();

// Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:39
            _severityModelActivities = ClaimSeverityModelActivityQuery.OrderBy(x => x.ClaimId).OrderBy(x => x.ActionDescription).ToList();

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
-- Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs:22 (materialized at L39)
SELECT
  CCSAS.ACTIONS_SENT_ID,
  CCSAS.CLM_ID,
  CCSAS.ACTION_DESC,
  CCSAS.ACTION_ROLE
FROM CSGSEV_CLM_SGMNTN_ACTIONS_SENT CCSAS
ORDER BY CCSAS.ACTION_DESC

Translation notes: - Dialect: the repository comes from _sqlServerUnitOfWork (constructor parameter IUnitOfWork sqlServerUOW, L28-32) -> SQL Server (MsSqlConfiguration.MsSql2008, Legends Q4); the DI binding itself is outside this repository, so the dialect is inferred from the naming. No bind variables or paging are involved, so the SQL text is identical in both dialects. - OrderBy(x => x.ClaimId).OrderBy(x => x.ActionDescription): the second OrderBy replaces the first as the primary key (LINQ semantics) -> ORDER BY ACTION_DESC. Depending on NHibernate version the superseded CLM_ID key may be emitted as a secondary sort or dropped.

Operations and processes

Sources

  • Services/SAIF.Services/Claims/SeverityModel/SeverityModelActivityService.cs (L22)