Skip to content

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 SELECT module, control_text, run_date

LINQ statement

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

// 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.

-- 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

Sources

  • Services/SAIF.Services/BatchProcessing/BatchProcessingService.cs (L51)