Skip to content

SQL-358: Update RctPolicyServicePlan via ExpireServicePlan

This ORM statement updates a LC_POLICY_SERVICE_PLAN row's expiration and audit fields to expire an existing policy service plan, executed from Services/SAIF.Services/Rct/RctServicePlanService.cs (L263). The SQL below is inferred from the IRepository<RctPolicyServicePlan>.Update call and the RctPolicyServicePlan NHibernate mapping, not literal SQL text in source.

Classification

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

Parameters

Parameter Direction Type Max length Description
:PolicyNumber Input long N/A Identifier of the RctPolicyServicePlan being updated (POLICY_NUM)
:EffectiveDate Input DateTime N/A Identifier of the RctPolicyServicePlan being updated (EFF_DATE)
:ExpirationDate Input DateTime? N/A New value of EXP_DATE
:ServicePlanCode Input string N/A New value of LC_SERVICE_PLAN_CODE
:CreateUser Input string N/A New value of CREATE_USER
:CreateDate Input DateTime N/A New value of CREATED_DATE
:UpdateUser Input string N/A New value of UPDATE_USER
:UpdateDate Input DateTime? N/A New value of UPDATE_DATE

Tables

Table Access Columns used
LC_POLICY_SERVICE_PLAN UPDATE POLICY_NUM, EFF_DATE, EXP_DATE, LC_SERVICE_PLAN_CODE, CREATE_USER, CREATED_DATE, UPDATE_USER, UPDATE_DATE

LINQ statement

Source: Services/SAIF.Services/Rct/RctServicePlanService.cs:263

// Services/SAIF.Services/Rct/RctServicePlanService.cs:263
_unitOfWork.GetRepository<Model.Rct.RctPolicyServicePlan>().Update(servicePlanInTable);

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 LC_POLICY_SERVICE_PLAN
SET
  EXP_DATE = :ExpirationDate,
  LC_SERVICE_PLAN_CODE = :ServicePlanCode,
  CREATE_USER = :CreateUser,
  CREATED_DATE = :CreateDate,
  UPDATE_USER = :UpdateUser,
  UPDATE_DATE = :UpdateDate
WHERE POLICY_NUM = :PolicyNumber
  AND EFF_DATE = :EffectiveDate

Translation notes:

  • No Version(...) mapping, so the UPDATE has no optimistic-concurrency predicate.
  • Update(entity) emits an explicit UPDATE of every updatable mapped column (no DynamicUpdate() on this map).

Operations and processes

Sources

  • Services/SAIF.Services/Rct/RctServicePlanService.cs (L263)