Skip to content

SQL-172: Retrieve DocumentTemplateParameter via GetDocumentTemplateParameters

This statement reads DocumentTemplateParameter rows for a document template, ordered by parameter number, so GetDocumentTemplateParameters can present the template's configurable parameters. DocumentTemplateParameter has no ClassMap anywhere in this repository or in the external mapping package queried via Legends, so the table and column names below are unresolved and shown as C# property names.

Classification

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

Parameters

Parameter Direction Type Max length Description
:inTemplateId Input long N/A a.TemplateId == inTemplateId → column TemplateId (unresolved)

Tables

Table Access Columns used
DocumentTemplateParameter** SELECT Id, TemplateId, ParameterNumber, XmlName, XmlGroup, DataSource, DataType, Prompt, DefaultValueTxt, IsViewable, IsRequired, CreateUser, CreateDate, UpdateUser, UpdateDate, UpdateNumber (C# property names — unresolved mapping)

LINQ statement

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

IEnumerable<DataModel.DocumentTemplateParameter> templateParameters = UnitOfWork.GetRepository<DataModel.DocumentTemplateParameter>().Query()
                .Where(a => a.TemplateId == inTemplateId)
                .OrderBy(a => a.ParameterNumber);

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
-- unresolved mapping: DocumentTemplateParameter (no ClassMap in repo; Legends returned no mapping) — C# names used
SELECT DTP.Id, DTP.TemplateId, DTP.ParameterNumber, DTP.XmlName, DTP.XmlGroup, DTP.DataSource, DTP.DataType,
       DTP.Prompt, DTP.DefaultValueTxt, DTP.IsViewable, DTP.IsRequired, DTP.CreateUser, DTP.CreateDate,
       DTP.UpdateUser, DTP.UpdateDate, DTP.UpdateNumber            -- unresolved mapping: DocumentTemplateParameter.*
FROM   DocumentTemplateParameter DTP                                  -- unresolved mapping: DocumentTemplateParameter (table)
WHERE  DTP.TemplateId = :inTemplateId                                 -- unresolved mapping: DocumentTemplateParameter.TemplateId
ORDER BY DTP.ParameterNumber;                                         -- unresolved mapping: DocumentTemplateParameter.ParameterNumber

Translation notes: - ** = unresolved mapping. Model class Data/SAIF.Data/Model/Documents/DocumentTemplateParameter.cs has no ClassMap<DocumentTemplateParameter> anywhere in the repo, and Legends returned no mapping. - Assigned to IEnumerable; executes when enumerated.

Operations and processes

Sources

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