Skip to content

SQL-185: OutputDocumentQueryProvider.GetPolicyOutputDocument

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by OutputDocumentQueryProvider.GetPolicyOutputDocument.

Classification

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

Parameters

Parameter Direction Type Max length Description
documentId Input long N/A Method argument of OutputDocumentQueryProvider.GetPolicyOutputDocument bound into the ORM expression; NHibernate generates the bind variable at runtime

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/Queries/OutputDocuments/OutputDocumentQueryProvider.cs:55.

public PolicyOutputDocument GetPolicyOutputDocument(long documentId)
{
    return Factory.GetRepository<PolicyOutputDocument>().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) returns from the session first-level cache when the entity is already loaded; otherwise it emits the SELECT above. - update_num is the Version column.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/OutputDocuments/OutputDocumentQueryProvider.cs:55