SQL-061: Create XDocument¶
This ORM statement performs a create operation on XDocument via GetCertificateBatchReportByCertHolder, GetCertificateBatchReportByPolicy, GetSummaryReportForPolicy, executed from Services/SAIF.Services/Policies/Certificates/DocumentService.cs (L394), Services/SAIF.Services/Policies/Certificates/DocumentService.cs (L455), Services/SAIF.Services/Policies/Certificates/DocumentService.cs (L622).
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-061 |
| Operation type | Create |
| Execution method | ORM (IRepository.Add) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | XDocument |
| Criteria property | N/A — ORM |
| Lifecycle method | GetCertificateBatchReportByCertHolder, GetCertificateBatchReportByPolicy, GetSummaryReportForPolicy |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
:Id |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:XPrintControl |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:XBinType |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument (column pairing unresolved) |
:DocumentType |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument (column pairing unresolved) |
:DuplexMode |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument (column pairing unresolved) |
:FileName |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:EmailAddress |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:FaxNumber |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument (column pairing unresolved) |
:IdxContentsText |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:PrintGroupText |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:StartValue |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:CopiesCount |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort0Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort1Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort2Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort3Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort4Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort5Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort6Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort7Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort8Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
:Sort9Value |
Input | external (SAIF.Framework.Core) |
N/A | Property of XDocument |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| XDOCUMENT** | INSERT | XDOCUMENT_SEQ_NUM, XPRINT_CONTROL_SEQ_NUM, XBIN_TYPE_CODE, DOCUMENT_TYPE_CODE, DUPLEX_CODE, FILE_NAME, EMAIL_ADDRESS, FAX_NUM, IDX_CONTENTS_TEXT, PRINT_GROUP_TEXT, START_VALUE, COPIES_COUNT, SORT0_VALUE, SORT1_VALUE, SORT2_VALUE, SORT3_VALUE, SORT4_VALUE, SORT5_VALUE, SORT6_VALUE, SORT7_VALUE, SORT8_VALUE, SORT9_VALUE |
LINQ statement¶
Source: Services/SAIF.Services/Policies/Certificates/DocumentService.cs:394, Services/SAIF.Services/Policies/Certificates/DocumentService.cs:455, Services/SAIF.Services/Policies/Certificates/DocumentService.cs:622.
// Services/SAIF.Services/Policies/Certificates/DocumentService.cs:394
unitOfWork.GetRepository<PrintData.XDocument>().Add(xDocument);
// Services/SAIF.Services/Policies/Certificates/DocumentService.cs:455
unitOfWork.GetRepository<PrintData.XDocument>().Add(xDocument);
// Services/SAIF.Services/Policies/Certificates/DocumentService.cs:622
unitOfWork.GetRepository<PrintData.XDocument>().Add(xDocument);
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 XDOCUMENT_SEQ.NEXTVAL
FROM DUAL
INSERT INTO XDOCUMENT (
XDOCUMENT_SEQ_NUM,
XPRINT_CONTROL_SEQ_NUM,
XBIN_TYPE_CODE, -- unresolved mapping: XDocument.XBinType (column pairing inferred)
DOCUMENT_TYPE_CODE, -- unresolved mapping: XDocument.DocumentType (column pairing inferred)
DUPLEX_CODE, -- unresolved mapping: XDocument.DuplexMode (column pairing inferred)
FILE_NAME,
EMAIL_ADDRESS,
FAX_NUM, -- unresolved mapping: XDocument.FaxNumber (column pairing inferred)
IDX_CONTENTS_TEXT,
PRINT_GROUP_TEXT,
START_VALUE,
COPIES_COUNT,
SORT0_VALUE,
SORT1_VALUE,
SORT2_VALUE,
SORT3_VALUE,
SORT4_VALUE,
SORT5_VALUE,
SORT6_VALUE,
SORT7_VALUE,
SORT8_VALUE,
SORT9_VALUE)
VALUES (
:Id,
:XPrintControl,
:XBinType,
:DocumentType,
:DuplexMode,
:FileName,
:EmailAddress,
:FaxNumber,
:IdxContentsText,
:PrintGroupText,
:StartValue,
:CopiesCount,
:Sort0Value,
:Sort1Value,
:Sort2Value,
:Sort3Value,
:Sort4Value,
:Sort5Value,
:Sort6Value,
:Sort7Value,
:Sort8Value,
:Sort9Value)
Translation notes:
- XDocument (SAIF.Data.Model.Printing) is mapped outside this repository; no ClassMap<XDocument> exists under Data/SAIF.Data.NHibernate/Mappings/**. Legends confirms XDocumentMap in SAIF.Framework.Data.NHibernate (Mappings/Printing/) with table XDOCUMENT and native sequence XDOCUMENT_SEQ, but the ClassMap source is not indexed.
- The column list is taken from the documented ADO.NET INSERT in SAIF.Services.Printing.Remote (Claims.BOF.Components/docs/libraries/saif-services-printing-remote/sql/SQL-006-saif-services-printing-remote.md, via Legends) and the XDOCUMENT table docs; it is not ClassMap-verified. Property-to-column pairings whose names differ (XBinType, DocumentType, DuplexMode, FaxNumber) are marked -- unresolved mapping.
- :XPrintControl is the identifier of the associated XPrintControl (many-to-one); XPRINT_CONTROL is not read or joined by this statement.
- :Id is the value fetched from XDOCUMENT_SEQ before the INSERT.
- xDocument properties (FileName) are reassigned after Add at Services/SAIF.Services/Policies/Certificates/DocumentService.cs:396, using the newly assigned Id; a stateful session flushes these as a subsequent UPDATE XDOCUMENT at commit — a separate statement, not shown.
- xDocument properties (FileName) are reassigned after Add at Services/SAIF.Services/Policies/Certificates/DocumentService.cs:457, using the newly assigned Id; a stateful session flushes these as a subsequent UPDATE XDOCUMENT at commit — a separate statement, not shown.
Operations and processes¶
- DocumentService.GetCertificateBatchReportByCertHolder — see Operations and processes
- DocumentService.GetCertificateBatchReportByPolicy — see Operations and processes
- DocumentService.GetSummaryReportForPolicy — see Operations and processes
Note: Statements marked with
**could not be confirmed; treat as unknown until verified.
Sources¶
Services/SAIF.Services/Policies/Certificates/DocumentService.cs (L394, L455, L622)