SQL-166: LegalQueryProvider.IsImageAlertNeeded¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by LegalQueryProvider.IsImageAlertNeeded.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-166 |
| 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 | IsImageAlertNeeded |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
claimId |
Input | long | N/A | Method argument of LegalQueryProvider.IsImageAlertNeeded bound into the ORM expression; NHibernate generates the bind variable at runtime |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| LEGAL_CASE | SELECT (existence) | CLAIM_ID, CLAIM_IMAGE_ALERTS_FLAG |
LINQ statement¶
Source: Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:136.
public bool IsImageAlertNeeded(long claimId)
{
return Factory.GetRepository<LegalCase>().Query().Any(x => x.ClaimId == claimId && x.IsImageAlert);
}
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 1
FROM LEGAL_CASE LC
WHERE LC.CLAIM_ID = :claimId
AND LC.CLAIM_IMAGE_ALERTS_FLAG = 'Y'
) WHERE ROWNUM <= 1
Translation notes:
- IsImageAlert → CLAIM_IMAGE_ALERTS_FLAG, CustomType<YesNoType>(). A bare boolean member in a predicate becomes = 'Y'.
- Any() → row-limited existence probe.
Operations and processes¶
Business rules¶
Sources¶
Data/SAIF.Data/Queries/Legal/LegalQueryProvider.cs:136