Implementation:APIJSON APIJSON AbstractVerifier AccessFakeDeleteMap
| Knowledge Sources | |
|---|---|
| Domains | ORM, Soft_Delete, Configuration |
| Last Updated | 2026-10-11 00:00 GMT |
Overview
Static configuration map that stores per-table fake-delete settings (deleted key, active value, deleted value) loaded from the Access database table, provided by the APIJSON ORM framework.
Description
The ACCESS_FAKE_DELETE_MAP is a static Map<String, Map<String, Object>> on AbstractVerifier. It maps table names to their fake-delete configuration:
- deletedKey: The column name that holds the soft-delete flag (e.g., "isDeleted")
- notDeletedValue: The value indicating an active (not deleted) row (e.g., 0)
- deletedValue: The value indicating a deleted row (e.g., 1)
The map is initialized as an empty LinkedHashMap in the static initializer and is populated at application startup by loading records from the Access database table.
The map is consumed by:
- AbstractSQLConfig.isFakeDelete() - checks if the current table has fake-delete config
- AbstractSQLConfig.onFakeDelete() - sets the deleted flag value
- AbstractSQLConfig.getWhereString() - appends deletedKey = notDeletedValue filter to GET queries
- AbstractSQLExecutor.executeAppJoin() - applies fake-delete filter to APP JOIN child queries
Usage
Populated at startup by the application's initialization code. Not typically accessed directly by application code; the framework reads it during SQL generation.
Code Reference
Source Location
- Repository: APIJSON
- File: src/main/java/apijson/orm/AbstractVerifier.java
Signature
@NotNull
public static Map<String, Map<String, Object>> ACCESS_FAKE_DELETE_MAP;
// Initialized as:
// ACCESS_FAKE_DELETE_MAP = new LinkedHashMap<>();
Import
import apijson.orm.AbstractVerifier;
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (table name) | String | Yes | Key in the map |
Outputs
| Name | Type | Description |
|---|---|---|
| config | Map<String,Object> | Fake-delete config with deletedKey, notDeletedValue, deletedValue |
Usage Examples
Loading Fake-Delete Config
// At application startup, load from Access table:
Map<String, Object> momentFakeDelete = new HashMap<>();
momentFakeDelete.put("deletedKey", "isDeleted");
momentFakeDelete.put("notDeletedValue", 0);
momentFakeDelete.put("deletedValue", 1);
AbstractVerifier.ACCESS_FAKE_DELETE_MAP.put("Moment", momentFakeDelete);
// Now DELETE on Moment table will:
// 1. isFakeDelete() returns true (table in map, method=DELETE)
// 2. onFakeDelete() sets isDeleted=1
// 3. SQL: UPDATE Moment SET isDeleted=1 WHERE id=123