---
title: SAIF.Domain SQL catalog
summary: Index of all SQL statements used by this library, grouped by operation type.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Domain
reference_type: package
---

# SAIF.Domain SQL catalog

SAIF.Domain has no raw SQL, stored-procedure calls, or `IBusinessCriteria` usage. This catalog indexes the 33 ORM operations found in this library: 18 explicit repository calls (`Add`/`Delete`/`Query`), 5 cascade inserts (children added to a mapped collection with `Cascade.AllDeleteOrphan`), and 10 implicit updates (property changes on loaded entities, persisted when the caller's `IUnitOfWork` flushes). NHibernate generates the actual SQL at runtime from the ClassMaps in `Data/SAIF.Data.NHibernate/Mappings/**`.

## Create operations

| SQL ID | Description | Type | Tables | Business object |
| --- | --- | --- | --- | --- |
| [SQL-001](SQL-001-audit-note-insert.md) | Insert an audit note against a bill or claim | ORM | CBP_NOTE | `AuditNote` |
| [SQL-002](SQL-002-audit-note-cascade-insert.md) | Attach a note to its parent bill via cascade insert | ORM (cascade)* | CBP_NOTE | `AuditNote` |
| [SQL-003](SQL-003-batch-insert.md) | Create a new ebilling batch | ORM | EBILL_BATCH | `Batch` |
| [SQL-004](SQL-004-batch-insert-with-clearinghouse.md) | Create a batch with clearinghouse defaults | ORM | EBILL_BATCH | `Batch` |
| [SQL-005](SQL-005-batch-insert-clearinghouse-default-dates.md) | Create a batch with default submission dates | ORM | EBILL_BATCH | `Batch` |
| [SQL-006](SQL-006-bill-status-cascade-insert.md) | Record a bill status-history entry | ORM (cascade)* | CBP_BILL_STATUS | `Bill` |
| [SQL-007](SQL-007-bill-regenerate-insert.md) | Insert a cloned bill during regeneration | ORM | CBP_BILL | `BillRegenerator` |
| [SQL-008](SQL-008-bill-service-cascade-insert.md) | Cascade-insert regenerated bill service lines | ORM (cascade)* | CBP_BILL_SERVICE | `BillRegenerator` |
| [SQL-009](SQL-009-certificate-holder-insert.md) | Insert a new certificate holder | ORM | CERTIFICATE_HOLDER | `CertificateHolder` |
| [SQL-010](SQL-010-eob-mco-fee-adjustment-insert.md) | Insert an MCO fee adjustment for an EOB | ORM | EBILL_EOB_ADJUSTMENT | `EobBuilder` |
| [SQL-011](SQL-011-eob-mco-remittance-advice-insert.md) | Insert an MCO fee remittance advice | ORM | EBILL_EOB_REMITTANCE_ADVICE | `EobBuilder` |
| [SQL-012](SQL-012-eob-service-adjustment-insert.md) | Insert a service-level EOB adjustment | ORM | EBILL_EOB_ADJUSTMENT | `EobBuilder` |
| [SQL-013](SQL-013-eob-remittance-advice-insert.md) | Insert a service-level remittance advice | ORM | EBILL_EOB_REMITTANCE_ADVICE | `EobBuilder` |
| [SQL-014](SQL-014-ebill-error-condition-insert.md) | Insert an ebill error/pend condition | ORM | EBILL_ERROR_CONDITION | `ErrorConditionHandler` |
| [SQL-015](SQL-015-ebill-service-cascade-insert.md) | Cascade-insert an ebill service parsed from an 837 file | ORM (cascade)* | EBILL_SERVICE | `File837Extractor` |
| [SQL-016](SQL-016-cbp-bill-insert.md) | Insert a newly generated CBP bill | ORM | CBP_BILL | `GenerateCbpBills` |
| [SQL-017](SQL-017-cbp-bill-service-cascade-insert.md) | Cascade-insert generated CBP bill service lines | ORM (cascade)* | CBP_BILL_SERVICE | `GenerateCbpBills` |

## Read operations

| SQL ID | Description | Type | Tables | Business object |
| --- | --- | --- | --- | --- |
| [SQL-018](SQL-018-mco-location-lookup.md) | Retrieve the MCO location matching a Guidewire MCO ID | ORM (LINQ) | MCO_GSA_LOCATION | `Claim` |
| [SQL-019](SQL-019-provider-location-lookup-legal-rep.md) | Retrieve the provider location for a claim's legal representative | ORM (LINQ) | PROVIDER_LOCATION | `Claim` |
| [SQL-020](SQL-020-provider-location-lookup-eob.md) | Retrieve provider locations for EOB generation | ORM (LINQ) | PROVIDER_LOCATION | `EobBuilder` |
| [SQL-021](SQL-021-ebill-lookup-for-eob.md) | Retrieve ebills for a chunk of bill IDs during EOB generation | ORM (LINQ) | EBILL | `EobBuilder` |
| [SQL-022](SQL-022-endorse-code-lookup.md) | Retrieve endorsement codes eligible for renewal packets | ORM (LINQ) | ENDORSE_CODE | `PacketDefinition` |

## Update operations

| SQL ID | Description | Type | Tables | Business object |
| --- | --- | --- | --- | --- |
| [SQL-023](SQL-023-ebill-batch-status-update.md) | Update batch status to Completed | ORM (dirty-check flush)* | EBILL_BATCH | `Batch` |
| [SQL-024](SQL-024-ebill-status-update-assigned.md) | Update ebill status to Assigned | ORM (dirty-check flush)* | EBILL | `BillAssignment` |
| [SQL-025](SQL-025-ebill-status-update-indexed.md) | Update ebill status to Indexed | ORM (dirty-check flush)* | EBILL | `BillServiceIndexer` |
| [SQL-026](SQL-026-certificate-holder-update.md) | Update certificate holder details on re-edit | ORM (dirty-check flush)* | CERTIFICATE_HOLDER | `CertificateHolder` |
| [SQL-027](SQL-027-certificate-holder-expire-update.md) | Update certificate holder to Expired | ORM (dirty-check flush)* | CERTIFICATE_HOLDER | `CertificateHolder` |
| [SQL-028](SQL-028-certificate-holder-supersede-update.md) | Update certificate holder to Superseded | ORM (dirty-check flush)* | CERTIFICATE_HOLDER | `CertificateHolder` |
| [SQL-029](SQL-029-ebill-status-update-completed.md) | Update ebill status to Completed after EOB attach | ORM (dirty-check flush)* | EBILL | `EobBuilder` |
| [SQL-030](SQL-030-ebill-status-update-277-response.md) | Update ebill status from a 277 response | ORM (dirty-check flush)* | EBILL | `File277CaBuilder` |
| [SQL-031](SQL-031-ebill-status-update-835-build.md) | Update ebill status after 835 file build | ORM (dirty-check flush)* | EBILL | `File835Builder` |
| [SQL-032](SQL-032-ebill-status-update-cbp-setup.md) | Update ebill status to CbpSetup after CBP generation | ORM (dirty-check flush)* | EBILL | `GenerateCbpBills` |

## Delete operations

| SQL ID | Description | Type | Tables | Business object |
| --- | --- | --- | --- | --- |
| [SQL-033](SQL-033-audit-note-delete.md) | Delete an audit note | ORM | CBP_NOTE | `AuditNote` |

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts.

## Related documentation
- [Index](../index.md)
- [Overview](../overview.md)
- [Architecture](../architecture.md)
- [Dependencies](../dependencies.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Database tables](../database-tables.md)
- [API reference](../api/index.md)

## Sources
- `Data/SAIF.Data.NHibernate/Mappings/Claims/Bills/CbpBillMap.cs`, `CbpBillServiceMap.cs`, `CbpBillStatusMap.cs`, `CbpNoteMap.cs`
- `Data/SAIF.Data.NHibernate/Mappings/Policies/Certificates/CertificateHolderMap.cs`
- `Data/SAIF.Data.NHibernate/Mappings/Claims/Ebilling/EbillMap.cs`, `EbillBatchMap.cs`, `EbillEobAdjustmentMap.cs`, `EbillEobRemittanceAdviceMap.cs`, `EbillErrorConditionMap.cs`, `EbillServiceMap.cs`
- `Domain/SAIF.Domain/Model/Claims/Bills/Notes/AuditNote.cs`
- `Domain/SAIF.Domain/Model/Claims/Ebilling/Batch.cs`
- `Domain/SAIF.Domain/Model/Claims/Bills/Bill.cs`
- `Domain/SAIF.Domain/Claims/Bills/BillRegenerator.cs`
- `Domain/SAIF.Domain/Model/Policies/Certificates/CertificateHolder.cs`
- `Domain/SAIF.Domain/Claims/Ebilling/EobBuilder.cs`, `ErrorConditionHandler.cs` (`Model/Claims/Ebilling/ErrorConditionHandler.cs`), `File837Extractor.cs`, `GenerateCBPBills.cs`, `BillAssignment.cs`, `File277CaBuilder.cs`, `File835Builder.cs`
- `Domain/SAIF.Domain/Model/Claims/Claim.cs`
- `Domain/SAIF.Domain/Tasks/Documents/Packets/PacketDefinition.cs`
- `Domain/SAIF.Domain/Claims/Ebilling/Indexing/BillServiceIndexer.cs`
