Skip to content

SQL-236: TaskQueryProvider.GetTasksForUser

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by TaskQueryProvider.GetTasksForUser.

Classification

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

Parameters

Parameter Direction Type Max length Description
taskUser Input string N/A Method argument of TaskQueryProvider.GetTasksForUser bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
TASK SELECT TASK_SEQ_NUM, UPDATE_SEQ_NUM, TASK_DATE, TASK_TEXT, TASK_USER, NOTEPAD_FLAG, DELETE_FLAG, IMAGE_SEQ_NUM, CONTEXT_CODE, CONTEXT_KEY, CONTEXT_CATEGORY, CONTEXT_TEXT, CONTEXT_DATE, CONTEXT_NUM, CREATE_DATE, CREATE_USER, UPDATE_DATE, UPDATE_USER, TASK_SECURITY, CLAIM_ID, POLICY_NUM, TASK_ACTION_CODE, TASK_CATEGORY_CODE, TASK_PRIORITY_CODE, TASK_SOURCE_CODE, CLAIM_TASK_GROUP_CODE, LEGAL_NOTE_CATEGORY_CODE

LINQ statement

Source: Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs:58.

// Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs:58-60
return tasks.Query()
    .Where(x => String.Equals(x.TaskUser, taskUser,
        StringComparison.CurrentCultureIgnoreCase)).ToList();

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
  T.TASK_SEQ_NUM,
  T.UPDATE_SEQ_NUM,
  T.TASK_DATE,
  T.TASK_TEXT,
  T.TASK_USER,
  T.NOTEPAD_FLAG,
  T.DELETE_FLAG,
  T.IMAGE_SEQ_NUM,
  T.CONTEXT_CODE,
  T.CONTEXT_KEY,
  T.CONTEXT_CATEGORY,
  T.CONTEXT_TEXT,
  T.CONTEXT_DATE,
  T.CONTEXT_NUM,
  T.CREATE_DATE,
  T.CREATE_USER,
  T.UPDATE_DATE,
  T.UPDATE_USER,
  T.TASK_SECURITY,
  T.CLAIM_ID,
  T.POLICY_NUM,
  T.TASK_ACTION_CODE,
  T.TASK_CATEGORY_CODE,
  T.TASK_PRIORITY_CODE,
  T.TASK_SOURCE_CODE,
  T.CLAIM_TASK_GROUP_CODE,
  T.LEGAL_NOTE_CATEGORY_CODE
FROM TASK T
WHERE T.TASK_USER = :taskUser

Translation notes: - String.Equals(x.TaskUser, taskUser, StringComparison.CurrentCultureIgnoreCase) — the 3-argument String.Equals overload with a StringComparison is not a registered HQL generator in NHibernate 4.0.3 (SAIF.Data.csproj:86-87). It is most likely rejected at query-translation time (NotSupportedException) or, at best, translated as plain equality; case-insensitive semantics would then depend on database collation (Oracle default is case-sensitive). The SQL shown is the equality translation and is uncertain — the Writer should flag this. - The result is materialised by the caller (IEnumerable<Task>), so execution is deferred until enumeration.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Tasks/TaskQueryProvider.cs:58