T - 主表实体类型C - 子表实体类型public interface KeyMapping<T,C>
通常用于动态 SQL 查询中,将主表记录与子表记录进行关联, 并在结果中以集合方式呈现(如将多个子记录封装进主记录的一个字段中)。
static <T,C> KeyMapping<T,C> of(FieldFn<T,?> parentKey, FieldFn<C,?> childKey)
例如:
KeyMapping.of(Category::getCategoryId, Product::getCategoryId)
用于将 Category 的 categoryId 与 Product 的 categoryId 建立一对多关系。T - 主表类型C - 子表类型parentKey - 主表键字段引用childKey - 子表键字段引用Copyright © 2024–2025 Dynamic-SQL. All rights reserved.