---
title: "SQL-315: Retrieve SubpoenaStatus via ListOfSubpoenaStatus (property)"
summary: Read operation against SubpoenaStatus via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-315: Retrieve SubpoenaStatus via ListOfSubpoenaStatus (property)

This statement retrieves all rows of `SUBPOENA_STATUS_CODE` via NHibernate LINQ over `IUnitOfWork.GetRepository<SubpoenaStatus>()`. It is executed by the `SubpoenaService.ListOfSubpoenaStatus` property (`Services/SAIF.Services/Legal/Subpoenas/SubpoenaService.cs (L268)`) to build the list of subpoena statuses exposed to callers.

## Classification

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

## Parameters

None (literals only or full-table read).

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [SUBPOENA_STATUS_CODE](../database-tables.md#subpoena_status_code) | SELECT | `CODE`, `CODE_DESCR` |

## LINQ statement

Source: `Services/SAIF.Services/Legal/Subpoenas/SubpoenaService.cs:266`

```csharp
// Services/SAIF.Services/Legal/Subpoenas/SubpoenaService.cs:266-268
var subpoenaStatusList =
    Mapper.Map<IList<SubpoenaStatus>>(
        _unitOfWork.GetRepository<LegalData.Subpoenas.SubpoenaStatus>().Query());
```

## 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
  SSC.CODE,
  SSC.CODE_DESCR
FROM SUBPOENA_STATUS_CODE SSC
```

Translation notes:
- The cited line builds an unexecuted `IQueryable`; `Mapper.Map` enumerates it, producing a full-table read.

## Operations and processes
- SubpoenaService.ListOfSubpoenaStatus (property) — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Legal/Subpoenas/SubpoenaService.cs (L268)`
