---
title: "SQL-147: ImageQueryProvider.GetImage"
summary: Read operation for `ImageQueryProvider.GetImage`
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SQL-147: ImageQueryProvider.GetImage

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by `ImageQueryProvider.GetImage`.

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-147 |
| **Operation type** | Read |
| **Execution method** | ORM (NHibernate LINQ) |
| **Database** | Oracle* |
| **Schema** | Unknown** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `ImageQueryProvider` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `GetImage` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `imageId` | Input | long | N/A | Method argument of `ImageQueryProvider.GetImage` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| `image**` | SELECT | unresolved (see Unresolved mapping) |

## LINQ statement

Source: `Data/SAIF.Data/Queries/Policies/Images/ImageQueryProvider.cs:20`. The repository is obtained at `Data/SAIF.Data/Queries/Policies/Images/ImageQueryProvider.cs:15`.

```csharp
// Data/SAIF.Data/Queries/Policies/Images/ImageQueryProvider.cs:15
repository = Factory.GetRepository<Image>().Query();

// Data/SAIF.Data/Queries/Policies/Images/ImageQueryProvider.cs:20
return repository.SingleOrDefault(x => x.Id == imageId);
```

## 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
  <all mapped columns of Image> -- unresolved mapping: Image column list not documented
FROM image I
WHERE I.<Id column> = :imageId -- unresolved mapping: Image.Id
-- NHibernate expects at most one row
```

Translation notes:
- The `**` table marker means the mapping is external (SAIF.Framework.Data.NHibernate). The table name is confirmed; the columns are unresolved.

## Operations and processes

- [Other query providers](../operations/other-query-providers.md)

> **Note:** Statements marked with `**` could not be confirmed; treat
> as unknown until verified.

## Sources
- `Data/SAIF.Data/Queries/Policies/Images/ImageQueryProvider.cs:20`
