SQL-050: Create Task via CreateTask¶
This ORM statement performs a create operation on Task via CreateTask, executed from Services/SAIF.Services/Collections/CollectionsService.cs (L1402).
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-050 |
| Operation type | Create |
| Execution method | ORM (IRepository.Add) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | Task |
| Criteria property | N/A — ORM |
| Lifecycle method | CreateTask |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
:Id |
Input | long |
N/A | Identifier from TASK_SEQ.NEXTVAL |
:UpdateNumber |
Input | int |
N/A | Version column (Version()); NHibernate writes its initial value |
:TaskDate |
Input | DateTime |
N/A | |
:TaskText |
Input | string |
N/A | |
:TaskUser |
Input | string |
N/A | |
:IsSavedToNotepad |
Input | bool |
N/A | Bound as 'Y'/'N' (YesNoType) |
:IsDeleted |
Input | bool |
N/A | Bound as 'Y'/'N' (YesNoType) |
:ImageId |
Input | long? |
N/A | |
:ContextCode |
Input | string |
N/A | |
:ContextKey |
Input | string |
N/A | |
:ContextCategory |
Input | string |
N/A | |
:ContextText |
Input | string |
N/A | |
:ContextDate |
Input | DateTime? |
N/A | |
:ContextNumber |
Input | long? |
N/A | |
:CreateDate |
Input | DateTime |
N/A | |
:CreateUser |
Input | string |
N/A | |
:UpdateDate |
Input | DateTime |
N/A | |
:UpdateUser |
Input | string |
N/A | |
:TaskSecurity |
Input | string |
N/A | |
:ClaimId |
Input | long |
N/A | |
:Policy |
Input | Policy |
N/A | Identifier of the referenced Policy entity (References(x => x.Policy)) |
:TaskAction |
Input | TaskAction |
N/A | Identifier of the referenced TaskAction entity (References(x => x.TaskAction)) |
:TaskCategory |
Input | TaskCategory |
N/A | Identifier of the referenced TaskCategory entity (References(x => x.TaskCategory)) |
:TaskPriority |
Input | TaskPriority |
N/A | Identifier of the referenced TaskPriority entity (References(x => x.TaskPriority)) |
:TaskSource |
Input | TaskSource |
N/A | Identifier of the referenced TaskSource entity (References(x => x.TaskSource)) |
:TaskGroup |
Input | TaskGroup |
N/A | Identifier of the referenced TaskGroup entity (References(x => x.TaskGroup)) |
:LegalNoteCategory |
Input | LegalNoteCategory |
N/A | Identifier of the referenced LegalNoteCategory entity (References(x => x.LegalNoteCategory)) |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| TASK | INSERT | 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 (identifier from sequence TASK_SEQ.NEXTVAL) |
LINQ statement¶
Source: Services/SAIF.Services/Collections/CollectionsService.cs:1402.
// Services/SAIF.Services/Collections/CollectionsService.cs:1402
UnitOfWork.GetRepository<TaskDataModel.Task>().Add(taskData);
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 TASK_SEQ.NEXTVAL
FROM DUAL
INSERT INTO TASK (
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)
VALUES (
:Id,
:UpdateNumber,
:TaskDate,
:TaskText,
:TaskUser,
:IsSavedToNotepad,
:IsDeleted,
:ImageId,
:ContextCode,
:ContextKey,
:ContextCategory,
:ContextText,
:ContextDate,
:ContextNumber,
:CreateDate,
:CreateUser,
:UpdateDate,
:UpdateUser,
:TaskSecurity,
:ClaimId,
:Policy,
:TaskAction,
:TaskCategory,
:TaskPriority,
:TaskSource,
:TaskGroup,
:LegalNoteCategory)
Translation notes:
- :Id is the value fetched from sequence TASK_SEQ (GeneratedBy.Native("TASK_SEQ")) before the INSERT; NHibernate assigns it to Task.Id.
- UPDATE_SEQ_NUM is the optimistic-concurrency version column (Version(x => x.UpdateNumber)); NHibernate sets its initial value on INSERT.
- :IsSavedToNotepad, :IsDeleted are bound as 'Y' / 'N' (YesNoType).
- Reference FK values are bound from the associated entity's identifier; the referenced tables are not read or joined by this statement: Policy → POLICY_NUM (entity table POLICY not accessed); TaskAction → TASK_ACTION_CODE (entity table TASK_ACTION_CODE not accessed); TaskCategory → TASK_CATEGORY_CODE (entity table TASK_CATEGORY_CODE not accessed); TaskPriority → TASK_PRIORITY_CODE (entity table TASK_PRIORITY_CODE not accessed); TaskSource → TASK_SOURCE_CODE (entity table TASK_SOURCE_CODE not accessed); TaskGroup → CLAIM_TASK_GROUP_CODE (entity table CLAIM_TASK_GROUP_CODE not accessed); LegalNoteCategory → LEGAL_NOTE_CATEGORY_CODE (entity table NOTE_CATEGORY_CODE not accessed).
- TaskSource / TaskCategory / TaskAction / TaskPriority (CollectionsService.cs:1386-1389) and Claim (line 1383) are obtained by separate SingleOrDefault lookups; only their FK values are written.
Operations and processes¶
- CollectionsService.CreateTask — see Operations and processes
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Sources¶
Services/SAIF.Services/Collections/CollectionsService.cs (L1402)