Skip to content

SQL-012: AuditNoteQueryProvider.IsAuditNoteNoContention

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

Classification

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

Parameters

Parameter Direction Type Max length Description
noteId Input long N/A Method argument of AuditNoteQueryProvider.IsAuditNoteNoContention bound into the ORM expression; NHibernate generates the bind variable at runtime
updateNumber Input int N/A Method argument of AuditNoteQueryProvider.IsAuditNoteNoContention bound into the ORM expression; NHibernate generates the bind variable at runtime

Tables

Table Access Columns used
CBP_NOTE SELECT CBP_NOTE_SEQ_NUM, UPDATE_NUM

LINQ statement

Source: Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:74. The repository is a class field initialised from Factory.GetRepository<CbpNote>().Query() at Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:14. The query is guarded by if (noteId == 0) return true; at :68-71.

return repository.Any(x => x.Id == noteId && x.UpdateNumber == updateNumber);

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 1
FROM CBP_NOTE CN
WHERE CN.CBP_NOTE_SEQ_NUM = :noteId
  AND CN.UPDATE_NUM = :updateNumber
  AND ROWNUM <= 1

Translation notes: - Any() is an existence check. NHibernate may emit CASE WHEN EXISTS (…) instead; the semantics are the same. - No query runs when noteId == 0.

Operations and processes

Business rules

Sources

  • Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:74