Skip to content

SQL-258: ClaimBuilder.ClaimStatus

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

Classification

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

Parameters

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

Tables

Table Access Columns used
claim_status_code SELECT (hypothetical) Code, CODE_DESCR, UPDATE_DATE, UPDATE_USER, UPDATE_NUM

LINQ statement

Source: Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:60.

// Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:60
Item.ClaimStatus = Uow.GetRepository<ClaimStatusCode>().Query().FirstOrDefault(x => x.Code == claimStatus);

Sample SQL

Test double — no runtime SQL. This statement executes against TestUnitOfWork/TestRepository<T> (in-memory, List<TEntity>-backed test doubles in SAIF.Framework.Core); no NHibernate session is opened and no SQL is issued at runtime. The SQL below is the hypothetical statement the same expression would produce against a real NHibernate IUnitOfWork using the in-repo mappings, shown to document the mapping shape only — no database table is accessed when this code runs.

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 *
FROM (
  SELECT
    CSC.Code,
    CSC.CODE_DESCR,
    CSC.UPDATE_DATE,
    CSC.UPDATE_USER,
    CSC.UPDATE_NUM
  FROM claim_status_code CSC
  WHERE CSC.Code = :claimStatus)
WHERE ROWNUM <= 1

Translation notes: - Default claimStatus = ClaimStatusCode.Open ("O"). Identifier column is literally Code.

Sources

  • Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:60