---
title: "executeKK_T_IDO_RSV_PKUPDATE()"
description: "Detailed Design — Business logic for updating IDO_RSV record by primary key"
---

# Business Logic — JBSbatKKAdChbCsChgFixBfDlRvCl.executeKK_T_IDO_RSV_PKUPDATE() [13 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKAdChbCsChgFixBfDlRvCl` |
| Access | `private` |
| Layer | Service (Batch-side business service) |
| Module | `service` (Package: `eo.business.service`) |
| Method Signature | `private void executeKK_T_IDO_RSV_PKUPDATE(Object[] setParam, Object[] whereParam) throws Exception` |
| FQN | `eo.business.service.JBSbatKKAdChbCsChgFixBfDlRvCl` |
| Source File | `source/koptBatch/src/eo/business/service/JBSbatKKAdChbCsChgFixBfDlRvCl.java` |
| Line Range | 138–150 (13 lines of code) |

## 1. Role

### JBSbatKKAdChbCsChgFixBfDlRvCl.executeKK_T_IDO_RSV_PKUPDATE()

This method performs a **primary-key-based update** of the `KK_T_IDO_RSV` table, which stores **move/transfer reservation records** (異動予約, *Ido Yuyaku*) in the batch processing domain. The batch system uses these records to track items or accounts that are scheduled for relocation — for example, moving a customer service from one line to another, or shifting a product reservation to a different fulfillment path.

The method implements a **standard PK-update CRUD pattern**: it accepts two `Object[]` arrays — one for the fields to update (`setParam`) and one for the primary-key condition (`whereParam`) — constructs intermediate `JBSbatCommonDBInterface` map objects to hold the values, and delegates the actual database operation to the `db_KK_T_IDO_RSV` mapper via its `updateByPrimaryKeys()` method. This follows the enterprise pattern of using parameterized map-based DAO calls rather than raw SQL in the business service layer.

Its role in the larger system is that of a **focused data-persistence utility** within the batch service class `JBSbatKKAdChbCsChgFixBfDlRvCl`. It is called internally by `updateIdoRsv()` to commit changes to a move-reservation record's status. It is private, meaning it serves as an internal helper rather than a public API, and it handles a single, well-defined business entity: the `KK_T_IDO_RSV` move-reservation table.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["executeKK_T_IDO_RSV_PKUPDATE(setParam, whereParam)"])
    STEP1["Create setMap = new JBSbatCommonDBInterface()"]
    STEP2["setMap.setValue('IDO_RSV_STAT_CD', setParam[0])"]
    STEP3["Create whereMap = new JBSbatCommonDBInterface()"]
    STEP4["whereMap.setValue('IDO_RSV_NO', whereParam[0])"]
    STEP5["db_KK_T_IDO_RSV.updateByPrimaryKeys(whereMap, setMap)"]
    END_NODE(["Return (void) / Next"])

    START --> STEP1 --> STEP2 --> STEP3 --> STEP4 --> STEP5 --> END_NODE
```

**Processing Flow Description:**

1. **Create setMap** — A new `JBSbatCommonDBInterface` instance (`setMap`) is instantiated to hold the columns and values that will be updated in the database. This acts as the "set clause" carrier for the SQL UPDATE.

2. **Set the status code** — `setMap.setValue("IDO_RSV_STAT_CD", setParam[0])` assigns the first element of `setParam` to the `IDO_RSV_STAT_CD` (異動予約状態コード, *IDO Reservation Status Code*) field. This is the only field being updated. The status code determines the current state of the move reservation (e.g., open, in-progress, closed, cancelled).

3. **Create whereMap** — A second `JBSbatCommonDBInterface` instance (`whereMap`) is instantiated to hold the primary-key conditions that identify which record(s) to update.

4. **Set the primary key** — `whereMap.setValue("IDO_RSV_NO", whereParam[0])` assigns the first element of `whereParam` to the `IDO_RSV_NO` (異動予約番号, *IDO Reservation Number*) field. This uniquely identifies the move-reservation record to be updated.

5. **Execute DB update** — `db_KK_T_IDO_RSV.updateByPrimaryKeys(whereMap, setMap)` performs the actual database UPDATE operation, using `IDO_RSV_NO` as the WHERE condition and `IDO_RSV_STAT_CD` as the SET column.

There are **no conditional branches** in this method. It follows a strict linear execution path — a typical pattern for a batch-side PK-update helper that delegates all branching logic (validation, error handling, multi-column updates) to the caller (`updateIdoRsv()`).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `setParam` | `Object[]` | Array of **fields to update** in the `KK_T_IDO_RSV` table. Currently, the method always uses `setParam[0]` to set the `IDO_RSV_STAT_CD` (異動予約状態コード / IDO Reservation Status Code). The status code drives the reservation workflow state — e.g., from "open" to "closed" when a move is completed. |
| 2 | `whereParam` | `Object[]` | Array of **primary-key filter conditions** to identify the target record. Currently, the method always uses `whereParam[0]` to set the `IDO_RSV_NO` (異動予約番号 / IDO Reservation Number), which is the unique identifier for the move-reservation record. |

**External State / Instance Fields Accessed:**

| Field | Type | Business Description |
|-------|------|---------------------|
| `db_KK_T_IDO_RSV` | `JBSbatCommonDBInterface` (or subtype) | The database mapper / DAO for the `KK_T_IDO_RSV` (異動予約 / Move Reservation) table. Handles the actual SQL UPDATE statement execution. |

## 4. CRUD Operations / Called Services

### Pre-computed evidence from code analysis graph:

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| U | `db_KK_T_IDO_RSV.updateByPrimaryKeys` | — | `KK_T_IDO_RSV` | Updates the `IDO_RSV_STAT_CD` field of the move-reservation record identified by `IDO_RSV_NO` |

### Called Service Details:

| # | Method Call | CRUD | SC Code | Entity / DB | Business Description |
|---|------------|------|---------|-------------|---------------------|
| 1 | `db_KK_T_IDO_RSV.updateByPrimaryKeys(whereMap, setMap)` | U | — | `KK_T_IDO_RSV` | Performs an UPDATE on the Move Reservation (異動予約) table, setting the status code (`IDO_RSV_STAT_CD`) for the record matching the primary key (`IDO_RSV_NO`). |

**Classification Rationale:**
- `updateByPrimaryKeys` is an **Update (U)** operation — it modifies existing records in `KK_T_IDO_RSV` based on their primary key.
- No other entity or DB tables are touched by this method.
- No SC (Service Component) or CBS (CBS) codes are embedded in the method name, as the mapper object (`db_KK_T_IDO_RSV`) encapsulates the SC-level logic internally.

## 5. Dependency Trace

### Direct Callers:

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | `JBSbatKKAdChbCsChgFixBfDlRvCl.updateIdoRsv()` | `updateIdoRsv()` -> `executeKK_T_IDO_RSV_PKUPDATE(setParam, whereParam)` | `updateByPrimaryKeys [U] KK_T_IDO_RSV` |

**Caller Analysis:**
- `updateIdoRsv()` is a method within the same class `JBSbatKKAdChbCsChgFixBfDlRvCl`. It serves as the public-facing entry point that prepares the `setParam` and `whereParam` arrays and delegates to `executeKK_T_IDO_RSV_PKUPDATE` for the actual persistence.
- This method is not called by any screen (`KKSV*`) or CBS layer directly — it is a private helper method scoped to the batch service class.
- The terminal operation reached from this method is a single UPDATE to the `KK_T_IDO_RSV` table.

## 6. Per-Branch Detail Blocks

### Block 1 — EXEC (L141)

> Create the set parameter map for the UPDATE operation.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `setMap = new JBSbatCommonDBInterface();` // Create a new map object to hold SET clause data |

### Block 2 — SET (L142)

> Assign the move reservation status code from setParam to the set map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `setMap.setValue("IDO_RSV_STAT_CD", setParam[0]);` // Map the status code field name and its value to the set map |

### Block 3 — EXEC (L145)

> Create the WHERE parameter map for the UPDATE operation.

| # | Type | Code |
|---|------|------|
| 1 | NEW | `whereMap = new JBSbatCommonDBInterface();` // Create a new map object to hold WHERE clause data |

### Block 4 — SET (L146)

> Assign the move reservation number (primary key) from whereParam to the where map.

| # | Type | Code |
|---|------|------|
| 1 | SET | `whereMap.setValue("IDO_RSV_NO", whereParam[0]);` // Map the primary key field name and its value to the where map |

### Block 5 — CALL (L149)

> Execute the actual database UPDATE via the mapper's primary-key-based update method.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `db_KK_T_IDO_RSV.updateByPrimaryKeys(whereMap, setMap);` // Perform DB update with WHERE and SET maps |

---

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `IDO_RSV_STAT_CD` | Field | Move Reservation Status Code (異動予約状態コード) — Indicates the current workflow state of a move/transfer reservation record. |
| `IDO_RSV_NO` | Field | Move Reservation Number (異動予約番号) — Unique identifier for a move-reservation record in the `KK_T_IDO_RSV` table. |
| `KK_T_IDO_RSV` | Entity | Move Reservation Table (異動予約テーブル) — Database table storing move/transfer reservation records used by the batch system to track scheduled relocations. |
| `setParam` | Parameter | Set parameter array (設定項目) — Carries the column-value pairs to be updated in the database. |
| `whereParam` | Parameter | Where parameter array (条件項目) — Carries the primary-key column-value pairs to identify which record(s) to update. |
| `JBSbatCommonDBInterface` | Class | Common batch-side database interface — A map-based data structure used to pass column names and values to DAO mapper methods, avoiding raw SQL in business services. |
| `updateByPrimaryKeys` | Method | Primary-key-based update — DAO mapper method that performs an SQL UPDATE using WHERE conditions from a map object and SET values from a second map object. |
| `updateIdoRsv()` | Method | Move reservation update (異動予約更新処理) — Public method in the same class that prepares parameters and calls `executeKK_T_IDO_RSV_PKUPDATE` to commit changes. |
| Batch | Term | A background processing job that runs outside of real-time user interaction, typically on a scheduled basis. |
| PK (ＰＫ) | Abbreviation | Primary Key (主キー) — The unique identifier used to locate and update a specific record in a database table. |
| DBアクセス | Japanese | Database access (DBアクセス) — The act of performing data persistence operations (insert/update/delete) against the database. |
| 異動予約 | Japanese | Move/Transfer Reservation (異動予約) — A reservation to move or transfer a service, account, or product from one state/path to another. |
| 更新処理 | Japanese | Update processing (更新処理) — The operation of modifying existing data in the database. |
