---
title: "SQL-023: GroupImageRepository.GetImageGroup"
summary: Read operation for GroupImageRepository
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
---


# SQL-023: GroupImageRepository.GetImageGroup

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

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:groupImageId` | Input | long | N/A | Method argument bound into the LINQ expression |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [Image_Group](../database-tables.md#image_group) | SELECT | `image_group_seq_num`, `group_association_code`, `image_seq_num` |

## LINQ statement

Source: `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:41`. The queryable is obtained at `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:93`.

```csharp
public ImageGroup GetImageGroup(long groupImageId)
{
    return GroupImageQuery().Single(i => i.Id == groupImageId);
}

private IQueryable<ImageGroup> GroupImageQuery()
{
    return Session.Query<ImageGroup>();
}
```

## 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
  IG.image_group_seq_num,
  IG.group_association_code,
  IG.image_seq_num
FROM Image_Group IG
WHERE IG.image_group_seq_num = :groupImageId
```

Translation notes:
- `Single(...)` throws in memory when zero or more than one row is returned; no row limit is emitted.
- `ImageGroup.Image` (`image_seq_num`) and `ImageGroup.Group` (`group_association_code`) are lazy `References`; they resolve to already-selected FK columns and are not joined, so `image` and `group_association` are not accessed by this statement.

## Operations and processes

- [Group image soft delete](../operations/group-image-soft-delete.md)

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

## Sources
- `Data/SAIF.Data.NHibernate/Repositories/Groups/GroupImageRepository.cs:41`
