mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
pref: optimize TableDefs.getTableDef()
This commit is contained in:
parent
94eca5283a
commit
53342842da
@ -53,18 +53,21 @@ public class TableDefs implements Serializable {
|
||||
|
||||
|
||||
public static TableDef getTableDef(Class<?> entityClass, String tableNameWithSchema) {
|
||||
if (!TABLE_DEF_MAP.containsKey(tableNameWithSchema)) {
|
||||
TableDef tableDef = TABLE_DEF_MAP.get(tableNameWithSchema);
|
||||
if (tableDef == null) {
|
||||
init(entityClass.getPackage().getName());
|
||||
tableDef = TABLE_DEF_MAP.get(tableNameWithSchema);
|
||||
}
|
||||
return TABLE_DEF_MAP.get(tableNameWithSchema);
|
||||
return tableDef;
|
||||
}
|
||||
|
||||
|
||||
public static QueryColumn getQueryColumn(Class<?> entityClass, String tableNameWithSchema, String column) {
|
||||
if (!TABLE_DEF_MAP.containsKey(tableNameWithSchema)) {
|
||||
init(entityClass.getPackage().getName());
|
||||
}
|
||||
Map<String, QueryColumn> queryColumnMap = QUERY_COLUMN_MAP.get(tableNameWithSchema);
|
||||
if (queryColumnMap == null) {
|
||||
init(entityClass.getPackage().getName());
|
||||
queryColumnMap = QUERY_COLUMN_MAP.get(tableNameWithSchema);
|
||||
}
|
||||
return queryColumnMap != null ? queryColumnMap.get(column) : null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user