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

# SQL-330: Retrieve TaskGroup via GetTaskGroups

This statement retrieves all `CLAIM_TASK_GROUP_CODE` records, used by `LegalTaskService.GetTaskGroups` to populate the list of available task groups. The SQL is inferred from the NHibernate LINQ query and the `TaskGroup` class map shown below — it is not literal SQL text in the source code.

## Classification

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

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CLAIM_TASK_GROUP_CODE](../database-tables.md#claim_task_group_code) | SELECT | `Code`, `UPDATE_NUM`, `CODE_DESCR`, `UPDATE_DATE`, `UPDATE_USER` |

## LINQ statement

Source: `Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs:155`

```csharp
// Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs:155
return Mapper.Map<TaskGroup[]>(_unitOfWork.GetRepository<TaskData.TaskGroup>().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
  CTGC.Code,
  CTGC.UPDATE_NUM,
  CTGC.CODE_DESCR,
  CTGC.UPDATE_DATE,
  CTGC.UPDATE_USER
FROM CLAIM_TASK_GROUP_CODE CTGC
```

Translation notes:

- The un-materialized `IQueryable` is enumerated by `Mapper.Map<TaskGroup[]>`; no predicate.

## Operations and processes
- LegalTaskService.GetTaskGroups — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs (L155)`
