Skip to content

SQL-212: Retrieve InterestCalcCode via GetInterestCalcCodes

This statement retrieves every interest calculation code, ordered by description, so that CollectionsService.GetInterestCalcCodes can populate a code list. It is issued through NHibernate LINQ against the InterestCalcCode entity from Services/SAIF.Services/Collections/CollectionsService.cs:1092.

Classification

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

Parameters

Parameters: None.

Tables

Table Access Columns used
INTEREST_CALC_OPTION_CODE SELECT Code, CODE_DESCR

LINQ statement

Source: Services/SAIF.Services/Collections/CollectionsService.cs:1092

return Mapper.Map<InterestCalcCode[]>(UnitOfWork.GetRepository<DataModel.InterestCalcCode>()
    .Query().OrderBy(x => x.Description).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
SELECT ICC.Code,
       ICC.CODE_DESCR
FROM   INTEREST_CALC_OPTION_CODE ICC
ORDER BY ICC.CODE_DESCR;

Translation notes: - Id(x => x.Code) has no .Column(...), so the default column name Code (the property name) is used.

Operations and processes

Sources

  • Services/SAIF.Services/Collections/CollectionsService.cs (L1092)