Skip to content

SQL-037: PolicyOutputDocumentRepository.GetPolicyOutputDocument

This statement is a read operation invoked through ORM (IRepository.Get). Executed by PolicyOutputDocumentRepository.GetPolicyOutputDocument.

Classification

Field Value
SQL ID SQL-037
Operation type Read
Execution method ORM (IRepository.Get)
Database Oracle
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object PolicyOutputDocumentRepository
Criteria property N/A — ORM
Lifecycle method GetPolicyOutputDocument

Parameters

Parameter Direction Type Max length Description
:documentId Input long N/A Method argument bound into the LINQ expression

Tables

Table Access Columns used
policy_output_document SELECT output_document_seq_num, update_num, policy_period_eff_date, agency_seq_num, agent_num, agency_viewed_flag, agency_delivery_flag, agency_delete_date, create_user, create_date, update_user, update_date, release_date, hold_task_seq_num, task_user, source_key_text, ACCOUNT_NUM, policy_num, document_status_code

LINQ statement

Source: Data/SAIF.Data.NHibernate/Repositories/OutputDocuments/PolicyOutputDocumentRepository.cs:43.

public PolicyOutputDocument GetPolicyOutputDocument(long documentId)
{
    return Get(documentId);
}

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
  POD.output_document_seq_num,
  POD.update_num,
  POD.policy_period_eff_date,
  POD.agency_seq_num,
  POD.agent_num,
  POD.agency_viewed_flag,
  POD.agency_delivery_flag,
  POD.agency_delete_date,
  POD.create_user,
  POD.create_date,
  POD.update_user,
  POD.update_date,
  POD.release_date,
  POD.hold_task_seq_num,
  POD.task_user,
  POD.source_key_text,
  POD.ACCOUNT_NUM,
  POD.policy_num,
  POD.document_status_code
FROM policy_output_document POD
WHERE POD.output_document_seq_num = :documentId

Translation notes: - Get(id) is RepositoryBase<T>.Get → ISession.Get<T>(id) (package decompile). If the entity is already in the session's first-level cache, no SQL is issued. - A constrained HasOne(r => r.OutputDocument) is proxy-capable, and FluentNHibernate's default is lazy proxy, so the inferred SELECT reads only policy_output_document; output_document is not selected. If the one-to-one resolves eagerly at runtime, NHibernate adds a LEFT OUTER JOIN output_document on the shared PK; that join is not asserted here. - Policy is a lazy References; only the FK policy_num is selected, so POLICY is not joined. - p.DocumentStatus.Code is the identifier of DocumentStatusCode, so it short-circuits to the FK POD.document_status_code; document_status_code is never joined.

Operations and processes

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

Sources

  • Data/SAIF.Data.NHibernate/Repositories/OutputDocuments/PolicyOutputDocumentRepository.cs:43