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

# SQL-092: Retrieve BatchProcessLog via GetSingleRecord

This ORM statement performs a read operation on `BatchProcessLog` via `IUnitOfWork.GetRepository<T>()`, executed from `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs (L51)`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `moduleName` | Input | ** | N/A | `x.Module == moduleName` → column module |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [BATCH_PROCESS_LOG](../database-tables.md#batch_process_log) | SELECT | `module`, `control_text`, `run_date` |

## LINQ statement

Source: `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:18`

```csharp
// Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:18
            _repository = _unitOfWork.GetRepository<BatchProcessLog>();

// Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:51-52
            return _repository.Query()
                .SingleOrDefault(x => x.Module == moduleName);
```

## 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
-- Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs:51
SELECT
  BPL.module,
  BPL.control_text,
  BPL.run_date
FROM batch_process_log BPL
WHERE BPL.module = :moduleName
-- NHibernate expects at most one row
```

Translation notes:
- Repository obtained from field `_repository = _unitOfWork.GetRepository<BatchProcessLog>()` (L18).

## Operations and processes
- BatchProcessingService.GetSingleRecord — see [Operations and processes](../operations-processes.md)

## Sources
- `Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs (L51)`
