SQL-393: Delete TempDataPersonAddress via DeleteTempRecords¶
This statement deletes the TempDataPersonAddress entity identified by its composite key (RUN_ID, PERSON_ID, ADDRESS_CODE) from CLM_DBA.TEMP_DATA_PERSON_ADDRESS, executed via IUnitOfWork.GetRepository<T>().Delete(...) from Services/SAIF.Services/Collections/CollectionsService.cs (L1835) in CollectionsService.DeleteTempRecords. The SQL below is inferred from this repository call and the NHibernate TempDataPersonAddressMap mapping — it is not literal SQL present in source.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-393 |
| Operation type | Delete |
| Execution method | ORM (IRepository.Delete) |
| Database | Oracle |
| Schema | CLM_DBA (explicit qualifier in Table()) |
| Command type | N/A (ORM-generated) |
| Business object | TempDataPersonAddress |
| Criteria property | N/A — ORM |
| Lifecycle method | DeleteTempRecords |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
:RunId |
Input | string | N/A | Identifier of the TempDataPersonAddress being deleted (RUN_ID) |
:PersonId |
Input | Int64 | N/A | Identifier of the TempDataPersonAddress being deleted (PERSON_ID) |
:AddressCode |
Input | string | N/A | Identifier of the TempDataPersonAddress being deleted (ADDRESS_CODE) |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| TEMP_DATA_PERSON_ADDRESS | DELETE | RUN_ID, PERSON_ID, ADDRESS_CODE |
LINQ statement¶
Source: Services/SAIF.Services/Collections/CollectionsService.cs:1835
// Services/SAIF.Services/Collections/CollectionsService.cs:1835
addresses.ToList().ForEach(x => UnitOfWork.GetRepository<TempDataPersonAddress>().Delete(x));
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
DELETE FROM CLM_DBA.TEMP_DATA_PERSON_ADDRESS
WHERE RUN_ID = :RunId
AND PERSON_ID = :PersonId
AND ADDRESS_CODE = :AddressCode
Translation notes:
- Schema is embedded in the table string:
Table("CLM_DBA.TEMP_DATA_PERSON_ADDRESS"). Column-name casing is reproduced exactly as mapped (mixed case in source; Oracle treats unquoted identifiers case-insensitively). - Composite key:
CompositeId().KeyProperty(RunId,"RUN_ID").KeyProperty(PersonId,"PERSON_ID").KeyProperty(AddressCode,"ADDRESS_CODE"). - One DELETE per row of SQL-338's query.
Operations and processes¶
- DebtorNameItem.DeleteTempRecords — see Operations and processes
Sources¶
Services/SAIF.Services/Collections/CollectionsService.cs (L1835)