Skip to content

SQL-024: Create DocumentRequestParameter via StoreOriginalDocumentRequestParameters

This ORM statement performs a create operation on DocumentRequestParameter via StoreOriginalDocumentRequestParameters, executed from Services/SAIF.Services/Documents/DocumentParameterService.cs (L170).

Classification

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

Parameters

Parameter Direction Type Max length Description
:Id Input long N/A Property of DocumentRequestParameter (unresolved mapping)
:RequestId Input long N/A Property of DocumentRequestParameter (unresolved mapping)
:ParameterNumber Input int N/A Property of DocumentRequestParameter (unresolved mapping)
:XmlName Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:XmlGroup Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:DataSource Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:DataType Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:Prompt Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:ValueTxt Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:IsViewable Input bool N/A Property of DocumentRequestParameter (unresolved mapping)
:IsRequired Input bool N/A Property of DocumentRequestParameter (unresolved mapping)
:CreateUser Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:CreateDate Input DateTime N/A Property of DocumentRequestParameter (unresolved mapping)
:UpdateUser Input string N/A Property of DocumentRequestParameter (unresolved mapping)
:UpdateDate Input DateTime N/A Property of DocumentRequestParameter (unresolved mapping)
:UpdateNumber Input long N/A Property of DocumentRequestParameter (unresolved mapping)

Tables

Table Access Columns used
DocumentRequestParameter** INSERT Unresolved — C# property names only: Id, RequestId, ParameterNumber, XmlName, XmlGroup, DataSource, DataType, Prompt, ValueTxt, IsViewable, IsRequired, CreateUser, CreateDate, UpdateUser, UpdateDate, UpdateNumber

LINQ statement

Source: Services/SAIF.Services/Documents/DocumentParameterService.cs:170.

// Services/SAIF.Services/Documents/DocumentParameterService.cs:150
var oneParm = new DataModel.DocumentRequestParameter()
//var oneParm = new DataModel.DocumentParameter()
{
    RequestId = inRequestId,
    //TemplateId = inTemplateId,
    ParameterNumber = result.ParameterNumber,
    //ParameterType = "REQUEST",
    XmlName = result.XmlName,
    XmlGroup = result.XmlGroup,
    DataSource = result.DataSource,
    DataType = result.DataType,
    Prompt = result.Prompt, 
    ValueTxt = result.DefaultValueTxt, 
    IsViewable = result.IsViewable, 
    IsRequired = result.IsRequired, 
    CreateUser = UserProfileService.GetCurrentUser().UserId.ToUpper(),
    CreateDate = DateTime.Now,
    UpdateNumber = 0
};

// Services/SAIF.Services/Documents/DocumentParameterService.cs:170
UnitOfWork.GetRepository<DataModel.DocumentRequestParameter>().Add(oneParm);

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
INSERT INTO DocumentRequestParameter ( -- unresolved mapping: DocumentRequestParameter (no ClassMap; table name unknown)
  Id, -- unresolved mapping: DocumentRequestParameter.Id
  RequestId, -- unresolved mapping: DocumentRequestParameter.RequestId
  ParameterNumber, -- unresolved mapping: DocumentRequestParameter.ParameterNumber
  XmlName, -- unresolved mapping: DocumentRequestParameter.XmlName
  XmlGroup, -- unresolved mapping: DocumentRequestParameter.XmlGroup
  DataSource, -- unresolved mapping: DocumentRequestParameter.DataSource
  DataType, -- unresolved mapping: DocumentRequestParameter.DataType
  Prompt, -- unresolved mapping: DocumentRequestParameter.Prompt
  ValueTxt, -- unresolved mapping: DocumentRequestParameter.ValueTxt
  IsViewable, -- unresolved mapping: DocumentRequestParameter.IsViewable
  IsRequired, -- unresolved mapping: DocumentRequestParameter.IsRequired
  CreateUser, -- unresolved mapping: DocumentRequestParameter.CreateUser
  CreateDate, -- unresolved mapping: DocumentRequestParameter.CreateDate
  UpdateUser, -- unresolved mapping: DocumentRequestParameter.UpdateUser
  UpdateDate, -- unresolved mapping: DocumentRequestParameter.UpdateDate
  UpdateNumber) -- unresolved mapping: DocumentRequestParameter.UpdateNumber
VALUES (
  :Id,
  :RequestId,
  :ParameterNumber,
  :XmlName,
  :XmlGroup,
  :DataSource,
  :DataType,
  :Prompt,
  :ValueTxt,
  :IsViewable,
  :IsRequired,
  :CreateUser,
  :CreateDate,
  :UpdateUser,
  :UpdateDate,
  :UpdateNumber)

Translation notes: - No mapping exists for SAIF.Data.Model.Documents.DocumentRequestParameter (Data/SAIF.Data/Model/Documents/DocumentRequestParameter.cs:9) in this repository, and Legends returned no mapping in any dependency library. Per the skill, the statement is translated with C# names and every position is marked -- unresolved mapping; no table or column name is invented. - The identifier generator is unknown, so no sequence call is shown. - Because the entity is unmapped, NHibernate would raise MappingException ("No persister for: SAIF.Data.Model.Documents.DocumentRequestParameter") at this call at runtime; the statement is therefore likely never issued. A commented-out DocumentParameter Add sits at DocumentParameterService.cs:169. - Properties set at the call site (lines 150-168): RequestId, ParameterNumber, XmlName, XmlGroup, DataSource, DataType, Prompt, ValueTxt, IsViewable, IsRequired, CreateUser, CreateDate, UpdateNumber. IsViewable / IsRequired are bool; their DB representation is unknown without a mapping.

Operations and processes

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

Sources

  • Services/SAIF.Services/Documents/DocumentParameterService.cs (L170)