---

# Business Logic — JBSbatKKSvkeiDelTgCst.initial() [18 LOC]

| Field | Value |
|-------|-------|
| Fully Qualified Name | `eo.business.service.JBSbatKKSvkeiDelTgCst` |
| Layer | Service Component (Batch) |
| Module | `service` (Package: `eo.business.service`) |

## 1. Role

### JBSbatKKSvkeiDelTgCst.initial()

This method serves as the **initialization entry point** for the Service Contract Deletion Target Extraction batch process (`JBSbatKKSvkeiDelTgCst`), whose purpose is to extract service contracts scheduled for deletion cancellation (「サービス契約消去対象抽出」). In the broader K-Opticom customer core system, this batch identifies which service contracts and their associated detail records should be purged — specifically targeting Fiber-to-the-Home (FTTH/eo Optical Net), ADSL, and eo Optical Telephone subscription lines. The method performs two key initialization tasks: it propagates common batch parameters up to the parent service class via `setCommonInfo()`, and it constructs per-table `JBSbatSQLAccess` instances for the four database tables the batch will later query and update during its main processing phase (KK_T_SVKEIUW_EOH_NET, KK_T_SVKEIUW_EOADSL, KK_T_SVC_KEI_EOH_TEL, KK_T_ODR_SET). The class supports two deletion processing types (DEL_TRAN_SBT_SOD = "1" for standard SOD issuance deletion, and DEL_TRAN_SBT_SOD_AGING_UPD = "3" for SOD issuance with aging update) and three deletion target types (DEL_TRGT_SBT_ISP_NINSHO_ID = "01" for ISP authentication ID, DEL_TRGT_SBT_PPP_NINSHO_ID = "06" for PPP authentication ID, and DEL_TRGT_SBT_ADSL_NINSHO_ID = "16" for ADSL authentication ID). As a constructor-style initialization method in the batch service hierarchy, its role is to prepare the runtime environment so that subsequent main processing methods can execute SQL operations against the correct tables without re-instantiating access objects.

## 2. Processing Pattern (Detailed Business Logic)

```mermaid
flowchart TD
    START(["initial(JBSbatCommonItem commonItem)"])
    START --> CALL_SET["CALL: super.setCommonInfo(commonItem)
Propagate common batch parameters to parent"]
    CALL_SET --> INIT_DB1["INIT: db_KK_T_SVKEIUW_EOH_NET
KK_T_SVKEIUW_EOH_NET
(Service contract details <eo Optical Net>)"]
    INIT_DB1 --> INIT_DB2["INIT: db_KK_T_SVKEIUW_EOADSL
KK_T_SVKEIUW_EOADSL
(Service contract details <eo ADSL>)"]
    INIT_DB2 --> INIT_DB3["INIT: db_KK_T_SVC_KEI_EOH_TEL
KK_T_SVC_KEI_EOH_TEL
(Service contract <eo Optical Telephone>)"]
    INIT_DB3 --> INIT_DB4["INIT: db_KK_T_ODR_SET
KK_T_ODR_SET
(Order settings)"]
    INIT_DB4 --> END_NODE(["Return void"])
```

**Processing flow:**

1. **Super.setCommonInfo()** — The method delegates to its parent class (`JBSbatBusinessService`) to set up common batch information from the `commonItem` parameter. This includes batch run parameters, logging context, and shared service configuration.
2. **DB Access Object Creation (4 tables)** — Four `JBSbatSQLAccess` instances are instantiated sequentially, each bound to a specific database table:
   - `db_KK_T_SVKEIUW_EOH_NET` → Table `KK_T_SVKEIUW_EOH_NET` (Service contract details for eo Optical Net / FTTH services)
   - `db_KK_T_SVKEIUW_EOADSL` → Table `KK_T_SVKEIUW_EOADSL` (Service contract details for eo ADSL services)
   - `db_KK_T_SVC_KEI_EOH_TEL` → Table `KK_T_SVC_KEI_EOH_TEL` (Service contracts for eo Optical Telephone)
   - `db_KK_T_ODR_SET` → Table `KK_T_ODR_SET` (Order settings — used for deriving deletion order conditions)
3. **Return** — The method returns void; execution proceeds to the batch's main processing method.

Note: The `db_KK_T_ODR_HAKKO_JOKEN` table (Order release conditions) was previously initialized but was removed in version 5.00.00 (IT1-2013-0000285, 2013/02/13).

## 3. Parameter Analysis

| No | Parameter Name | Type | Business Description |
|----|---------------|------|---------------------|
| 1 | `commonItem` | `JBSbatCommonItem` | Batch common parameter message — carries shared batch execution metadata including batch ID, run date, logging configuration, database connection context, and service-type routing information. This object is passed up to the parent service class via `setCommonInfo()` and is also forwarded to each `JBSbatSQLAccess` constructor so that database operations use the same session context. |

**Instance fields set by this method:**

| Field Name | Type | Business Description |
|-----------|------|---------------------|
| `db_KK_T_SVKEIUW_EOH_NET` | `JBSbatSQLAccess` | Database access handle for the eo Optical Net (FTTH) service contract details table — used for reading/deleting FTTH subscription records |
| `db_KK_T_SVKEIUW_EOADSL` | `JBSbatSQLAccess` | Database access handle for the eo ADSL service contract details table — used for reading/deleting ADSL subscription records |
| `db_KK_T_SVC_KEI_EOH_TEL` | `JBSbatSQLAccess` | Database access handle for the eo Optical Telephone service contract table — used for reading/deleting telephone subscription records |
| `db_KK_T_ODR_SET` | `JBSbatSQLAccess` | Database access handle for the order settings table — used for querying order configuration during deletion target extraction |

## 4. CRUD Operations / Called Services

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

| CRUD | SC / CBS | SC Code | Entity / DB | Operation Description |
|------|----------|---------|-------------|----------------------|
| - | `JBSbatBusinessService.setCommonInfo` | - | - | Calls `setCommonInfo(JBSbatCommonItem)` in parent class to propagate common batch parameters |
| - | `JBSbatSQLAccess` (constructor) | - | KK_T_SVKEIUW_EOH_NET | Creates SQL access handle for the eo Optical Net service contract details table |
| - | `JBSbatSQLAccess` (constructor) | - | KK_T_SVKEIUW_EOADSL | Creates SQL access handle for the eo ADSL service contract details table |
| - | `JBSbatSQLAccess` (constructor) | - | KK_T_SVC_KEI_EOH_TEL | Creates SQL access handle for the eo Optical Telephone service contract table |
| - | `JBSbatSQLAccess` (constructor) | - | KK_T_ODR_SET | Creates SQL access handle for the order settings table |

**Classification:** This method performs no direct Create/Read/Update/Delete operations on database tables. Instead, it performs **initialization** — creating `JBSbatSQLAccess` handles (which are connection abstractions, not SQL operations themselves). The actual R/U/D operations occur in later batch processing methods that use these handles. The `setCommonInfo` call is a **setter/set** operation on the parent class, establishing shared batch context.

## 5. Dependency Trace

| # | Caller (Screen/Batch) | Call Chain (Full Path to this Method) | Terminal (SC / CRUD / Entity) |
|---|----------------------|--------------------------------------|-------------------------------|
| 1 | Batch: JBSbatKKSvkeiDelTgCst | (Called as batch initialization entry point; typically invoked by the batch scheduler/CBS layer before main processing) | `setCommonInfo [SET] parent context` + 4x `JBSbatSQLAccess constructor [SET] KK_T_SVKEIUW_EOH_NET, KK_T_SVKEIUW_EOADSL, KK_T_SVC_KEI_EOH_TEL, KK_T_ODR_SET` |

**Notes:** The `initial()` method is not referenced by any other class in the codebase. As a batch service constructor-style method, it is invoked by the batch execution framework (CBS/scheduler layer) which creates the `JBSbatKKSvkeiDelTgCst` instance and calls `initial()` before delegating to the batch's main processing method.

## 6. Per-Branch Detail Blocks

The `initial()` method contains **no conditional branches** (no if/else, switch, or loops). It executes a linear sequence of one parent call and four object instantiations.

**Block 1** — [EXEC] `(no condition)` (L144)

> Invoke parent class's `setCommonInfo` to set common batch parameters.

| # | Type | Code |
|---|------|------|
| 1 | CALL | `super.setCommonInfo(commonItem);` // Set common parameters — propagates batch metadata to parent service class [-> parent: JBSbatBusinessService] |

**Block 2** — [EXEC] `(no condition)` (L147)

> Create SQL access handle for the eo Optical Net (FTTH) service contract details table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVKEIUW_EOH_NET = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVKEIUW_EOH_NET);` // DB access class creation for KK_T_SVKEIUW_EOH_NET [-> CONSTANT D_TBL_NAME_KK_T_SVKEIUW_EOH_NET = "KK_T_SVKEIUW_EOH_NET"] |
| 2 | SET | `// Comment: テーブル(サービス契約内訳＜eo光ネット＞)` // Table: Service contract details <eo Optical Net> |

**Block 3** — [EXEC] `(no condition)` (L148)

> Create SQL access handle for the eo ADSL service contract details table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVKEIUW_EOADSL = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVKEIUW_EOADSL);` // DB access class creation for KK_T_SVKEIUW_EOADSL [-> CONSTANT D_TBL_NAME_KK_T_SVKEIUW_EOADSL = "KK_T_SVKEIUW_EOADSL"] |
| 2 | SET | `// Comment: テーブル(サービス契約内訳＜eo ADSL＞)` // Table: Service contract details <eo ADSL> |

**Block 4** — [EXEC] `(no condition)` (L149)

> Create SQL access handle for the eo Optical Telephone service contract table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_SVC_KEI_EOH_TEL = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_SVC_KEI_EOH_TEL);` // DB access class creation for KK_T_SVC_KEI_EOH_TEL [-> CONSTANT D_TBL_NAME_KK_T_SVC_KEI_EOH_TEL = "KK_T_SVC_KEI_EOH_TEL"] |
| 2 | SET | `// Comment: テーブル(サービス契約＜eo光電話＞)` // Table: Service contract <eo Optical Telephone> |

**Block 5** — [EXEC] `(no condition)` (L150)

> Create SQL access handle for the order settings table.

| # | Type | Code |
|---|------|------|
| 1 | SET | `db_KK_T_ODR_SET = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ODR_SET);` // DB access class creation for KK_T_ODR_SET [-> CONSTANT D_TBL_NAME_KK_T_ODR_SET = "KK_T_ODR_SET"] |
| 2 | SET | `// Comment: テーブル(オーダ設定)` // Table: Order settings |

**Block 6** — [COMMENT] `(deprecated: removed in v5.00.00, IT1-2013-0000285)` (L152–L153)

> The `db_KK_T_ODR_HAKKO_JOKEN` instantiation was commented out (removed) and is no longer executed.

| # | Type | Code |
|---|------|------|
| 1 | COMMENT | `//db_KK_T_ODR_HAKKO_JOKEN = new JBSbatSQLAccess(commonItem, D_TBL_NAME_KK_T_ODR_HAKKO_JOKEN);` // [DEPRECATED] Order release conditions table — removed in v5.00.00 [-> CONSTANT D_TBL_NAME_KK_T_ODR_HAKKO_JOKEN = "KK_T_ODR_HAKKO_JOKEN"] |

**Block 7** — [RETURN] `(no condition)` (L155)

> Method returns void; control passes to the batch's main processing method.

| # | Type | Code |
|---|------|------|
| 1 | RETURN | `return;` // Implicit return — method signature is void |

## 7. Glossary

| Term | Type | Business Meaning |
|------|------|------------------|
| `svc_kei` | Field | Service contract — a customer's subscription agreement for a K-Opticom service |
| `svc_kei_no` | Field | Service contract number — unique identifier for a service contract |
| `svc_keiuw` | Field | Service contract details — line-item level records under a service contract |
| `svc_keiw_no` | Field | Service contract details number — unique identifier for a service contract detail line item |
| `svkei_ucwk_no` | Field | Service detail work number — internal tracking ID for service contract line items |
| `odr_sbt_cd` | Field | Order type code — classifies the type of order (e.g., new subscription, change, cancellation) |
| `odr_naiyo_cd` | Field | Order content code — specifies the nature/content of an order |
| `odr_set` | Field | Order settings — configuration table for order processing rules |
| `odr_hakko` | Field | Order issuance/release — the process of generating an order record in the system |
| `hakko_joken` | Field | Order issuance conditions — criteria that determine when an order should be generated |
| `del_sbt` | Field | Deletion processing type — classifies the kind of deletion operation (e.g., standard, with aging update) |
| `del_trgt_sbt` | Field | Deletion target type — classifies what type of authentication ID is being deleted (ISP, PPP, ADSL) |
| `ninsho_id` | Field | Authentication ID — the identifier used for customer network authentication |
| SOD | Acronym | Service Order Data — order records created when service contract deletions are processed |
| FTTH | Business term | Fiber To The Home — fiber-optic broadband internet service (branded as "eoひかり"/eo Hikari) |
| eo Optical Net | Business term | K-Opticom's FTTH (Fiber-to-the-Home) broadband service |
| eo ADSL | Business term | K-Opticom's ADSL (Asymmetric Digital Subscriber Line) broadband service |
| eo Optical Telephone | Business term | K-Opticom's VoIP/telephony service over optical network |
| ISP | Business term | Internet Service Provider — authentication method for internet access |
| PPP | Business term | Point-to-Point Protocol — network layer authentication protocol used for dial-up/VPN connections |
| ADSL | Business term | Asymmetric Digital Subscriber Line — copper-line broadband technology |
| JBSbatCommonItem | Class | Batch common parameter object — carries shared batch execution metadata (batch ID, date, logging, DB context) |
| JBSbatSQLAccess | Class | Database access abstraction — provides connection and SQL execution context for a specific database table |
| `KK_T_SVKEIUW_EOH_NET` | Table | Service contract details table for eo Optical Net (FTTH) — stores line-item detail records for FTTH subscriptions |
| `KK_T_SVKEIUW_EOADSL` | Table | Service contract details table for eo ADSL — stores line-item detail records for ADSL subscriptions |
| `KK_T_SVC_KEI_EOH_TEL` | Table | Service contract master table for eo Optical Telephone — stores service contract records for telephone subscriptions |
| `KK_T_ODR_SET` | Table | Order settings table — stores configuration for order processing rules |
| `KK_T_ODR_HAKKO_JOKEN` | Table | Order issuance conditions table (DEPRECATED) — was used to define criteria for generating SOD orders; removed in v5.00.00 |
| DEL_TRAN_SBT_SOD | Constant | Deletion processing type: "1" = Standard SOD issuance deletion |
| DEL_TRAN_SBT_SOD_AGING_UPD | Constant | Deletion processing type: "3" = SOD issuance with aging update (added in v5.00.00) |
| DEL_TRGT_SBT_ISP_NINSHO_ID | Constant | Deletion target type: "01" = ISP authentication ID deletion |
| DEL_TRGT_SBT_PPP_NINSHO_ID | Constant | Deletion target type: "06" = PPP authentication ID deletion |
| DEL_TRGT_SBT_ADSL_NINSHO_ID | Constant | Deletion target type: "16" = ADSL authentication ID deletion (added in v5.00.00) |

---
