﻿---
title: "ClaimBillEntryRepository"
summary: API reference for ClaimBillEntryRepository
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data.NHibernate
reference_type: package
---


# ClaimBillEntryRepository

`ClaimBillEntryRepository` is the `IClaimBillEntryRepository` implementation registered for `CbpBill`, but both of its public operations bypass NHibernate entirely and delegate to an injected `ICCClaimApiService` (from SAIF.Data), which calls the Guidewire CC Claim Data API over HTTP. The two named queries embedded in `ClaimBillEntry.hbm.xml` (`ClaimBillEntry_GetNextBillFromQueue`, `ClaimBillEntry_RestoreBillToQueue`) are still mapped but are never invoked by this class, evidencing an in-progress migration of claim bill queue processing from the legacy Oracle package to Guidewire (`saif-data-nhibernate-analysis.md` hybrid behaviour finding, [SDN-BR-001](../../business-rules.md#sdn-br-001-claim-bill-queue-operations-are-served-by-the-guidewire-cc-claim-api%2C-not-by-the-legacy-oracle-package)).

## Purpose
- Expose the claim bill queue "next bill" and "restore to queue" operations required by `IClaimBillEntryRepository`, while sourcing the data from the Guidewire CC Claim Data API rather than the mapped Oracle package, per [SDN-BR-001](../../business-rules.md#sdn-br-001-claim-bill-queue-operations-are-served-by-the-guidewire-cc-claim-api%2C-not-by-the-legacy-oracle-package).

## Context
- Namespace: `SAIF.Data.NHibernate.Repositories`
- Assembly/package: `SAIF.Data.NHibernate` (ships inside the `SAIF.SAIFCode.Core` NuGet package)
- Base class: `Repository<CbpBill>` from `SAIF.Framework.Data.NHibernate` (external, resolved via Legends CLI — see Inherited public members below).
- Implements: `IClaimBillEntryRepository`, defined in `SAIF.Data` (`Data/SAIF.Data/Interfaces/Repositories/**`)*.

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| ClaimBillEntryRepository(NHibernateUnitOfWork, ICCClaimApiService) | `public ClaimBillEntryRepository(NHibernateUnitOfWork unitOfWork, ICCClaimApiService cCClaimApiService)` | Constructor; passes `unitOfWork` to the `Repository<CbpBill>` base and stores the injected `ICCClaimApiService` used by both members below. |
| GetNextClaimBillFromQueue | `public ClaimBillQueueTask GetNextClaimBillFromQueue(bool hasConflictAccess)` | Synchronously blocks on `cCClaimApiService.GetNextClaimBillFromQueue(hasConflictAccess)` and returns the next queued claim bill task from Guidewire; `hasConflictAccess` is forwarded so the Guidewire API can apply conflict-claim access restrictions (SAIF.Data `CCClaimApiService`, [SDN-BR-001](../../business-rules.md#sdn-br-001-claim-bill-queue-operations-are-served-by-the-guidewire-cc-claim-api%2C-not-by-the-legacy-oracle-package)). |
| RestoreClaimBillToQueue | `public int RestoreClaimBillToQueue(long taskId)` | Synchronously blocks on `cCClaimApiService.RestoreClaimBillToQueue(taskId)` to return the given queue task to Guidewire's claim bill queue and returns the API's result code ([SDN-BR-001](../../business-rules.md#sdn-br-001-claim-bill-queue-operations-are-served-by-the-guidewire-cc-claim-api%2C-not-by-the-legacy-oracle-package)). |

## Inherited public members

Members in this section are inherited from `Repository<CbpBill>` in `SAIF.Framework.Data.NHibernate`. They are available on this type through inheritance.

| Member | Signature | Purpose | Origin |
| --- | --- | --- | --- |
| Add | `public void Add(CbpBill entity)` | Registers a new `CbpBill` entity for insertion on the next unit-of-work commit.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| Update | `public void Update(CbpBill entity)` | Marks an existing `CbpBill` entity as modified for the next unit-of-work commit.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| Delete | `public void Delete(CbpBill entity)` | Registers a `CbpBill` entity for deletion on the next unit-of-work commit.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| Query | `public IQueryable<CbpBill> Query()` | Returns a LINQ-queryable session projection over `CbpBill` for building ad hoc filters.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| Get | `public CbpBill Get(object id)` | Loads a `CbpBill` by primary key, returning `null` if not found.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| Load | `public CbpBill Load(object id)` | Loads a `CbpBill` by primary key as a (possibly proxied) reference, throwing if not found.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |
| SystemDate | `public DateTime SystemDate { get; }` | Current system date/time as tracked by the underlying session/unit of work.† | `SAIF.Framework.Data.NHibernate` — `RepositoryBase<CbpBill>` |

## Behavioral notes
- Both public members are purely a pass-through to `ICCClaimApiService` and use `.GetAwaiter().GetResult()` to synchronously block on an async HTTP call; this can deadlock in a synchronization-context-bound caller (e.g. classic ASP.NET) unless the callee guarantees `ConfigureAwait(false)` throughout*.
- The inherited `Repository<CbpBill>` CRUD surface (`Add`/`Update`/`Delete`/`Query`/`Get`/`Load`) is unused by this class's own methods; nothing in this repository calls back into the NHibernate mapping for `CbpBill` at runtime*.

## Constraints and usage notes
- `cCClaimApiService` requires the `cc.ccclaimdataapiurl` configuration key to be set (SAIF.Data), consistent with the "Indirect configuration" finding in `saif-data-nhibernate-analysis.md`.
- Consumers relying on the mapped named queries (`ClaimBillEntry_GetNextBillFromQueue`, `ClaimBillEntry_RestoreBillToQueue`) directly via `Session.GetNamedQuery()` will bypass the Guidewire delegation and read stale/legacy data; those queries are considered unused/legacy by this class**.

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI. Statements marked with `*` were inferred
> from code structure or contextual evidence. Statements marked with `**` could
> not be confirmed; treat as unknown until verified.

## 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)
- [SQL catalog](../../sql/index.md)
- [Procedures](../../procedures/index.md)
- [Security and authorization](../../security-authorization.md)
- [API reference](../index.md)

## Sources
- `Data/SAIF.Data.NHibernate/Repositories/ClaimBillEntryRepository.cs`
