Skip to content

SQL-162: LegalQueryProvider.GetOtherFirm

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

Classification

Field Value
SQL ID SQL-162
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 GetOtherFirm

Parameters

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

Tables

Table Access Columns used
OTHER_FIRM SELECT OTHER_FIRM_SEQ_NUM, FIRM_NAME

LINQ statement

Source: Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:118.

public OtherFirm GetOtherFirm(long id)
{
    return Factory.GetRepository<OtherFirm>().Query().FirstOrDefault(x => x.Id == id);
}

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
    OF1.OTHER_FIRM_SEQ_NUM,
    OF1.FIRM_NAME
  FROM OTHER_FIRM OF1
  WHERE OF1.OTHER_FIRM_SEQ_NUM = :id
) WHERE ROWNUM <= 1

Translation notes: - Alias OF1 avoids the Oracle reserved word OF.

Operations and processes

Business rules

Sources

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