---
title: "SQL-048: Create SecurityOverride via CreateOverride"
summary: Create operation against SecurityOverride via NHibernate ORM.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-09-24
library: SAIF.Services
reference_type: package
---

# SQL-048: Create SecurityOverride via CreateOverride

This ORM statement performs a create operation on `SecurityOverride` via `CreateOverride`, executed from `Services/SAIF.Services/Claims/SecurityOverride/SecurityOverrideService.cs` (L121).

## Classification

| Field | Value |
| --- | --- |
| **SQL ID** | SQL-048 |
| **Operation type** | Create |
| **Execution method** | ORM (IRepository.Add) |
| **Database** | Oracle |
| **Schema** | [unqualified]** |
| **Command type** | N/A (ORM-generated) |
| **Business object** | `SecurityOverride` |
| **Criteria property** | N/A — ORM |
| **Lifecycle method** | `CreateOverride` |

## Parameters

| Parameter | Direction | Type | Max length | Description |
| --- | --- | --- | --- | --- |
| `:Id` | Input | `long` | N/A | Identifier from `CL_OVERRIDE_SECURITY_SEQ.NEXTVAL` |
| `:ClaimId` | Input | `long` | N/A |  |
| `:EmplId` | Input | `string` | N/A |  |
| `:EffDate` | Input | `DateTime` | N/A |  |
| `:ExpDate` | Input | `DateTime` | N/A |  |
| `:IsWorkerConflict` | Input | `bool` | N/A | Bound as `'Y'`/`'N'` (`YesNoType`) |
| `:CreateDate` | Input | `DateTime` | N/A |  |
| `:CreateUser` | Input | `string` | N/A |  |
| `:UpdateDate` | Input | `DateTime?` | N/A |  |
| `:UpdateUser` | Input | `string` | N/A |  |
| `:UpdateNumber` | Input | `int?` | N/A |  |
| `:HostileWorker` | Input | `HostileWorkerCode` | N/A | Identifier of the referenced `HostileWorkerCode` entity (`References(x => x.HostileWorker)`) |

## Tables

| Table | Access | Columns used |
| --- | --- | --- |
| [CL_SECURITY_OVERRIDE](../database-tables.md#cl_security_override) | INSERT | CL_OVERRIDE_SECURITY_SEQ_NUM, CLAIM_ID, EMPLID, EFF_DATE, EXP_DATE, WORKER_CONFLICT_FLAG, CREATE_DATE, CREATE_USER, UPDATE_DATE, UPDATE_USER, UPDATE_NUM, HOSTILE_WORKER_CODE (identifier from sequence `CL_OVERRIDE_SECURITY_SEQ.NEXTVAL`) |

## LINQ statement

Source: `Services/SAIF.Services/Claims/SecurityOverride/SecurityOverrideService.cs:121`.

```csharp
// Services/SAIF.Services/Claims/SecurityOverride/SecurityOverrideService.cs:121
unitOfWork.GetRepository<Data.Model.Claims.SecurityOverrides.SecurityOverride>().Add(newData);
```

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

```sql
-- Inferred from LINQ (NHibernate mapping translation); not concrete SQL
SELECT CL_OVERRIDE_SECURITY_SEQ.NEXTVAL
FROM DUAL

INSERT INTO CL_SECURITY_OVERRIDE (
  CL_OVERRIDE_SECURITY_SEQ_NUM,
  CLAIM_ID,
  EMPLID,
  EFF_DATE,
  EXP_DATE,
  WORKER_CONFLICT_FLAG,
  CREATE_DATE,
  CREATE_USER,
  UPDATE_DATE,
  UPDATE_USER,
  UPDATE_NUM,
  HOSTILE_WORKER_CODE)
VALUES (
  :Id,
  :ClaimId,
  :EmplId,
  :EffDate,
  :ExpDate,
  :IsWorkerConflict,
  :CreateDate,
  :CreateUser,
  :UpdateDate,
  :UpdateUser,
  :UpdateNumber,
  :HostileWorker)
```

Translation notes:
- `:Id` is the value fetched from sequence `CL_OVERRIDE_SECURITY_SEQ` (`GeneratedBy.Native("CL_OVERRIDE_SECURITY_SEQ")`) before the INSERT; NHibernate assigns it to `SecurityOverride.Id`.
- `:IsWorkerConflict` are bound as `'Y'` / `'N'` (`YesNoType`).
- Reference FK values are bound from the associated entity's identifier; the referenced tables are **not** read or joined by this statement: `HostileWorker` → `HOSTILE_WORKER_CODE` (entity table `CL_HOSTILE_WORKER_CODE` not accessed).
- `HostileWorker` is obtained by a separate `HostileWorkerCode` `SingleOrDefault` lookup (`SecurityOverrideService.cs:112-114`), and `employeeData` by a separate `Employee` `FirstOrDefault` query (line 103); neither is part of this INSERT.

## Operations and processes
- SecurityOverrideService.CreateOverride — see [Operations and processes](../operations-processes.md)

> **Note:** Statements marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `Services/SAIF.Services/Claims/SecurityOverride/SecurityOverrideService.cs (L121)`
