Skip to content

SQL-216: Retrieve JudgmentYearsValue via GetJudgmentYears

This statement retrieves every judgment-years value, ordered by number of years, so that CollectionsService.GetJudgmentYears can populate a value list. It is issued through NHibernate LINQ against the JudgmentYearsValue entity from Services/SAIF.Services/Collections/CollectionsService.cs:1087.

Classification

Field Value
SQL ID SQL-216
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 GetJudgmentYears

Parameters

Parameters: None.

Tables

Table Access Columns used
JUDGEMENT_YEARS_VALUE SELECT NUMBER_OF_YEARS_VALUE

LINQ statement

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

return Mapper.Map<JudgmentYearsValue[]>(UnitOfWork.GetRepository<DataModel.JudgmentYearsValue>()
    .Query().OrderBy(x => x.NumberOfYears).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 JY.NUMBER_OF_YEARS_VALUE
FROM   JUDGEMENT_YEARS_VALUE JY
ORDER BY JY.NUMBER_OF_YEARS_VALUE;

Translation notes: - The table name is spelled JUDGEMENT_YEARS_VALUE in the mapping (the entity name is spelled "Judgment").

Operations and processes

Sources

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