Interface QueryLabel<Children>
- All Known Implementing Classes:
KtLambdaWrapper
public interface QueryLabel<Children>
对一或对多查询
- Since:
- 1.4.6
- Author:
- yulichang
-
Method Summary
Modifier and TypeMethodDescriptionvoiddefault ChildrenselectAssociation(Class<?> child, kotlin.reflect.KProperty<?> dtoField) 对一查询 用法参考 selectCollectiondefault ChildrenselectAssociation(Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) 对一查询 用法参考 selectCollectiondefault ChildrenselectAssociation(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField) default ChildrenselectAssociation(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) default ChildrenselectAssociation(kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabelFree.Builder<?>> collection) default ChildrenselectCollection(Class<?> child, kotlin.reflect.KProperty<?> dtoField) 一对多查询 调用此方法发必需要调用对应的 left join / right join ...default ChildrenselectCollection(Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) 一对多查询 调用此方法发必需要调用对应的 left join / right join ...default ChildrenselectCollection(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField) default ChildrenselectCollection(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) default ChildrenselectCollection(kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabelFree.Builder<?>> collection)
-
Method Details
-
addLabel
-
getChildren
Children getChildren() -
selectCollection
一对多查询 调用此方法发必需要调用对应的 left join / right join ... 连表方法,否则会报错举例 UserDO AddressDO 为一对多关系 UserDTO 为结果类
MPJLambdaWrapper<UserDO> wrapper = new MPJLambdaWrapper<UserDO>(); wrapper.selectAll(UserDO.class) .selectCollection(AddressDO.class, UserDTO::getAddressListDTO) .leftJoin(AddressDO.class, ...... ) .eq(...) ... 会自动将 AddressDO类中相同属性的字段 以mybatis的方式映射到UserDTO.addressListDTO属性中 - Parameters:
child- 连表数据库实体类dtoField- 包装类对应的属性- Since:
- 1.3.0
-
selectCollection
-
selectCollection
default Children selectCollection(Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) 一对多查询 调用此方法发必需要调用对应的 left join / right join ... 连表方法,否则会报错举例 UserDO AddressDO 为一对多关系 UserDTO 为结果类
MPJLambdaWrapper<UserDO> wrapper = new MPJLambdaWrapper(); wrapper.selectAll(UserDO.class) .selectCollection(AddressDO.class, UserDTO::getAddressListDTO, map -> map .id(AddressDO::getId, AddressDTO::getId) //如果属性名一致 可以传一个 .result(AddressDO::getUserId) //如果属性名一致 可以传一个 .result(AddressDO::getAddress, AddressDTO::getAddress))) //如果属性名一致 可以传一个 .leftJoin(AddressDO.class, ...... ) .eq(...) ... 会自动将 AddressDO类中指定的字段 以mybatis的方式映射到UserDTO.addressListDTO属性中 - Parameters:
child- 连表数据库实体类dtoField- 包装类对应的属性collection- collection标签内容- Since:
- 1.3.0
-
selectCollection
default Children selectCollection(kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabelFree.Builder<?>> collection) -
selectCollection
default Children selectCollection(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) -
selectAssociation
对一查询 用法参考 selectCollection- Since:
- 1.3.0
-
selectAssociation
-
selectAssociation
default Children selectAssociation(Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection) 对一查询 用法参考 selectCollection- Since:
- 1.3.0
-
selectAssociation
default Children selectAssociation(kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabelFree.Builder<?>> collection) -
selectAssociation
default Children selectAssociation(String prefix, Class<?> child, kotlin.reflect.KProperty<?> dtoField, MFunction<MybatisLabel.Builder<?, ?>> collection)
-