Skip to content

SQL-163: LegalQueryProvider.GetLegalPerson

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

Classification

Field Value
SQL ID SQL-163
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 GetLegalPerson

Parameters

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

Tables

Table Access Columns used
LEGAL_PERSON SELECT LEGAL_PERSON_SEQ_NUM, FIRST_NAME, MIDDLE_INITIAL, LAST_NAME, PREFERRED_NAME, CREATE_USER, CREATE_DATE, UPDATE_USER, UPDATE_DATE

LINQ statement

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

public LegalPerson GetLegalPerson(long id)
{
    return Factory.GetRepository<LegalPerson>().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
    LP.LEGAL_PERSON_SEQ_NUM,
    LP.FIRST_NAME,
    LP.MIDDLE_INITIAL,
    LP.LAST_NAME,
    LP.PREFERRED_NAME,
    LP.CREATE_USER,
    LP.CREATE_DATE,
    LP.UPDATE_USER,
    LP.UPDATE_DATE
  FROM LEGAL_PERSON LP
  WHERE LP.LEGAL_PERSON_SEQ_NUM = :id
) WHERE ROWNUM <= 1

Operations and processes

Business rules

Sources

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