Skip to content

SQL-354: Update CbpServiceDescriptionStateless via UpdateServiceDescription

This ORM statement updates a CBP_SERVICE_DESCRIPTION row's description text and expiration date for a bill service code/type/effective-date combination, executed from Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs (L387). The SQL below is inferred from the IRepository<CbpServiceDescriptionStateless>.Update call and the CbpServiceDescriptionStateless NHibernate mapping, not literal SQL text in source.

Classification

Field Value
SQL ID SQL-354
Operation type Update
Execution method ORM (IRepository.Update)
Database Oracle
Schema [unqualified]**
Command type N/A (ORM-generated)
Business object CbpServiceDescriptionStateless
Criteria property N/A — ORM
Lifecycle method UpdateServiceDescription

Parameters

Parameter Direction Type Max length Description
:Service Input String N/A Identifier of the CbpServiceDescriptionStateless being updated (BILL_SERVICE_CODE)
:ServiceType Input String N/A Identifier of the CbpServiceDescriptionStateless being updated (BILL_SERVICE_TYPE_CODE)
:EffectiveDate Input DateTime N/A Identifier of the CbpServiceDescriptionStateless being updated (SERVICE_DESCR_EFF_DATE)
:ExpirationDate Input DateTime? N/A New value of SERVICE_DESCR_EXP_DATE
:Text Input string N/A New value of SERVICE_DESCR_TEXT
:UpdateUser Input string N/A New value of UPDATE_USER
:UpdateDate Input DateTime N/A New value of UPDATE_DATE
: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
CBP_SERVICE_DESCRIPTION UPDATE BILL_SERVICE_CODE, BILL_SERVICE_TYPE_CODE, SERVICE_DESCR_EFF_DATE, UPDATE_NUM, SERVICE_DESCR_EXP_DATE, SERVICE_DESCR_TEXT, UPDATE_USER, UPDATE_DATE

LINQ statement

Source: Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs:387

// Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs:387
unitOfWork.GetRepository<CbpServiceDescriptionStateless>().Update(cbpServiceDescription);

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 CBP_SERVICE_DESCRIPTION
SET
  UPDATE_NUM = :newVersion,
  SERVICE_DESCR_EXP_DATE = :ExpirationDate,
  SERVICE_DESCR_TEXT = :Text,
  UPDATE_USER = :UpdateUser,
  UPDATE_DATE = :UpdateDate
WHERE BILL_SERVICE_CODE = :Service
  AND BILL_SERVICE_TYPE_CODE = :ServiceType
  AND SERVICE_DESCR_EFF_DATE = :EffectiveDate
  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 (no DynamicUpdate() on this map).

Operations and processes

Sources

  • Services/SAIF.Services/Claims/ICDCodeService/Icd10CodeService.cs (L387)