Skip to content

SQL-093: EbillDocumentQueryProvider.GetNonImagedDocumentsforBatch

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

Classification

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

Parameters

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

Tables

Table Access Columns used
EBILL_DOCUMENT SELECT EBILL_DOCUMENT_SEQ_NUM, UPDATE_NUM, EBILL_DOCUMENT_SUB_NUM, EBILL_DOCUMENT_CONTROL_NUM, IMAGE_SEQ_NUM, UPDATE_USER, UPDATE_DATE, EBILL_SEQ_NUM, EBILL_DOCUMENT_TYPE_CODE
EBILL JOIN EBILL_SEQ_NUM, EBILL_RECEIPT_BATCH_SEQ_NUM

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/Ebilling/EbillDocumentQueryProvider.cs:27

The repository is a class field initialised from Factory.GetRepository<EbillDocument>() at Data/SAIF.Data/Queries/Claims/Ebilling/EbillDocumentQueryProvider.cs:16.

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillDocumentQueryProvider.cs:16
_repository = Factory.GetRepository<EbillDocument>().Query();

// Data/SAIF.Data/Queries/Claims/Ebilling/EbillDocumentQueryProvider.cs:27
return _repository.Where(doc => doc.Ebill.ReceiptBatch.Id == batchId && doc.ImageId == null).ToList();

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
  ED.EBILL_DOCUMENT_SEQ_NUM,
  ED.UPDATE_NUM,
  ED.EBILL_DOCUMENT_SUB_NUM,
  ED.EBILL_DOCUMENT_CONTROL_NUM,
  ED.IMAGE_SEQ_NUM,
  ED.UPDATE_USER,
  ED.UPDATE_DATE,
  ED.EBILL_SEQ_NUM,
  ED.EBILL_DOCUMENT_TYPE_CODE
FROM EBILL_DOCUMENT ED
  INNER JOIN EBILL E
    ON E.EBILL_SEQ_NUM = ED.EBILL_SEQ_NUM
WHERE E.EBILL_RECEIPT_BATCH_SEQ_NUM = :batchId
  AND ED.IMAGE_SEQ_NUM IS NULL

Translation notes:

  • doc.Ebill.ReceiptBatch is a non-identifier property of Ebill, so NHibernate joins EBILL. ReceiptBatch.Id is the batch identifier, so it short-circuits to E.EBILL_RECEIPT_BATCH_SEQ_NUM.

Operations and processes

Sources

  • Data/SAIF.Data/Queries/Claims/Ebilling/EbillDocumentQueryProvider.cs:27