SQL-007: AuditNoteQueryProvider.GetAllAuditNotes¶
This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by AuditNoteQueryProvider.GetAllAuditNotes.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-007 |
| 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 | GetAllAuditNotes |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
billId |
Input | long | N/A | Method argument of AuditNoteQueryProvider.GetAllAuditNotes bound into the ORM expression; NHibernate generates the bind variable at runtime |
claimId |
Input | long | N/A | Method argument of AuditNoteQueryProvider.GetAllAuditNotes bound into the ORM expression; NHibernate generates the bind variable at runtime |
includeInactive |
Input | bool | N/A | Method argument of AuditNoteQueryProvider.GetAllAuditNotes 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, ACTIVE_FLAG, CREATE_DATE, CREATE_USER, UPDATE_DATE, UPDATE_USER, NOTE_TXT, CLAIM_ID, NOTE_TYPE_CODE, NOTE_CATEGORY_CODE, BILL_ID |
LINQ statement¶
Source: Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:39. The repository is a class field initialised from Factory.GetRepository<CbpNote>().Query() at Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:14.
return repository.Where(x => x.Bill.Id == billId || x.ClaimId == claimId
&& (x.IsActive || x.IsActive != includeInactive)).ToList();
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
CN.CBP_NOTE_SEQ_NUM,
CN.UPDATE_NUM,
CN.ACTIVE_FLAG,
CN.CREATE_DATE,
CN.CREATE_USER,
CN.UPDATE_DATE,
CN.UPDATE_USER,
CN.NOTE_TXT,
CN.CLAIM_ID,
CN.NOTE_TYPE_CODE,
CN.NOTE_CATEGORY_CODE,
CN.BILL_ID
FROM CBP_NOTE CN
WHERE CN.BILL_ID = :billId
OR (CN.CLAIM_ID = :claimId
AND (CN.ACTIVE_FLAG = 'Y' OR CN.ACTIVE_FLAG <> :includeInactive))
Translation notes:
- x.Bill.Id resolves to the FK CN.BILL_ID with no join; CBP_BILL is not accessed as a separate table.
- Precedence: C# && binds tighter than ||, so the active/inactive filter applies only to the CLAIM_ID branch. Notes matching BILL_ID are returned regardless of ACTIVE_FLAG; this is likely unintended, but it is the actual behavior.
Operations and processes¶
Sources¶
Data/SAIF.Data/Queries/Claims/AuditNoteQueryProvider.cs:39