public class JsonConfigMapper extends ConfigJoinMapper
JsonMapper| 限定符和类型 | 字段和说明 |
|---|---|
protected static Map<org.beetl.sql.core.mapping.join.JsonConfigMapper.Key,AttrNode> |
cache |
protected static Map<org.beetl.sql.core.mapping.join.JsonConfigMapper.SqlIdKey,AttrNode> |
sqlIdCache |
| 构造器和说明 |
|---|
JsonConfigMapper() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected Map<String,Object> |
getConfig(ExecuteContext ctx,
Annotation config)
得到一个映射配置
{
"id":"id"
"userName":"user_name",
"dept":{
"id":"dept_id",
"name":"dept_name"
}
"roles":{
"code":"role_code"
}
}
|
protected String |
getConfigStr(ExecuteContext ctx,
Class target,
Annotation config) |
protected Map<String,Object> |
getMappingByJson(ExecuteContext ctx,
String json)
使用Beetl把json字符串转成Map结构
|
protected AttrNode |
parse(ExecuteContext ctx,
Class target,
ResultSetMetaData rsmd,
Annotation config)
子类继承,根据映射配置获得一个树结构,需要考虑缓存以避免每次解析
|
getColumnIndex, mappingprotected AttrNode parse(ExecuteContext ctx, Class target, ResultSetMetaData rsmd, Annotation config) throws Exception
ConfigJoinMapperparse 在类中 ConfigJoinMapperSQLExceptionExceptionprotected String getConfigStr(ExecuteContext ctx, Class target, Annotation config)
protected Map<String,Object> getMappingByJson(ExecuteContext ctx, String json)
ctx - json - protected Map<String,Object> getConfig(ExecuteContext ctx, Annotation config)
{
"id":"id"
"userName":"user_name",
"dept":{
"id":"dept_id",
"name":"dept_name"
}
"roles":{
"code":"role_code"
}
}
ctx - config - Copyright © 2021. All rights reserved.