---
title: "SQL-212: Retrieve InterestCalcCode via GetInterestCalcCodes"
summary: Read operation against InterestCalcCode via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# 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](../database-tables.md#interest_calc_option_code) | SELECT | Code, CODE_DESCR |

## LINQ statement

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

```csharp
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.

```sql
-- 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
- CollectionsService.GetInterestCalcCodes — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Collections/CollectionsService.cs (L1092)`
