SQL-215: Retrieve JudgmentCode via GetJudgmentCodes¶
This statement retrieves every judgment code, ordered by description, so that CollectionsService.GetJudgmentCodes can populate a code list. It is issued through NHibernate LINQ against the JudgmentCode entity from Services/SAIF.Services/Collections/CollectionsService.cs:1082.
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 | CollectionsService |
| Criteria property | N/A — ORM |
| Lifecycle method | GetJudgmentCodes |
Parameters¶
Parameters: None.
Tables¶
| Table | Access | Columns used |
|---|---|---|
| JUDGMENT_CODE | SELECT | Code, CODE_DESCR |
LINQ statement¶
Source: Services/SAIF.Services/Collections/CollectionsService.cs:1082
return Mapper.Map<JudgmentCode[]>(UnitOfWork.GetRepository<DataModel.JudgmentCode>()
.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 JC.Code,
JC.CODE_DESCR
FROM JUDGMENT_CODE JC
ORDER BY JC.CODE_DESCR;
Translation notes:
- Id(x => x.Code) has no .Column(...), so the default column name Code is used.
Operations and processes¶
- CollectionsService.GetJudgmentCodes — see Operations and processes
Sources¶
Services/SAIF.Services/Collections/CollectionsService.cs (L1082)