Skip to content

SQL-154: LegalQueryProvider.GetClaimIdForCase

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

Classification

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

Parameters

Parameter Direction Type Max length Description
claimNumOrCaseNumber Input string N/A Method argument of LegalQueryProvider.GetClaimIdForCase bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
LEGAL_CASE SELECT LEGAL_CASE_SEQ_NUM, CLAIM_ID, WCB_NUM, DCBS_NUM, OALJ_NUM, OWCP_NUM, BRB_NUM, REQUEST_DATE, CLAIM_IMAGE_ALERTS_FLAG, CREATE_USER, CREATE_DATE, UPDATE_USER, UPDATE_DATE, MOST_RECENT_HEARING_SEQ_NUM, CASE_STATUS_CODE, WORKER_ATTY_PROV_LOC_ID, WORKER_ATTY_FIRM_PROV_LOC_ID

LINQ statement

Source: Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:55. The repository is obtained at Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:28.

// Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:28
repository = Factory.GetRepository<LegalCase>().Query();

// Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:55
var result = repository.FirstOrDefault(x => x.WcbNumber == claimNumOrCaseNumber ||
                                          x.BrbNumber == claimNumOrCaseNumber ||
                                          x.DcbsNumber == claimNumOrCaseNumber ||
                                          x.OaljNumber == claimNumOrCaseNumber ||
                                          x.OwcpNumber == claimNumOrCaseNumber);

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 *
FROM (
  SELECT
    LC.LEGAL_CASE_SEQ_NUM,
    LC.CLAIM_ID,
    LC.WCB_NUM,
    LC.DCBS_NUM,
    LC.OALJ_NUM,
    LC.OWCP_NUM,
    LC.BRB_NUM,
    LC.REQUEST_DATE,
    LC.CLAIM_IMAGE_ALERTS_FLAG,
    LC.CREATE_USER,
    LC.CREATE_DATE,
    LC.UPDATE_USER,
    LC.UPDATE_DATE,
    LC.MOST_RECENT_HEARING_SEQ_NUM,
    LC.CASE_STATUS_CODE,
    LC.WORKER_ATTY_PROV_LOC_ID,
    LC.WORKER_ATTY_FIRM_PROV_LOC_ID
  FROM LEGAL_CASE LC
  WHERE LC.WCB_NUM = :claimNumOrCaseNumber
    OR LC.BRB_NUM = :claimNumOrCaseNumber
    OR LC.DCBS_NUM = :claimNumOrCaseNumber
    OR LC.OALJ_NUM = :claimNumOrCaseNumber
    OR LC.OWCP_NUM = :claimNumOrCaseNumber
)
WHERE ROWNUM <= 1

Translation notes: - Oracle10 row limit for FirstOrDefault(): the query (including any ORDER BY) is wrapped in ROWNUM <= 1 (limit written inline; NHibernate binds it as a parameter at runtime).

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:55