Skip to content

SQL-035: Create LegalNote via CreateTaskNote

This ORM statement performs a create operation on LegalNote via CreateTaskNote, executed from Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs (L938).

Classification

Field Value
SQL ID SQL-035
Operation type Create
Execution method ORM (IRepository.Add)
Database Oracle
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object LegalNote
Criteria property N/A — ORM
Lifecycle method CreateTaskNote

Parameters

Parameter Direction Type Max length Description
:Id Input long N/A Identifier from CASE_NOTE_SEQ.NEXTVAL
:Text Input string N/A
:CreateUser Input string N/A
:CreateDate Input DateTime N/A
:UpdateUser Input string N/A
:UpdateDate Input DateTime? N/A
:Category Input LegalNoteCategory N/A Identifier of the referenced LegalNoteCategory entity (References(x => x.Category))
:Case Input LegalCase N/A Identifier of the referenced LegalCase entity (References(x => x.Case))

Tables

Table Access Columns used
LEGAL.CASE_NOTE INSERT CASE_NOTE_SEQ_NUM, TEXT, CREATE_USER, CREATE_DATE, UPDATE_USER, UPDATE_DATE, NOTE_CATEGORY_CODE, LEGAL_CASE_SEQ_NUM (identifier from sequence CASE_NOTE_SEQ.NEXTVAL)

LINQ statement

Source: Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs:938.

// Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs:938
_unitOfWork.GetRepository<LegalNote>().Add(noteData);

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 CASE_NOTE_SEQ.NEXTVAL
FROM DUAL

INSERT INTO LEGAL.CASE_NOTE (
  CASE_NOTE_SEQ_NUM,
  TEXT,
  CREATE_USER,
  CREATE_DATE,
  UPDATE_USER,
  UPDATE_DATE,
  NOTE_CATEGORY_CODE,
  LEGAL_CASE_SEQ_NUM)
VALUES (
  :Id,
  :Text,
  :CreateUser,
  :CreateDate,
  :UpdateUser,
  :UpdateDate,
  :Category,
  :Case)

Translation notes: - :Id is the value fetched from sequence CASE_NOTE_SEQ (GeneratedBy.Native("CASE_NOTE_SEQ")) before the INSERT; NHibernate assigns it to LegalNote.Id. - Reference FK values are bound from the associated entity's identifier; the referenced tables are not read or joined by this statement: Category → NOTE_CATEGORY_CODE (entity table NOTE_CATEGORY_CODE not accessed); Case → LEGAL_CASE_SEQ_NUM. - Case (LegalCase) and Category (LegalNoteCategory) are obtained by separate SingleOrDefault lookups (LegalTaskService.cs:928-933); only their FK values are written.

Operations and processes

Note: Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • Services/SAIF.Services/Legal/Tasks/LegalTaskService.cs (L938)