Implementation:APIJSON APIJSON Demo JedisBuildData
| Knowledge Sources | |
|---|---|
| Domains | Database, Redis, Data_Mapping |
| Last Updated | 2026-10-14 00:00 GMT |
Overview
Concrete tool for mapping APIJSON table/column names to Redis data type operations (STRING, HASH, LIST, SET, ZSET) in the RediSQL demo.
Description
The JedisBuildData class defines constants that map APIJSON virtual table names to Redis data types (e.g., REDIS_STRING, REDIS_HASH, REDIS_LIST) and define APIJSON column names (key, value, score, expire_time, option_method, index). It also defines operation method constants (e.g., set, lpush, hset, zadd) that correspond to Redis commands, enabling APIJSON to perform CRUD on Redis data types through standard JSON requests.
Usage
Reference this class when you need to understand the column/operation naming convention for Redis data type access through APIJSON in the RediSQL demo.
Code Reference
Source Location
- Repository: APIJSON_APIJSON_Demo
- File: APIJSON-Java-Server/APIJSONDemo-MultiDataSource-RediSQL/src/main/java/apijson/demo/JedisBuildData.java
- Lines: 1-195
Signature
public class JedisBuildData {
// Redis data type table prefixes
public static final String REDIS_TABLE_KEY = "REDIS_TABLE_";
public static final String REDIS_STRING_KEY = "REDIS_STRING";
public static final String REDIS_HASH_KEY = "REDIS_HASH";
public static final String REDIS_LIST_KEY = "REDIS_LIST";
public static final String REDIS_SET_KEY = "REDIS_SET";
public static final String REDIS_ZSET_KEY = "REDIS_ZSET";
public static final String REDIS_KEYS = "REDIS_KEYS";
// APIJSON column names
public static final String COLUMN_KEY = "key";
public static final String COLUMN_VALUE = "value";
public static final String COLUMN_SCORE = "score";
public static final String COLUMN_EXPIRE_TIME = "expire_time";
public static final String OPTION_METHOD = "option_method";
public static final String COLUMN_INDEX = "index";
// Operation methods (POST/PUT/DELETE)
public static final String OPTION_METHOD_SET = "set";
public static final String OPTION_METHOD_LPUSH = "lpush";
public static final String OPTION_METHOD_HSET = "hset";
public static final String OPTION_METHOD_SADD = "sadd";
public static final String OPTION_METHOD_ZADD = "zadd";
public static final String OPTION_METHOD_DEL = "del";
// ...
}
Import
import apijson.demo.JedisBuildData;
I/O Contract
Inputs
This is a constants class; no runtime inputs.
Outputs
| Name | Type | Description |
|---|---|---|
| REDIS_*_KEY | String | Virtual table names for Redis data types |
| COLUMN_* | String | Standardized column names for APIJSON-Redis mapping |
| OPTION_METHOD_* | String | Redis command names for CRUD operations |
Usage Examples
Use Constants in Redis Query
// APIJSON request to set a Redis STRING value
{
"REDIS_STRING": {
"key": "mykey",
"value": "myvalue",
"option_method": "set"
}
}