Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
该Pull Request关联的Issue
修改描述
在使用mapper的selectList方法时,查询一个宽表或者查询的字段占据表总字段数比例较低时,应该用select(Student::getName, Student::getAge)来选择需要的字段。查询出来的实体Bean在分层架构中直接透穿是不安全的,不便理解的,效率较低。此时需要将Bean进行转换成目标Bean。
测试用例
`
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
@ExtendWith(SpringExtension.class)
@ContextConfiguration(locations = {"classpath:h2/spring-test-h2.xml"})
class H2UserMapperTest extends BaseTest {
}
class BeanConvertUtilsTest {
}`
修复效果的截屏