SQL-350: Update BatchProviderAddress via StatelessProcessProviderAddressesForUpdates¶
This ORM statement updates a PROVIDER_ADDRESS row (address fields, foreign flag, location) for a batch-verified provider address, executed from Services/SAIF.Services/AddressVerificationService/AddressVerificationService.cs (L88, L120). The SQL below is inferred from the IRepository<BatchProviderAddress>.Update call and the BatchProviderAddress NHibernate mapping, not literal SQL text in source.
Classification¶
| Field | Value |
|---|---|
| SQL ID | SQL-350 |
| Operation type | Update |
| Execution method | ORM (IRepository.Update) |
| Database | Oracle |
| Schema | [unqualified]** |
| Command type | N/A (ORM-generated) |
| Business object | BatchProviderAddress |
| Criteria property | N/A — ORM |
| Lifecycle method | StatelessProcessProviderAddressesForUpdates |
Parameters¶
| Parameter | Direction | Type | Max length | Description |
|---|---|---|---|---|
:Id |
Input | long | N/A | Identifier of the BatchProviderAddress being updated (PROVIDER_ADDRESS_SEQ_NUM) |
:City |
Input | string | N/A | New value of CITY_NAME |
:CountryCode |
Input | string | N/A | New value of COUNTRY_CODE |
:EffectiveDate |
Input | DateTime | N/A | New value of EFF_DATE |
:ExpirationDate |
Input | DateTime? | N/A | New value of EXP_DATE |
:Line1 |
Input | string | N/A | New value of ADDRESS_LINE1 |
:Line2 |
Input | string | N/A | New value of ADDRESS_LINE2 |
:Line3 |
Input | string | N/A | New value of ADDRESS_LINE3 |
:Line4 |
Input | string | N/A | New value of ADDRESS_LINE4 |
:ZipCodeExtension |
Input | string | N/A | New value of ZIP_CODE_EXT |
:StateCode |
Input | string | N/A | New value of STATE_CODE |
:ZipCode |
Input | string | N/A | New value of ZIP_CODE |
:UpdateDate |
Input | DateTime | N/A | New value of UPDATE_DATE |
:UpdateUser |
Input | string | N/A | New value of UPDATE_USER |
:IsForeign |
Input | bool | N/A | New value of FOREIGN_ADDRESS_FLAG |
:AddressType |
Input | string | N/A | New value of PROVIDER_ADDRESS_CODE |
:ProviderLocationId |
Input | long | N/A | New value of PROVIDER_LOCATION_SEQ_NUM |
:newVersion |
Input | int | N/A | Incremented UPDATE_NUM value |
:oldVersion |
Input | int | N/A | Current UPDATE_NUM value (optimistic-concurrency check) |
Tables¶
| Table | Access | Columns used |
|---|---|---|
| PROVIDER_ADDRESS | UPDATE | PROVIDER_ADDRESS_SEQ_NUM, UPDATE_NUM, CITY_NAME, COUNTRY_CODE, EFF_DATE, EXP_DATE, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_LINE3, ADDRESS_LINE4, ZIP_CODE_EXT, STATE_CODE, ZIP_CODE, UPDATE_DATE, UPDATE_USER, FOREIGN_ADDRESS_FLAG, PROVIDER_ADDRESS_CODE, PROVIDER_LOCATION_SEQ_NUM |
LINQ statement¶
Source: Services/SAIF.Services/AddressVerificationService/AddressVerificationService.cs:88
// Services/SAIF.Services/AddressVerificationService/AddressVerificationService.cs:88
_unitOfWork.GetRepository<BatchProviderAddress>().Update(providerAddress);
// Services/SAIF.Services/AddressVerificationService/AddressVerificationService.cs:120
_unitOfWork.GetRepository<BatchProviderAddress>().Update(oldProviderAddress);
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
UPDATE PROVIDER_ADDRESS
SET
UPDATE_NUM = :newVersion,
CITY_NAME = :City,
COUNTRY_CODE = :CountryCode,
EFF_DATE = :EffectiveDate,
EXP_DATE = :ExpirationDate,
ADDRESS_LINE1 = :Line1,
ADDRESS_LINE2 = :Line2,
ADDRESS_LINE3 = :Line3,
ADDRESS_LINE4 = :Line4,
ZIP_CODE_EXT = :ZipCodeExtension,
STATE_CODE = :StateCode,
ZIP_CODE = :ZipCode,
UPDATE_DATE = :UpdateDate,
UPDATE_USER = :UpdateUser,
FOREIGN_ADDRESS_FLAG = :IsForeign,
PROVIDER_ADDRESS_CODE = :AddressType,
PROVIDER_LOCATION_SEQ_NUM = :ProviderLocationId
WHERE PROVIDER_ADDRESS_SEQ_NUM = :Id
AND UPDATE_NUM = :oldVersion
Translation notes:
Version(x => x.UpdateNumber).Column("UPDATE_NUM")- NHibernate sets the incremented version and adds the old-version predicate.Update(entity)emits an explicit UPDATE of every updatable mapped column (noDynamicUpdate()on this map).- Line 120 is the manual-rollback path that re-updates the row with the pre-change clone (
oldProviderAddress); same statement shape. - The service receives an injected
IUnitOfWork; no in-repo DependencyMap registersOracleStatelessUnitOfWorkFactory, so the session strategy cannot be confirmed from this repo. The explicitUpdatecall produces this UPDATE under either strategy.
Operations and processes¶
- AddressVerificationService.StatelessProcessProviderAddressesForUpdates — see Operations and processes
Sources¶
Services/SAIF.Services/AddressVerificationService/AddressVerificationService.cs (L88, L120)