SQL-301: PolicyOutputDocumentExtensions.AddAgencyViewableDocuments¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by PolicyOutputDocumentExtensions.AddAgencyViewableDocuments.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-301 |
| Operation type | Read |
| Execution method | ORM (NHibernate LINQ) |
| Database | Oracle* |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | PolicyOutputDocumentExtensions |
| Criteria property | N/A — ORM |
| Lifecycle method | AddAgencyViewableDocuments |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
notifyTextCode |
Input | string | N/A | Method argument of PolicyOutputDocumentExtensions.AddAgencyViewableDocuments bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| output_document_type_code | SELECT (hypothetical) | code, code_descr, agency_view_flag, agency_inbox_flag, manual_add_flag, freeform_flag, sort_priority_num, SOURCE_SYSTEM_CODE, PACKAGE_NAME, image_file_code, image_category_code, image_document_type_code, output_document_category_code, Direct_Write_Notify_Text_Code |
LINQ statement¶
Source: Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:1702.
// Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:1702
var docType = uow.GetRepository<OutputDocumentTypeCode>().Query().First(x => x.IsAgencyViewable && x.DirectWriteNotifyText.Code == notifyTextCode);
Sample SQL¶
Test double — no runtime SQL. This statement executes against
TestUnitOfWork/TestRepository<T>(in-memory,List<TEntity>-backed test doubles inSAIF.Framework.Core); no NHibernate session is opened and no SQL is issued at runtime. The SQL below is the hypothetical statement the same expression would produce against a real NHibernateIUnitOfWorkusing the in-repo mappings, shown to document the mapping shape only — no database table is accessed when this code runs.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 *
FROM (
SELECT
ODTC.code,
ODTC.code_descr,
ODTC.agency_view_flag,
ODTC.agency_inbox_flag,
ODTC.manual_add_flag,
ODTC.freeform_flag,
ODTC.sort_priority_num,
ODTC.SOURCE_SYSTEM_CODE,
ODTC.PACKAGE_NAME,
ODTC.image_file_code,
ODTC.image_category_code,
ODTC.image_document_type_code,
ODTC.output_document_category_code,
ODTC.Direct_Write_Notify_Text_Code
FROM output_document_type_code ODTC
WHERE ODTC.agency_view_flag = 'Y'
AND ODTC.Direct_Write_Notify_Text_Code = :notifyTextCode)
WHERE ROWNUM <= 1
-- First(): throws if no row
Translation notes:
- Not accessed: output_doc_notify_text_code (old page) — x.DirectWriteNotifyText.Code is the identifier of OutputDocumentNotifyTextCode, short-circuited to FK column output_document_type_code.Direct_Write_Notify_Text_Code; no join. output_doc_image_type_xref (old page) — many-to-many join table, never navigated.
Sources¶
Data/SAIF.Data/TestRepository/RepositoryExtensions/PolicyOutputDocumentExtensions.cs:1702