---
title: "SQL-260: ClaimBuilder.Policy"
summary: Read operation for `ClaimBuilder.Policy`
status: draft
owner: SAIF.Core documentation team
last_reviewed: 2026-09-24
library: SAIF.Data
reference_type: package
---

# SQL-260: ClaimBuilder.Policy

This statement is a read operation invoked through ORM (NHibernate LINQ). Executed by `ClaimBuilder.Policy`.

## Classification

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

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `number` | Input | long | N/A | Method argument of `ClaimBuilder.Policy` bound into the ORM expression; NHibernate generates the bind variable at runtime |
| `name` | Input | string | N/A | Method argument of `ClaimBuilder.Policy` bound into the ORM expression; NHibernate generates the bind variable at runtime |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [POLICY](../database-tables.md#policy) | INSERT (hypothetical) | POLICY_NUM, POLICY_NAME, LEGAL_NAME, SECURE_POLICY_CODE, OFFICE_CODE, ACCOUNT_NUM, POLICY_STATUS_CODE, MARKET_TYPE_CODE, POLICY_RELATIONSHIP_POLICY_NUM, POLICY_RELATIONSHIP_CODE, customer_service_team_code, ENTITY_CODE, TRADING_SEQ_NUM, RATE_ACCOUNT, AGENT_NUM |

## LINQ statement

Source: `Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:107`.

```csharp
// Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:107-109
if (!name.IsNullOrWhiteSpace())
    if (!Uow.GetRepository<Policy>().Query().Any(x => x.PolicyNumber == number))
        Uow.GetRepository<Policy>().Add(new Policy { PolicyNumber = number, PolicyName = name });
```

## Sample SQL

> **Test double — no runtime SQL.** This statement executes against `TestUnitOfWork`/`TestRepository<T>` (in-memory, `List<TEntity>`-backed test doubles in `SAIF.Framework.Core`); no NHibernate session is opened and no SQL is issued at runtime. The SQL below is the hypothetical statement the same expression would produce against a real NHibernate `IUnitOfWork` using the in-repo mappings, shown to document the mapping shape only — **no database table is accessed when this code runs.**

> **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.

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
INSERT INTO POLICY (
  POLICY_NUM,
  POLICY_NAME,
  LEGAL_NAME,
  SECURE_POLICY_CODE,
  OFFICE_CODE,
  ACCOUNT_NUM,
  POLICY_STATUS_CODE,
  MARKET_TYPE_CODE,
  POLICY_RELATIONSHIP_POLICY_NUM,
  POLICY_RELATIONSHIP_CODE,
  customer_service_team_code,
  ENTITY_CODE,
  TRADING_SEQ_NUM,
  RATE_ACCOUNT,
  AGENT_NUM)
VALUES (
  :PolicyNumber,
  :PolicyName,
  :LegalName,
  :SecurePolicyCode,
  :OfficeCode,
  :AccountNumber,
  :Status,
  :MarketType,
  :RelationshipPolicy,
  :Relationship,
  :CustomerServiceTeam,
  :Entity,
  :MainDbaName,
  :RateAccount,
  :Agent)
```

Translation notes:
- Scope split: see SQL-243 — this entry documents the INSERT at line 109.
- Only `POLICY_NUM` and `POLICY_NAME` are set; all other columns are NULL.

## Sources

- `Data/SAIF.Data/TestRepository/RepositoryBuilders/ClaimBuilder.cs:107`
