Skip to content

SQL-324: Retrieve TaskAction via CreateTask

This statement retrieves the TASK_ACTION_CODE record with code NONE, used by CollectionsService.CreateTask to default a new task's action. The SQL is inferred from the NHibernate LINQ query and the TaskAction class map shown below — it is not literal SQL text in the source code.

Classification

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

Tables

Table Access Columns used
TASK_ACTION_CODE SELECT Code, CODE_DESCR

LINQ statement

Source: Services/SAIF.Services/Collections/CollectionsService.cs:1388

// Services/SAIF.Services/Collections/CollectionsService.cs:1388
taskData.TaskAction = UnitOfWork.GetRepository<TaskDataModel.TaskAction>().Query().SingleOrDefault(x => x.Code == "NONE");

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
SELECT
  TAC.Code,
  TAC.CODE_DESCR
FROM TASK_ACTION_CODE TAC
WHERE TAC.Code = 'NONE'
-- NHibernate expects at most one row

Translation notes:

  • SingleOrDefault -> no row limit; NHibernate expects at most one row.

Operations and processes

Sources

  • Services/SAIF.Services/Collections/CollectionsService.cs (L1388)